# BloodGlucoseRecord

Artifact: [androidx.health.connect:connect-client](https://developer.android.com/jetpack/androidx/releases/health-connect) [View Source](https://cs.android.com/search?q=file:androidx/health/connect/client/records/BloodGlucoseRecord.kt+class:androidx.health.connect.client.records.BloodGlucoseRecord) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

*** ** * ** ***


```
public final class BloodGlucoseRecord implements Record
```

<br />

*** ** * ** ***

Captures the concentration of glucose in the blood. Each record represents a single instantaneous blood glucose reading.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#RELATION_TO_MEAL_AFTER_MEAL() = 4` |
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#RELATION_TO_MEAL_BEFORE_MEAL() = 3` |
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#RELATION_TO_MEAL_FASTING() = 2` |
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#RELATION_TO_MEAL_GENERAL() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#RELATION_TO_MEAL_UNKNOWN() = 0` |
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#SPECIMEN_SOURCE_CAPILLARY_BLOOD() = 2` |
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#SPECIMEN_SOURCE_INTERSTITIAL_FLUID() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#SPECIMEN_SOURCE_PLASMA() = 3` |
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#SPECIMEN_SOURCE_SERUM() = 4` |
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#SPECIMEN_SOURCE_TEARS() = 5` |
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#SPECIMEN_SOURCE_UNKNOWN() = 0` |
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#SPECIMEN_SOURCE_WHOLE_BLOOD() = 6` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#BloodGlucoseRecord(java.time.Instant,java.time.ZoneOffset,androidx.health.connect.client.records.metadata.Metadata,androidx.health.connect.client.units.BloodGlucose,kotlin.Int,kotlin.Int,kotlin.Int)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html time, https://developer.android.com/reference/java/time/ZoneOffset.html zoneOffset, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata metadata, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose level, int specimenSource, int mealType, int relationToMeal )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#getLevel()()` Blood glucose level or concentration. |
| `final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#getMealType()()` Type of meal related to the blood glucose measurement. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#getMetadata()()` Set of common metadata associated with the written record. |
| `final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#getRelationToMeal()()` Relationship of the meal to the blood glucose measurement. |
| `final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#getSpecimenSource()()` Type of body fluid used to measure the blood glucose. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#getTime()()` Time the record happened. |
| `https://developer.android.com/reference/java/time/ZoneOffset.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#getZoneOffset()()` User experienced zone offset at `https://developer.android.com/reference/androidx/health/connect/client/records/InstantaneousRecord#time()`, or null if unknown. |
| `int` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord#toString()()` |

## Constants

### RELATION_TO_MEAL_AFTER_MEAL

```
public static final int RELATION_TO_MEAL_AFTER_MEAL = 4
```

### RELATION_TO_MEAL_BEFORE_MEAL

```
public static final int RELATION_TO_MEAL_BEFORE_MEAL = 3
```

### RELATION_TO_MEAL_FASTING

```
public static final int RELATION_TO_MEAL_FASTING = 2
```

### RELATION_TO_MEAL_GENERAL

```
public static final int RELATION_TO_MEAL_GENERAL = 1
```

### RELATION_TO_MEAL_UNKNOWN

```
public static final int RELATION_TO_MEAL_UNKNOWN = 0
```

### SPECIMEN_SOURCE_CAPILLARY_BLOOD

```
public static final int SPECIMEN_SOURCE_CAPILLARY_BLOOD = 2
```

### SPECIMEN_SOURCE_INTERSTITIAL_FLUID

```
public static final int SPECIMEN_SOURCE_INTERSTITIAL_FLUID = 1
```

### SPECIMEN_SOURCE_PLASMA

```
public static final int SPECIMEN_SOURCE_PLASMA = 3
```

### SPECIMEN_SOURCE_SERUM

```
public static final int SPECIMEN_SOURCE_SERUM = 4
```

### SPECIMEN_SOURCE_TEARS

```
public static final int SPECIMEN_SOURCE_TEARS = 5
```

### SPECIMEN_SOURCE_UNKNOWN

```
public static final int SPECIMEN_SOURCE_UNKNOWN = 0
```

### SPECIMEN_SOURCE_WHOLE_BLOOD

```
public static final int SPECIMEN_SOURCE_WHOLE_BLOOD = 6
```

## Public constructors

### BloodGlucoseRecord

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
public BloodGlucoseRecord(
    @NonNull Instant time,
    ZoneOffset zoneOffset,
    @NonNull Metadata metadata,
    @NonNull BloodGlucose level,
    int specimenSource,
    int mealType,
    int relationToMeal
)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getLevel

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
public final @NonNull BloodGlucose getLevel()
```

Blood glucose level or concentration. Required field. Valid range: 0-50 mmol/L.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose` |   |

### getMealType

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
public final int getMealType()
```

Type of meal related to the blood glucose measurement. Optional, enum field. Allowed values: `https://developer.android.com/reference/androidx/health/connect/client/records/MealType`.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/health/connect/client/records/MealType` |   |

### getMetadata

```
public @NonNull Metadata getMetadata()
```

Set of common metadata associated with the written record.

### getRelationToMeal

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
public final int getRelationToMeal()
```

Relationship of the meal to the blood glucose measurement. Optional, enum field. Allowed values: `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord.RelationToMeal`.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord.RelationToMeal` |   |

### getSpecimenSource

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
public final int getSpecimenSource()
```

Type of body fluid used to measure the blood glucose. Optional, enum field. Allowed values: `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord.SpecimenSource`.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/health/connect/client/records/BloodGlucoseRecord.SpecimenSource` |   |

### getTime

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
public @NonNull Instant getTime()
```

Time the record happened.

### getZoneOffset

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
public ZoneOffset getZoneOffset()
```

User experienced zone offset at `https://developer.android.com/reference/androidx/health/connect/client/records/InstantaneousRecord#time()`, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```