public final 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

static final int
static final int

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

static final int
static final int

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

static final int

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

static final int

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

static final int
static final int

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

static final int

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

static final int
static final int

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

static final int
static final int
static final int
static final int
static final int

Public constructors

Device(int type, String manufacturer, String model)

Public methods

boolean
equals(Object other)
final String

an optional client supplied manufacturer of the device

final String

an optional client supplied model of the device

final int

a client supplied type of the device

int
@NonNull String

Constants

TYPE_CHEST_STRAP

public static final int TYPE_CHEST_STRAP = 7

TYPE_CONSUMER_MEDICAL_DEVICE

public static final int TYPE_CONSUMER_MEDICAL_DEVICE = 9

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

public static final int TYPE_FITNESS_BAND = 6

TYPE_FITNESS_EQUIPMENT

public static final int TYPE_FITNESS_EQUIPMENT = 13

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

public static final int TYPE_FITNESS_MACHINE = 12

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

public static final int TYPE_GLASSES = 10

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

public static final int TYPE_HEAD_MOUNTED = 5

TYPE_HEARABLE

public static final int TYPE_HEARABLE = 11

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

public static final int TYPE_METER = 15

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

public static final int TYPE_PHONE = 2

TYPE_PORTABLE_COMPUTER

public static final int TYPE_PORTABLE_COMPUTER = 14

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

public static final int TYPE_RING = 4

TYPE_SCALE

public static final int TYPE_SCALE = 3

TYPE_SMART_DISPLAY

public static final int TYPE_SMART_DISPLAY = 8

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN = 0

TYPE_WATCH

public static final int TYPE_WATCH = 1

Public constructors

Device

Added in 1.1.0
public Device(int type, String manufacturer, String model)

Public methods

equals

public boolean equals(Object other)

getManufacturer

Added in 1.1.0
public final String getManufacturer()

an optional client supplied manufacturer of the device

getModel

Added in 1.1.0
public final String getModel()

an optional client supplied model of the device

getType

Added in 1.1.0
public final int getType()

a client supplied type of the device

hashCode

public int hashCode()

toString

public @NonNull String toString()