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

 

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

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

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

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

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 ()

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.