Device


public final class Device
extends Object

java.lang.Object
   ↳ android.health.connect.datatypes.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.

Summary

Nested classes

class Device.Builder

 

Constants

int DEVICE_TYPE_CHEST_STRAP

int DEVICE_TYPE_FITNESS_BAND

int DEVICE_TYPE_HEAD_MOUNTED

int DEVICE_TYPE_PHONE

int DEVICE_TYPE_RING

int DEVICE_TYPE_SCALE

int DEVICE_TYPE_SMART_DISPLAY

int DEVICE_TYPE_UNKNOWN

int DEVICE_TYPE_WATCH

Public methods

boolean equals(Object object)

Indicates whether some other object is "equal to" this one.

String getManufacturer()
String getModel()
int getType()
int hashCode()

Returns a hash code value for the object.

Inherited methods

Constants

DEVICE_TYPE_CHEST_STRAP

Added in API level 34
public static final int DEVICE_TYPE_CHEST_STRAP

Constant Value: 7 (0x00000007)

DEVICE_TYPE_FITNESS_BAND

Added in API level 34
public static final int DEVICE_TYPE_FITNESS_BAND

Constant Value: 6 (0x00000006)

DEVICE_TYPE_HEAD_MOUNTED

Added in API level 34
public static final int DEVICE_TYPE_HEAD_MOUNTED

Constant Value: 5 (0x00000005)

DEVICE_TYPE_PHONE

Added in API level 34
public static final int DEVICE_TYPE_PHONE

Constant Value: 2 (0x00000002)

DEVICE_TYPE_RING

Added in API level 34
public static final int DEVICE_TYPE_RING

Constant Value: 4 (0x00000004)

DEVICE_TYPE_SCALE

Added in API level 34
public static final int DEVICE_TYPE_SCALE

Constant Value: 3 (0x00000003)

DEVICE_TYPE_SMART_DISPLAY

Added in API level 34
public static final int DEVICE_TYPE_SMART_DISPLAY

Constant Value: 8 (0x00000008)

DEVICE_TYPE_UNKNOWN

Added in API level 34
public static final int DEVICE_TYPE_UNKNOWN

Constant Value: 0 (0x00000000)

DEVICE_TYPE_WATCH

Added in API level 34
public static final int DEVICE_TYPE_WATCH

Constant Value: 1 (0x00000001)

Public methods

equals

Added in API level 34
public boolean equals (Object object)

Indicates whether some other object is "equal to" this one.

Parameters
object Object: the reference object with which to compare. This value may be null.

Returns
boolean true if this object is the same as the obj

getManufacturer

Added in API level 34
public String getManufacturer ()

Returns
String The device manufacturer if set, null otherwise

getModel

Added in API level 34
public String getModel ()

Returns
String The device model if set, null otherwise

getType

Added in API level 34
public int getType ()

Returns
int The device type if set DEVICE_TYPE_UNKNOWN otherwise Value is DEVICE_TYPE_UNKNOWN, DEVICE_TYPE_WATCH, DEVICE_TYPE_PHONE, DEVICE_TYPE_SCALE, DEVICE_TYPE_RING, DEVICE_TYPE_HEAD_MOUNTED, DEVICE_TYPE_FITNESS_BAND, DEVICE_TYPE_CHEST_STRAP, or DEVICE_TYPE_SMART_DISPLAY

hashCode

Added in API level 34
public int hashCode ()

Returns a hash code value for the object.

Returns
int a hash code value for this object.