ExerciseSessionRecord.Builder


public static final class ExerciseSessionRecord.Builder
extends Object

java.lang.Object
   ↳ android.health.connect.datatypes.ExerciseSessionRecord.Builder


Builder class for ExerciseSessionRecord

Summary

Public constructors

Builder(Metadata metadata, Instant startTime, Instant endTime, int exerciseType)

Public methods

ExerciseSessionRecord build()

Returns ExerciseSessionRecord

ExerciseSessionRecord.Builder clearEndZoneOffset()

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

ExerciseSessionRecord.Builder clearRateOfPerceivedExertion()

Clears the rate of perceived exertion for this exercise session.

ExerciseSessionRecord.Builder clearStartZoneOffset()

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

ExerciseSessionRecord.Builder setEndZoneOffset(ZoneOffset endZoneOffset)

Sets the zone offset of the user when the session ended

ExerciseSessionRecord.Builder setLaps(List<ExerciseLap> laps)

Sets segments for this session.

ExerciseSessionRecord.Builder setNotes(CharSequence notes)

Sets notes for this activity

ExerciseSessionRecord.Builder setPlannedExerciseSessionId(String id)

Sets the PlannedExerciseSessionRecord that this session was based upon.

ExerciseSessionRecord.Builder setRateOfPerceivedExertion(float rateOfPerceivedExertion)

Sets rate of perceived exertion (RPE) used during the exercise session.

ExerciseSessionRecord.Builder setRoute(ExerciseRoute route)

Sets route for this activity

ExerciseSessionRecord.Builder setSegments(List<ExerciseSegment> segments)

Sets segments for this session.

ExerciseSessionRecord.Builder setStartZoneOffset(ZoneOffset startZoneOffset)

Sets the zone offset of the user when the session started

ExerciseSessionRecord.Builder setTitle(CharSequence title)

Sets a title of this activity

Inherited methods

Public constructors

Builder

Added in API level 34
public Builder (Metadata metadata, 
                Instant startTime, 
                Instant endTime, 
                int exerciseType)

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 ExerciseSessionType.EXERCISE_SESSION_TYPE_UNKNOWN, ExerciseSessionType.EXERCISE_SESSION_TYPE_BADMINTON, ExerciseSessionType.EXERCISE_SESSION_TYPE_BASEBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_BASKETBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_BIKING, ExerciseSessionType.EXERCISE_SESSION_TYPE_BIKING_STATIONARY, ExerciseSessionType.EXERCISE_SESSION_TYPE_BOOT_CAMP, ExerciseSessionType.EXERCISE_SESSION_TYPE_BOXING, ExerciseSessionType.EXERCISE_SESSION_TYPE_CALISTHENICS, ExerciseSessionType.EXERCISE_SESSION_TYPE_CRICKET, ExerciseSessionType.EXERCISE_SESSION_TYPE_DANCING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ELLIPTICAL, ExerciseSessionType.EXERCISE_SESSION_TYPE_EXERCISE_CLASS, ExerciseSessionType.EXERCISE_SESSION_TYPE_FENCING, ExerciseSessionType.EXERCISE_SESSION_TYPE_FOOTBALL_AMERICAN, ExerciseSessionType.EXERCISE_SESSION_TYPE_FOOTBALL_AUSTRALIAN, ExerciseSessionType.EXERCISE_SESSION_TYPE_FRISBEE_DISC, ExerciseSessionType.EXERCISE_SESSION_TYPE_GOLF, ExerciseSessionType.EXERCISE_SESSION_TYPE_GUIDED_BREATHING, ExerciseSessionType.EXERCISE_SESSION_TYPE_GYMNASTICS, ExerciseSessionType.EXERCISE_SESSION_TYPE_HANDBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING, ExerciseSessionType.EXERCISE_SESSION_TYPE_HIKING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ICE_HOCKEY, ExerciseSessionType.EXERCISE_SESSION_TYPE_ICE_SKATING, ExerciseSessionType.EXERCISE_SESSION_TYPE_MARTIAL_ARTS, ExerciseSessionType.EXERCISE_SESSION_TYPE_PADDLING, ExerciseSessionType.EXERCISE_SESSION_TYPE_PARAGLIDING, ExerciseSessionType.EXERCISE_SESSION_TYPE_PILATES, ExerciseSessionType.EXERCISE_SESSION_TYPE_RACQUETBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROCK_CLIMBING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROLLER_HOCKEY, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROWING, ExerciseSessionType.EXERCISE_SESSION_TYPE_ROWING_MACHINE, ExerciseSessionType.EXERCISE_SESSION_TYPE_RUGBY, ExerciseSessionType.EXERCISE_SESSION_TYPE_RUNNING, ExerciseSessionType.EXERCISE_SESSION_TYPE_RUNNING_TREADMILL, ExerciseSessionType.EXERCISE_SESSION_TYPE_SAILING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SCUBA_DIVING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SKATING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SKIING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SNOWBOARDING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SNOWSHOEING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SOCCER, ExerciseSessionType.EXERCISE_SESSION_TYPE_SOFTBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_SQUASH, ExerciseSessionType.EXERCISE_SESSION_TYPE_STAIR_CLIMBING, ExerciseSessionType.EXERCISE_SESSION_TYPE_STAIR_CLIMBING_MACHINE, ExerciseSessionType.EXERCISE_SESSION_TYPE_STRENGTH_TRAINING, ExerciseSessionType.EXERCISE_SESSION_TYPE_STRETCHING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SURFING, ExerciseSessionType.EXERCISE_SESSION_TYPE_SWIMMING_OPEN_WATER, ExerciseSessionType.EXERCISE_SESSION_TYPE_SWIMMING_POOL, ExerciseSessionType.EXERCISE_SESSION_TYPE_TABLE_TENNIS, ExerciseSessionType.EXERCISE_SESSION_TYPE_TENNIS, ExerciseSessionType.EXERCISE_SESSION_TYPE_VOLLEYBALL, ExerciseSessionType.EXERCISE_SESSION_TYPE_WALKING, ExerciseSessionType.EXERCISE_SESSION_TYPE_WATER_POLO, ExerciseSessionType.EXERCISE_SESSION_TYPE_WEIGHTLIFTING, ExerciseSessionType.EXERCISE_SESSION_TYPE_WHEELCHAIR, ExerciseSessionType.EXERCISE_SESSION_TYPE_OTHER_WORKOUT, or ExerciseSessionType.EXERCISE_SESSION_TYPE_YOGA

