Added in API level 34

ExerciseSessionRecord


class ExerciseSessionRecord : IntervalRecord
kotlin.Any
   ↳ android.health.connect.datatypes.Record
   ↳ android.health.connect.datatypes.IntervalRecord
   ↳ android.health.connect.datatypes.ExerciseSessionRecord

Captures exercise or a sequence of exercises. This can be a playing game like football or a sequence of fitness exercises.

Each record needs a start time, end time and session type. In addition, each record has two optional independent lists of time intervals: ExerciseSegment represents particular exercise within session, ExerciseLap represents a lap time within session.

Summary

Nested classes

Builder class for ExerciseSessionRecord

Public methods
Boolean
equals(other: Any?)

Int

Returns exerciseType of this session.

MutableList<ExerciseLap!>

Returns laps of this session.

CharSequence?

Returns notes for this activity.

ExerciseRoute?

Returns route of this session.

MutableList<ExerciseSegment!>

Returns segments of this session.

CharSequence?

Returns title of this session.

Boolean

Returns if this session has recorded route.

Int

Inherited functions
Properties
static AggregationType<Long!>

Metric identifier to retrieve total exercise session duration using aggregate APIs in .

Public methods

equals

Added in API level 34
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
object the reference object with which to compare. This value may be null.
Return
Boolean true if this object is the same as the obj

getExerciseType

Added in API level 34
fun getExerciseType(): Int

Returns exerciseType of this session.

Return
Int 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

getLaps

Added in API level 34
fun getLaps(): MutableList<ExerciseLap!>

Returns laps of this session. Returns empty list if the session doesn't have exercise laps.

Return
MutableList<ExerciseLap!> This value cannot be null.

getNotes

Added in API level 34
fun getNotes(): CharSequence?

Returns notes for this activity. Returns null if the session doesn't have notes.

getRoute

Added in API level 34
fun getRoute(): ExerciseRoute?

Returns route of this session. Returns null if the session doesn't have route.

getSegments

Added in API level 34
fun getSegments(): MutableList<ExerciseSegment!>

Returns segments of this session. Returns empty list if the session doesn't have exercise segments.

Return
MutableList<ExerciseSegment!> This value cannot be null.

getTitle

Added in API level 34
fun getTitle(): CharSequence?

Returns title of this session. Returns null if the session doesn't have title.

hasRoute

Added in API level 34
fun hasRoute(): Boolean

Returns if this session has recorded route.

Return
Boolean This value cannot be null.

hashCode

Added in API level 34
fun hashCode(): Int
Return
Int a hash code value for this object.

Properties

EXERCISE_DURATION_TOTAL

Added in API level 34
static val EXERCISE_DURATION_TOTAL: AggregationType<Long!>

Metric identifier to retrieve total exercise session duration using aggregate APIs in . Calculated in milliseconds.