ActivityIntensityRecord


class ActivityIntensityRecord : Record


Represents intensity of an activity.

Intensity can be either moderate or vigorous.

Each record requires the start time, the end time and the activity intensity type.

The ability to insert or read this record type is dependent on the version of Health Connect installed on the device. To check if available: call HealthConnectFeatures.getFeatureStatus and pass HealthConnectFeatures.FEATURE_ACTIVITY_INTENSITY as an argument.

Summary

Constants

const Int

Moderate intensity activity

const Int

Vigorous intensity activity.

Public companion properties

AggregateMetric<Duration>

Metric identifier to retrieve the total duration of activity intensity regardless of the type from androidx.health.connect.client.aggregate.AggregationResult.

AggregateMetric<Duration>

Metric identifier to retrieve the number of weighted intensity minutes from androidx.health.connect.client.aggregate.AggregationResult.

AggregateMetric<Duration>

Metric identifier to retrieve the total duration of moderate activity intensity from androidx.health.connect.client.aggregate.AggregationResult.

AggregateMetric<Duration>

Metric identifier to retrieve the total duration of vigorous activity intensity from androidx.health.connect.client.aggregate.AggregationResult.

Public constructors

ActivityIntensityRecord(
    startTime: Instant,
    startZoneOffset: ZoneOffset?,
    endTime: Instant,
    endZoneOffset: ZoneOffset?,
    metadata: Metadata,
    activityIntensityType: Int
)

Public functions

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

Public properties

Int

Type of activity intensity (moderate or vigorous).

open Instant

End time of the record.

open ZoneOffset?

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

open Metadata

Set of common metadata associated with the written record.

open Instant

Start time of the record.

open ZoneOffset?

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

Constants

ACTIVITY_INTENSITY_TYPE_MODERATE

const val ACTIVITY_INTENSITY_TYPE_MODERATE = 0: Int

Moderate intensity activity

ACTIVITY_INTENSITY_TYPE_VIGOROUS

const val ACTIVITY_INTENSITY_TYPE_VIGOROUS = 1: Int

Vigorous intensity activity.

Public companion properties

DURATION_TOTAL

val DURATION_TOTALAggregateMetric<Duration>

Metric identifier to retrieve the total duration of activity intensity regardless of the type from androidx.health.connect.client.aggregate.AggregationResult. To check if this metric is available, use HealthConnectFeatures.getFeatureStatus with HealthConnectFeatures.FEATURE_ACTIVITY_INTENSITY as the argument.

INTENSITY_MINUTES_TOTAL

val INTENSITY_MINUTES_TOTALAggregateMetric<Duration>

Metric identifier to retrieve the number of weighted intensity minutes from androidx.health.connect.client.aggregate.AggregationResult. To check if this metric is available, use HealthConnectFeatures.getFeatureStatus with HealthConnectFeatures.FEATURE_ACTIVITY_INTENSITY as the argument.

MODERATE_DURATION_TOTAL

val MODERATE_DURATION_TOTALAggregateMetric<Duration>

Metric identifier to retrieve the total duration of moderate activity intensity from androidx.health.connect.client.aggregate.AggregationResult. To check if this metric is available, use HealthConnectFeatures.getFeatureStatus with HealthConnectFeatures.FEATURE_ACTIVITY_INTENSITY as the argument.

VIGOROUS_DURATION_TOTAL

val VIGOROUS_DURATION_TOTALAggregateMetric<Duration>

Metric identifier to retrieve the total duration of vigorous activity intensity from androidx.health.connect.client.aggregate.AggregationResult. To check if this metric is available, use HealthConnectFeatures.getFeatureStatus with HealthConnectFeatures.FEATURE_ACTIVITY_INTENSITY as the argument.

Public constructors

ActivityIntensityRecord

Added in 1.2.0-alpha01
ActivityIntensityRecord(
    startTime: Instant,
    startZoneOffset: ZoneOffset?,
    endTime: Instant,
    endZoneOffset: ZoneOffset?,
    metadata: Metadata,
    activityIntensityType: Int
)

Public functions

equals

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

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

activityIntensityType

Added in 1.2.0-alpha01
val activityIntensityTypeInt

Type of activity intensity (moderate or vigorous).

endTime

Added in 1.2.0-alpha01
open val endTimeInstant

End time of the record.

endZoneOffset

Added in 1.2.0-alpha01
open val endZoneOffsetZoneOffset?

User experienced zone offset at endTime, 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.

metadata

open val metadataMetadata

Set of common metadata associated with the written record.

startTime

Added in 1.2.0-alpha01
open val startTimeInstant

Start time of the record.

startZoneOffset

Added in 1.2.0-alpha01
open val startZoneOffsetZoneOffset?

User experienced zone offset at startTime, 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.