class Device


A physical device (such as phone, watch, scale, or chest strap) which captured associated health data point.

Device needs to be populated by users of the API. Metadata fields not provided by clients will remain absent.

Some device types are only available on newer versions of Health Connect. See androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES for more details.

Summary

Constants

const Int
const Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES.

const Int
const Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES.

const Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES.

const Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES.

const Int
const Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES.

const Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES.

const Int
const Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES.

const Int
const Int
const Int
const Int
const Int

Public constructors

Device(type: Int, manufacturer: String?, model: String?)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

String?

an optional client supplied manufacturer of the device

String?

an optional client supplied model of the device

Int

a client supplied type of the device

Constants

TYPE_CHEST_STRAP

const val TYPE_CHEST_STRAP = 7: Int

TYPE_CONSUMER_MEDICAL_DEVICE

const val TYPE_CONSUMER_MEDICAL_DEVICE = 9: Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES. If the feature is not available, this device type will be treated as TYPE_UNKNOWN.

TYPE_FITNESS_BAND

const val TYPE_FITNESS_BAND = 6: Int

TYPE_FITNESS_EQUIPMENT

const val TYPE_FITNESS_EQUIPMENT = 13: Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES. If the feature is not available, this device type will be treated as TYPE_UNKNOWN.

TYPE_FITNESS_MACHINE

const val TYPE_FITNESS_MACHINE = 12: Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES. If the feature is not available, this device type will be treated as TYPE_UNKNOWN.

TYPE_GLASSES

const val TYPE_GLASSES = 10: Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES. If the feature is not available, this device type will be treated as TYPE_UNKNOWN.

TYPE_HEAD_MOUNTED

const val TYPE_HEAD_MOUNTED = 5: Int

TYPE_HEARABLE

const val TYPE_HEARABLE = 11: Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES. If the feature is not available, this device type will be treated as TYPE_UNKNOWN.

TYPE_METER

const val TYPE_METER = 15: Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES. If the feature is not available, this device type will be treated as TYPE_UNKNOWN.

TYPE_PHONE

const val TYPE_PHONE = 2: Int

TYPE_PORTABLE_COMPUTER

const val TYPE_PORTABLE_COMPUTER = 14: Int

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_EXTENDED_DEVICE_TYPES. If the feature is not available, this device type will be treated as TYPE_UNKNOWN.

TYPE_RING

const val TYPE_RING = 4: Int

TYPE_SCALE

const val TYPE_SCALE = 3: Int

TYPE_SMART_DISPLAY

const val TYPE_SMART_DISPLAY = 8: Int

TYPE_UNKNOWN

const val TYPE_UNKNOWN = 0: Int

TYPE_WATCH

const val TYPE_WATCH = 1: Int

Public constructors

Device

Added in 1.1.0
Device(type: Int, manufacturer: String? = null, model: String? = null)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

manufacturer

Added in 1.1.0
val manufacturerString?

an optional client supplied manufacturer of the device

model

Added in 1.1.0
val modelString?

an optional client supplied model of the device

type

Added in 1.1.0
val typeInt

a client supplied type of the device