class WeightRecord : Record


Captures the user's weight.

See Mass for supported units.

Summary

Public companion properties

AggregateMetric<Mass>

Metric identifier to retrieve the average weight from androidx.health.connect.client.aggregate.AggregationResult.

AggregateMetric<Mass>

Metric identifier to retrieve the maximum weight from androidx.health.connect.client.aggregate.AggregationResult.

AggregateMetric<Mass>

Metric identifier to retrieve the minimum weight from androidx.health.connect.client.aggregate.AggregationResult.

Public constructors

WeightRecord(
    time: Instant,
    zoneOffset: ZoneOffset?,
    weight: Mass,
    metadata: Metadata
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

open Metadata

Set of common metadata associated with the written record.

open Instant

Time the record happened.

Mass

User's weight in kilograms.

open ZoneOffset?

User experienced zone offset at time, or null if unknown.

Public companion properties

WEIGHT_AVG

val WEIGHT_AVGAggregateMetric<Mass>

Metric identifier to retrieve the average weight from androidx.health.connect.client.aggregate.AggregationResult.

WEIGHT_MAX

val WEIGHT_MAXAggregateMetric<Mass>

Metric identifier to retrieve the maximum weight from androidx.health.connect.client.aggregate.AggregationResult.

WEIGHT_MIN

val WEIGHT_MINAggregateMetric<Mass>

Metric identifier to retrieve the minimum weight from androidx.health.connect.client.aggregate.AggregationResult.

Public constructors

WeightRecord

Added in 1.1.0-alpha10
WeightRecord(
    time: Instant,
    zoneOffset: ZoneOffset?,
    weight: Mass,
    metadata: Metadata = Metadata.EMPTY
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

metadata

Added in 1.1.0-alpha10
open val metadataMetadata

Set of common metadata associated with the written record.

time

Added in 1.1.0-alpha10
open val timeInstant

Time the record happened.

weight

Added in 1.1.0-alpha10
val weightMass

User's weight in kilograms. Required field. Valid range: 0-1000 kilograms.

zoneOffset

Added in 1.1.0-alpha10
open val zoneOffsetZoneOffset?

User experienced zone offset at time, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent.