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
public static final int DEVICE_TYPE_CHEST_STRAP
Constant Value: 7 (0x00000007)
DEVICE_TYPE_FITNESS_BAND
public static final int DEVICE_TYPE_FITNESS_BAND
Constant Value: 6 (0x00000006)
DEVICE_TYPE_HEAD_MOUNTED
public static final int DEVICE_TYPE_HEAD_MOUNTED
Constant Value: 5 (0x00000005)
DEVICE_TYPE_PHONE
public static final int DEVICE_TYPE_PHONE
Constant Value: 2 (0x00000002)
DEVICE_TYPE_RING
public static final int DEVICE_TYPE_RING
Constant Value: 4 (0x00000004)
DEVICE_TYPE_SCALE
public static final int DEVICE_TYPE_SCALE
Constant Value: 3 (0x00000003)
DEVICE_TYPE_SMART_DISPLAY
public static final int DEVICE_TYPE_SMART_DISPLAY
Constant Value: 8 (0x00000008)
DEVICE_TYPE_UNKNOWN
public static final int DEVICE_TYPE_UNKNOWN
Constant Value: 0 (0x00000000)
DEVICE_TYPE_WATCH
public static final int DEVICE_TYPE_WATCH
Constant Value: 1 (0x00000001)
Public methods
equals
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
public String getManufacturer ()
Returns | |
---|---|
String |
The device manufacturer if set, null otherwise |
getModel
public String getModel ()
Returns | |
---|---|
String |
The device model if set, null otherwise |
getType
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
public int hashCode ()
Returns a hash code value for the object.
Returns | |
---|---|
int |
a hash code value for this object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-04-11 UTC.