Added in API level 34

Metadata


class Metadata
kotlin.Any
   ↳ android.health.connect.datatypes.Metadata

Set of shared metadata fields for Record

Summary

Nested classes

Constants
static Int

For actively recorded data by the user.

static Int

For passively recorded data by the app.

static Int

For manually entered data by the user.

static Int

Unknown recording method.

Public methods
Boolean
equals(other: Any?)

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

String?

Long

DataOrigin

Device

String

Instant

Int

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

Int

Returns a hash code value for the object.

Constants

RECORDING_METHOD_ACTIVELY_RECORDED

Added in API level 34
static val RECORDING_METHOD_ACTIVELY_RECORDED: Int

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.

Value: 1

RECORDING_METHOD_AUTOMATICALLY_RECORDED

Added in API level 34
static val RECORDING_METHOD_AUTOMATICALLY_RECORDED: Int

For passively recorded data by the app.

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

Value: 2

RECORDING_METHOD_MANUAL_ENTRY

Added in API level 34
static val RECORDING_METHOD_MANUAL_ENTRY: Int

For manually entered data by the user.

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

Value: 3

RECORDING_METHOD_UNKNOWN

Added in API level 34
static val RECORDING_METHOD_UNKNOWN: Int

Unknown recording method.

Value: 0

Public methods

equals

Added in API level 34
fun equals(other: Any?): Boolean

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

Parameters
obj the reference object with which to compare.
object the reference object with which to compare. This value may be null.
Return
Boolean true if this object is the same as the obj

getClientRecordId

Added in API level 34
fun getClientRecordId(): String?
Return
String? Client record ID if set, null otherwise

getClientRecordVersion

Added in API level 34
fun getClientRecordVersion(): Long
Return
Long Client record version if set, 0 otherwise

getDataOrigin

Added in API level 34
fun getDataOrigin(): DataOrigin
Return
DataOrigin Corresponds to package name if set. If no data origin is set getDataOrigin().getPackageName() will return null

getDevice

Added in API level 34
fun getDevice(): Device
Return
Device The device details that contributed to this record This value cannot be null.

getId

Added in API level 34
fun getId(): String
Return
String Record identifier if set, empty string otherwise This value cannot be null.

getLastModifiedTime

Added in API level 34
fun getLastModifiedTime(): Instant
Return
Instant Record's last modified time if set, Instant.EPOCH otherwise This value cannot be null.

hashCode

Added in API level 34
fun hashCode(): Int

Returns a hash code value for the object.

Return
Int a hash code value for this object.