Added in API level 34

Builder

class Builder
kotlin.Any
   ↳ android.health.connect.datatypes.ExerciseSessionRecord.Builder

Builder class for ExerciseSessionRecord

Summary

Public constructors
Builder(metadata: Metadata, startTime: Instant, endTime: Instant, exerciseType: Int)

Public methods
ExerciseSessionRecord

Returns ExerciseSessionRecord

ExerciseSessionRecord.Builder

Sets the start zone offset of this record to system default.

ExerciseSessionRecord.Builder

Sets the start zone offset of this record to system default.

ExerciseSessionRecord.Builder
setEndZoneOffset(endZoneOffset: ZoneOffset)

Sets the zone offset of the user when the session ended

ExerciseSessionRecord.Builder

Sets segments for this session.

ExerciseSessionRecord.Builder

Sets notes for this activity

ExerciseSessionRecord.Builder

Sets route for this activity

ExerciseSessionRecord.Builder

Sets segments for this session.

ExerciseSessionRecord.Builder
setStartZoneOffset(startZoneOffset: ZoneOffset)

Sets the zone offset of the user when the session started

ExerciseSessionRecord.Builder

Sets a title of this activity

Public constructors

Builder

Added in API level 34
Builder(
    metadata: Metadata,
    startTime: Instant,
    endTime: Instant,
    exerciseType: Int)
Parameters
metadata Metadata: Metadata to be associated with the record. See Metadata. This value cannot be null.
startTime Instant: Start time of this activity This value cannot be null.
endTime Instant: End time of this activity This value cannot be null.
exerciseType Int: Type of exercise (e.g. walking, swimming). Required field. Allowed values: ExerciseSessionType Value is android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_UNKNOWN, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BADMINTON, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BASEBALL, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BASKETBALL, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BIKING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BIKING_STATIONARY, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BOOT_CAMP, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BOXING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_CALISTHENICS, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_CRICKET, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_DANCING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ELLIPTICAL, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_EXERCISE_CLASS, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_FENCING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_FOOTBALL_AMERICAN, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_FOOTBALL_AUSTRALIAN, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_FRISBEE_DISC, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_GOLF, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_GUIDED_BREATHING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_GYMNASTICS, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_HANDBALL, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_HIKING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ICE_HOCKEY, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ICE_SKATING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_MARTIAL_ARTS, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_PADDLING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_PARAGLIDING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_PILATES, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_RACQUETBALL, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ROCK_CLIMBING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ROLLER_HOCKEY, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ROWING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ROWING_MACHINE, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_RUGBY, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_RUNNING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_RUNNING_TREADMILL, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SAILING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SCUBA_DIVING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SKATING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SKIING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SNOWBOARDING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SNOWSHOEING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SOCCER, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SOFTBALL, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SQUASH, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_STAIR_CLIMBING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_STAIR_CLIMBING_MACHINE, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_STRENGTH_TRAINING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_STRETCHING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SURFING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SWIMMING_OPEN_WATER, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SWIMMING_POOL, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_TABLE_TENNIS, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_TENNIS, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_VOLLEYBALL, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_WALKING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_WATER_POLO, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_WEIGHTLIFTING, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_WHEELCHAIR, android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_OTHER_WORKOUT, or android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_YOGA

Public methods

build

Added in API level 34
fun build(): ExerciseSessionRecord

Returns ExerciseSessionRecord

Return
ExerciseSessionRecord This value cannot be null.

clearEndZoneOffset

Added in API level 34
fun clearEndZoneOffset(): ExerciseSessionRecord.Builder

Sets the start zone offset of this record to system default.

Return
ExerciseSessionRecord.Builder This value cannot be null.

clearStartZoneOffset

Added in API level 34
fun clearStartZoneOffset(): ExerciseSessionRecord.Builder

Sets the start zone offset of this record to system default.

Return
ExerciseSessionRecord.Builder This value cannot be null.

setEndZoneOffset

Added in API level 34
fun setEndZoneOffset(endZoneOffset: ZoneOffset): ExerciseSessionRecord.Builder

Sets the zone offset of the user when the session ended

Parameters
endZoneOffset ZoneOffset: This value cannot be null.
Return
ExerciseSessionRecord.Builder This value cannot be null.

setLaps

Added in API level 34
fun setLaps(laps: MutableList<ExerciseLap!>): ExerciseSessionRecord.Builder

Sets segments for this session.

Parameters
laps MutableList<ExerciseLap!>: list of ExerciseLap of this session This value cannot be null.
Return
ExerciseSessionRecord.Builder This value cannot be null.

setNotes

Added in API level 34
fun setNotes(notes: CharSequence?): ExerciseSessionRecord.Builder

Sets notes for this activity

Parameters
notes CharSequence?: Notes for this activity This value may be null.
Return
ExerciseSessionRecord.Builder This value cannot be null.

setRoute

Added in API level 34
fun setRoute(route: ExerciseRoute?): ExerciseSessionRecord.Builder

Sets route for this activity

Parameters
route ExerciseRoute?: ExerciseRoute for this activity This value may be null.
Return
ExerciseSessionRecord.Builder This value cannot be null.

setSegments

Added in API level 34
fun setSegments(segments: MutableList<ExerciseSegment!>): ExerciseSessionRecord.Builder

Sets segments for this session.

Parameters
segments MutableList<ExerciseSegment!>: list of ExerciseSegment of this session This value cannot be null.
Return
ExerciseSessionRecord.Builder This value cannot be null.

setStartZoneOffset

Added in API level 34
fun setStartZoneOffset(startZoneOffset: ZoneOffset): ExerciseSessionRecord.Builder

Sets the zone offset of the user when the session started

Parameters
startZoneOffset ZoneOffset: This value cannot be null.
Return
ExerciseSessionRecord.Builder This value cannot be null.

setTitle

Added in API level 34
fun setTitle(title: CharSequence?): ExerciseSessionRecord.Builder

Sets a title of this activity

Parameters
title CharSequence?: Title of this activity This value may be null.
Return
ExerciseSessionRecord.Builder This value cannot be null.