# BloodGlucose

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/units/BloodGlucose.kt+class:androidx.health.connect.client.units.BloodGlucose) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

*** ** * ** ***


```
public final class BloodGlucose implements Comparable<@NonNull BloodGlucose>
```

<br />

*** ** * ** ***

Represents a unit of blood glucose level (glycaemia). Supported units:

- mmol/L - see `https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose#millimolesPerLiter(kotlin.Double)`

- mg/dL - see `https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose#milligramsPerDeciliter(kotlin.Double)`

## Summary

| ### Public methods |
|---|---|
| `int` | `https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose#compareTo(androidx.health.connect.client.units.BloodGlucose)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose other)` |
| `boolean` | `https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final double` | `https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose#getMilligramsPerDeciliter()()` Returns the blood glucose level concentration in mg/dL. |
| `final double` | `https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose#getMillimolesPerLiter()()` Returns the blood glucose level in mmol/L. |
| `int` | `https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose#hashCode()()` |
| `static 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/units/BloodGlucose#milligramsPerDeciliter(kotlin.Double)(double value)` Creates `https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose` with the specified value in mg/dL. |
| `static 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/units/BloodGlucose#millimolesPerLiter(kotlin.Double)(double value)` Creates `https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose` with the specified value in mmol/L. |
| `@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/units/BloodGlucose#toString()()` |

## Public methods

### compareTo

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

```
public int compareTo(@NonNull BloodGlucose other)
```

### equals

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

### getMilligramsPerDeciliter

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

```
public final double getMilligramsPerDeciliter()
```

Returns the blood glucose level concentration in mg/dL.

### getMillimolesPerLiter

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

```
public final double getMillimolesPerLiter()
```

Returns the blood glucose level in mmol/L.

### hashCode

```
public int hashCode()
```

### milligramsPerDeciliter

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

```
public static final @NonNull BloodGlucose milligramsPerDeciliter(double value)
```

Creates `https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose` with the specified value in mg/dL.

### millimolesPerLiter

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

```
public static final @NonNull BloodGlucose millimolesPerLiter(double value)
```

Creates `https://developer.android.com/reference/androidx/health/connect/client/units/BloodGlucose` with the specified value in mmol/L.

### toString

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