PlannedExerciseSessionRecord


class PlannedExerciseSessionRecord : Record


Captures a planned exercise session, also commonly referred to as a training plan.

Each record contains a start time, end time, an exercise type and a list of [PlannedExerciseBlock] which describe the details of the planned session. The start and end times may be in the future.

Requires androidx.health.connect.client.HealthConnectFeatures.FEATURE_PLANNED_EXERCISE.

Summary

Public constructors

PlannedExerciseSessionRecord(
    startDate: LocalDate,
    duration: Duration,
    blocks: List<PlannedExerciseBlock>,
    exerciseType: Int,
    title: String?,
    notes: String?,
    metadata: Metadata
)

Constructor that accepts a local date plus a duration.

PlannedExerciseSessionRecord(
    startTime: Instant,
    startZoneOffset: ZoneOffset?,
    endTime: Instant,
    endZoneOffset: ZoneOffset?,
    blocks: List<PlannedExerciseBlock>,
    exerciseType: Int,
    title: String?,
    notes: String?,
    metadata: Metadata
)

Constructor that accepts a physical time and zone offset.

Public functions

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

Public properties

List<PlannedExerciseBlock>
String?

The exercise session that completed this planned session.

open Instant

End time of the record.

open ZoneOffset?

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

Int

Type of exercise (e.g. walking, swimming).

Boolean
open Metadata

Set of common metadata associated with the written record.

String?

Additional notes for the session.

open Instant

Start time of the record.

open ZoneOffset?

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

String?

Title of the session.

Public constructors

PlannedExerciseSessionRecord

Added in 1.1.0-alpha10
PlannedExerciseSessionRecord(
    startDate: LocalDate,
    duration: Duration,
    blocks: List<PlannedExerciseBlock>,
    exerciseType: Int,
    title: String? = null,
    notes: String? = null,
    metadata: Metadata = Metadata.EMPTY
)

Constructor that accepts a local date plus a duration. The start time will be implicitly generated from a local time at noon in the system default timezone on the day specified by startDate. The end time will be generated by adding duration to the start time.

Parameters
startDate: LocalDate

The date on which the session should occur.

duration: Duration

The expected or estimated duration of the session.

blocks: List<PlannedExerciseBlock>

The PlannedExerciseBlocks that contain details of this session.

exerciseType: Int

The exercise type of this session.

title: String? = null

The title of this session.

notes: String? = null

Notes for this session.

metadata: Metadata = Metadata.EMPTY

Metadata for this session.

PlannedExerciseSessionRecord

Added in 1.1.0-alpha10
PlannedExerciseSessionRecord(
    startTime: Instant,
    startZoneOffset: ZoneOffset?,
    endTime: Instant,
    endZoneOffset: ZoneOffset?,
    blocks: List<PlannedExerciseBlock>,
    exerciseType: Int,
    title: String? = null,
    notes: String? = null,
    metadata: Metadata = Metadata.EMPTY
)

Constructor that accepts a physical time and zone offset.

Parameters
startTime: Instant

The time at which the session should start.

startZoneOffset: ZoneOffset?

The zone offset at the start of this session. If null is provided, this will default to the current system timezone.

endTime: Instant

The time at which the session should end.

endZoneOffset: ZoneOffset?

The zone offset at the end of this session. If null is provided, this will default to the current system timezone.

blocks: List<PlannedExerciseBlock>

The PlannedExerciseBlocks that contain details of this session.

exerciseType: Int

The exercise type of this session.

title: String? = null

The title of this session.

notes: String? = null

Notes for this session.

metadata: Metadata = Metadata.EMPTY

Metadata for this session.

Public functions

equals

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

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

blocks

Added in 1.1.0-alpha10
val blocksList<PlannedExerciseBlock>

completedExerciseSessionId

Added in 1.1.0-alpha10
val completedExerciseSessionIdString?

The exercise session that completed this planned session.

endTime

Added in 1.1.0-alpha10
open val endTimeInstant

End time of the record.

endZoneOffset

Added in 1.1.0-alpha10
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.

exerciseType

Added in 1.1.0-alpha10
val exerciseTypeInt

Type of exercise (e.g. walking, swimming). Required field.

hasExplicitTime

Added in 1.1.0-alpha10
val hasExplicitTimeBoolean

metadata

Added in 1.1.0-alpha10
open val metadataMetadata

Set of common metadata associated with the written record.

notes

Added in 1.1.0-alpha10
val notesString?

Additional notes for the session. Optional field.

startTime

Added in 1.1.0-alpha10
open val startTimeInstant

Start time of the record.

startZoneOffset

Added in 1.1.0-alpha10
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.

title

Added in 1.1.0-alpha10
val titleString?

Title of the session. Optional field.