Metadata


public final class Metadata
extends Object

java.lang.Object
   ↳ android.health.connect.datatypes.Metadata


Set of shared metadata fields for Record

Summary

Nested classes

class Metadata.Builder

 

Constants

int RECORDING_METHOD_ACTIVELY_RECORDED

For actively recorded data by the user.

int RECORDING_METHOD_AUTOMATICALLY_RECORDED

For passively recorded data by the app.

int RECORDING_METHOD_MANUAL_ENTRY

For manually entered data by the user.

int RECORDING_METHOD_UNKNOWN

Unknown recording method.

Public methods

boolean equals(Object object)

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

String getClientRecordId()
long getClientRecordVersion()
DataOrigin getDataOrigin()
Device getDevice()
String getId()
Instant getLastModifiedTime()
int getRecordingMethod()

Returns recording method which indicates how data was recorded for the Record

int hashCode()

Returns a hash code value for the object.

Inherited methods

Constants

RECORDING_METHOD_ACTIVELY_RECORDED

Added in API level 34
public static final int RECORDING_METHOD_ACTIVELY_RECORDED

For actively recorded data by the user.

For e.g. An exercise session actively recorded by the user using a phone or a watch device.

Constant Value: 1 (0x00000001)

RECORDING_METHOD_AUTOMATICALLY_RECORDED

Added in API level 34
public static final int RECORDING_METHOD_AUTOMATICALLY_RECORDED

For passively recorded data by the app.

For e.g. Steps data recorded by a watch or phone without the user starting a session.

Constant Value: 2 (0x00000002)

RECORDING_METHOD_MANUAL_ENTRY

Added in API level 34
public static final int RECORDING_METHOD_MANUAL_ENTRY

For manually entered data by the user.

For e.g. Nutrition or weight data entered by the user.

Constant Value: 3 (0x00000003)

RECORDING_METHOD_UNKNOWN

Added in API level 34
public static final int RECORDING_METHOD_UNKNOWN

Unknown recording method.

Constant Value: 0 (0x00000000)

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

getClientRecordId

Added in API level 34
public String getClientRecordId ()

Returns
String Client record ID if set, null otherwise

getClientRecordVersion

Added in API level 34
public long getClientRecordVersion ()

Returns
long Client record version if set, 0 otherwise

getDataOrigin

Added in API level 34
public DataOrigin getDataOrigin ()

Returns
DataOrigin Corresponds to package name if set. If no data origin is set getDataOrigin().getPackageName() will return null

getDevice

Added in API level 34
public Device getDevice ()

Returns
Device The device details that contributed to this record This value cannot be null.

getId

Added in API level 34
public String getId ()

Returns
String Record identifier if set, empty string otherwise This value cannot be null.

getLastModifiedTime

Added in API level 34
public Instant getLastModifiedTime ()

Returns
Instant Record's last modified time if set, Instant.EPOCH otherwise This value cannot be null.

getRecordingMethod

Added in API level 34
public int getRecordingMethod ()

Returns recording method which indicates how data was recorded for the Record

Returns
int Value is RECORDING_METHOD_UNKNOWN, RECORDING_METHOD_ACTIVELY_RECORDED, RECORDING_METHOD_AUTOMATICALLY_RECORDED, or RECORDING_METHOD_MANUAL_ENTRY

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.