# PlannedExerciseSessionRecord

Artifact: [androidx.health.connect:connect-client](https://developer.android.com/jetpack/androidx/releases/health-connect) [View Source](https://cs.android.com/search?q=file:androidx/health/connect/client/records/PlannedExerciseSessionRecord.kt+class:androidx.health.connect.client.records.PlannedExerciseSessionRecord) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

*** ** * ** ***


```
class PlannedExerciseSessionRecord : Record
```

<br />

*** ** * ** ***

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 `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#FEATURE_PLANNED_EXERCISE()`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#PlannedExerciseSessionRecord(androidx.health.connect.client.records.metadata.Metadata,java.time.LocalDate,java.time.Duration,kotlin.collections.List,kotlin.Int,kotlin.String,kotlin.String)( metadata: https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata, startDate: https://developer.android.com/reference/java/time/LocalDate.html, duration: https://developer.android.com/reference/java/time/Duration.html, blocks: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseBlock>, exerciseType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, notes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? )` Constructor that accepts a local date plus a duration. |
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#PlannedExerciseSessionRecord(java.time.Instant,java.time.ZoneOffset,java.time.Instant,java.time.ZoneOffset,androidx.health.connect.client.records.metadata.Metadata,kotlin.collections.List,kotlin.Int,kotlin.String,kotlin.String)( startTime: https://developer.android.com/reference/java/time/Instant.html, startZoneOffset: https://developer.android.com/reference/java/time/ZoneOffset.html?, endTime: https://developer.android.com/reference/java/time/Instant.html, endZoneOffset: https://developer.android.com/reference/java/time/ZoneOffset.html?, metadata: https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata, blocks: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseBlock>, exerciseType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, notes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? )` Constructor that accepts a physical time and zone offset. |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseBlock>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#blocks()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#completedExerciseSessionId()` The exercise session that completed this planned session. |
| `open https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#endTime()` End time of the record. |
| `open https://developer.android.com/reference/java/time/ZoneOffset.html?` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#endZoneOffset()` User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/IntervalRecord#endTime()`, or null if unknown. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#exerciseType()` Type of exercise (e.g. walking, swimming). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#hasExplicitTime()` |
| `open https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#metadata()` Set of common metadata associated with the written record. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#notes()` Additional notes for the session. |
| `open https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#startTime()` Start time of the record. |
| `open https://developer.android.com/reference/java/time/ZoneOffset.html?` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#startZoneOffset()` User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/IntervalRecord#startTime()`, or null if unknown. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#title()` Title of the session. |

## Public constructors

### PlannedExerciseSessionRecord

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

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

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 `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#(androidx.health.connect.client.records.metadata.Metadata,java.time.LocalDate,java.time.Duration,kotlin.collections.List,kotlin.Int,kotlin.String,kotlin.String)`. The end time will be generated by adding `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseSessionRecord#(androidx.health.connect.client.records.metadata.Metadata,java.time.LocalDate,java.time.Duration,kotlin.collections.List,kotlin.Int,kotlin.String,kotlin.String)` to the start time.

| Parameters |
|---|---|
| `metadata: https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata` | Metadata for this session. |
| `startDate: https://developer.android.com/reference/java/time/LocalDate.html` | The date on which the session should occur. |
| `duration: https://developer.android.com/reference/java/time/Duration.html` | The expected or estimated duration of the session. |
| `blocks: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseBlock>` | The `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseBlock`s that contain details of this session. |
| `exerciseType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The exercise type of this session. |
| `title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? = null` | The title of this session. |
| `notes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? = null` | Notes for this session. |

### PlannedExerciseSessionRecord

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

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

Constructor that accepts a physical time and zone offset.

| Parameters |
|---|---|
| `startTime: https://developer.android.com/reference/java/time/Instant.html` | The time at which the session should start. |
| `startZoneOffset: https://developer.android.com/reference/java/time/ZoneOffset.html?` | The zone offset at the start of this session. If null is provided, this will default to the current system timezone. |
| `endTime: https://developer.android.com/reference/java/time/Instant.html` | The time at which the session should end. |
| `endZoneOffset: https://developer.android.com/reference/java/time/ZoneOffset.html?` | The zone offset at the end of this session. If null is provided, this will default to the current system timezone. |
| `metadata: https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata` | Metadata for this session. |
| `blocks: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseBlock>` | The `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PlannedExerciseBlock`s that contain details of this session. |
| `exerciseType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The exercise type of this session. |
| `title: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? = null` | The title of this session. |
| `notes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? = null` | Notes 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](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
val blocks: List<PlannedExerciseBlock>
```

### completedExerciseSessionId

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
val completedExerciseSessionId: String?
```

The exercise session that completed this planned session.

### endTime

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
open val endTime: Instant
```

End time of the record.

### endZoneOffset

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
open val endZoneOffset: ZoneOffset?
```

User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/IntervalRecord#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](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
val exerciseType: Int
```

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

Value is one of the following:

- `2`
- `4`
- `5`
- `8`
- `9`
- `10`
- `11`
- `13`
- `14`
- `16`
- `25`
- `26`
- `27`
- `28`
- `29`
- `31`
- `32`
- `33`
- `34`
- `35`
- `36`
- `37`
- `38`
- `39`
- `44`
- `46`
- `47`
- `48`
- `50`
- `51`
- `52`
- `53`
- `54`
- `55`
- `56`
- `57`
- `58`
- `59`
- `60`
- `61`
- `62`
- `63`
- `64`
- `65`
- `66`
- `68`
- `69`
- `70`
- `71`
- `72`
- `73`
- `74`
- `75`
- `76`
- `78`
- `79`
- `80`
- `81`
- `82`
- `0`
- `83`

<br />

### hasExplicitTime

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
val hasExplicitTime: Boolean
```

### metadata

```
open val metadata: Metadata
```

Set of common metadata associated with the written record.

### notes

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
val notes: String?
```

Additional notes for the session. Optional field.

### startTime

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
open val startTime: Instant
```

Start time of the record.

### startZoneOffset

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
open val startZoneOffset: ZoneOffset?
```

User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/IntervalRecord#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](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

```
val title: String?
```

Title of the session. Optional field.