Public methods

build

Added in API level 34
public ExerciseSessionRecord build ()

Returns ExerciseSessionRecord

Returns
ExerciseSessionRecord This value cannot be null.

clearEndZoneOffset

Added in API level 34
public ExerciseSessionRecord.Builder clearEndZoneOffset ()

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

Returns
ExerciseSessionRecord.Builder This value cannot be null.

clearRateOfPerceivedExertion

Added in version 36.1
public ExerciseSessionRecord.Builder clearRateOfPerceivedExertion ()

Clears the rate of perceived exertion for this exercise session.

Returns builder instance without rate of perceived exertion.

Returns
ExerciseSessionRecord.Builder This value cannot be null.

clearStartZoneOffset

Added in API level 34
public ExerciseSessionRecord.Builder clearStartZoneOffset ()

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

Returns
ExerciseSessionRecord.Builder This value cannot be null.

setEndZoneOffset

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

Sets the zone offset of the user when the session ended

Parameters
endZoneOffset ZoneOffset: This value cannot be null.

Returns
ExerciseSessionRecord.Builder This value cannot be null.

setLaps

Added in API level 34
public ExerciseSessionRecord.Builder setLaps (List<ExerciseLap> laps)

Sets segments for this session.

Parameters
laps List: list of ExerciseLap of this session This value cannot be null.

Returns
ExerciseSessionRecord.Builder This value cannot be null.

setNotes

Added in API level 34
public ExerciseSessionRecord.Builder setNotes (CharSequence notes)

Sets notes for this activity

Parameters
notes CharSequence: Notes for this activity This value may be null.

Returns
ExerciseSessionRecord.Builder This value cannot be null.

setPlannedExerciseSessionId

Added in API level 35
Also in U Extensions 13
public ExerciseSessionRecord.Builder setPlannedExerciseSessionId (String id)

Sets the PlannedExerciseSessionRecord that this session was based upon.

Parameters
id String: This value may be null.

Returns
ExerciseSessionRecord.Builder This value cannot be null.

setRateOfPerceivedExertion

Added in version 36.1
public ExerciseSessionRecord.Builder setRateOfPerceivedExertion (float rateOfPerceivedExertion)

Sets rate of perceived exertion (RPE) used during the exercise session.

Values correspond to the Borg CR10 RPE scale and must be in the range 0 to 10 inclusive. 0: No exertion (at rest) 1: Very light 2-3: Light 4-5: Moderate 6-7: Hard 8-9: Very hard 10: Maximum effort

Returns builder instance with rate of perceived exertion set.

Parameters
rateOfPerceivedExertion float: Value is between 0.0f and 10.0f inclusive

Returns
ExerciseSessionRecord.Builder This value cannot be null.

setRoute

Added in API level 34
public ExerciseSessionRecord.Builder setRoute (ExerciseRoute route)

Sets route for this activity

Parameters
route ExerciseRoute: ExerciseRoute for this activity This value may be null.

Returns
ExerciseSessionRecord.Builder This value cannot be null.

setSegments

Added in API level 34
public ExerciseSessionRecord.Builder setSegments (List<ExerciseSegment> segments)

Sets segments for this session.

Parameters
segments List: list of ExerciseSegment of this session This value cannot be null.

Returns
ExerciseSessionRecord.Builder This value cannot be null.

setStartZoneOffset

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

Sets the zone offset of the user when the session started

Parameters
startZoneOffset ZoneOffset: This value cannot be null.

Returns
ExerciseSessionRecord.Builder This value cannot be null.

setTitle

Added in API level 34
public ExerciseSessionRecord.Builder setTitle (CharSequence title)

Sets a title of this activity

Parameters
title CharSequence: Title of this activity This value may be null.

Returns
ExerciseSessionRecord.Builder This value cannot be null.