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 |
Public methods | |
---|---|
Boolean |
Indicates whether some other object is "equal to" this one. |
Int |
Returns exerciseType of this session. |
MutableList<ExerciseLap!> |
getLaps() Returns laps of this session. |
CharSequence? |
getNotes() Returns notes for this activity. |
String? |
Returns the ID of the |
Float |
Gets the rate of perceived exertion (RPE) for this exercise session. |
ExerciseRoute? |
getRoute() Returns route of this session. |
MutableList<ExerciseSegment!> |
Returns segments of this session. |
CharSequence? |
getTitle() Returns title of this session. |
Boolean |
Returns true if this session has an associated rate of perceived exertion. |
Boolean |
hasRoute() Returns if this session has recorded route. |
Int |
hashCode() |
Inherited functions | |
---|---|
Properties | |
---|---|
static AggregationType<Long!> |
Metric identifier to retrieve total exercise session duration using aggregate APIs in . |
Public methods
equals
fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
Parameters | |
---|---|
obj |
the reference object with which to compare. |
object |
the reference object with which to compare. This value may be null . |
o |
This value may be null . |
Return | |
---|---|
Boolean |
true if this object is the same as the obj |
getExerciseType
fun getExerciseType(): Int
Returns exerciseType of this session.
getLaps
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
fun getNotes(): CharSequence?
Returns notes for this activity. Returns null if the session doesn't have notes.
getPlannedExerciseSessionId
fun getPlannedExerciseSessionId(): String?
Returns the ID of the PlannedExerciseSessionRecord
that this session was based upon. If not set, returns null.
getRateOfPerceivedExertion
fun getRateOfPerceivedExertion(): Float
Gets the rate of perceived exertion (RPE) for this 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
Use hasRateOfPerceivedExertion
to check whether RPE exists for this session.
Return | |
---|---|
Float |
Value is between 0.0f and 10.0f inclusive |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if rate of perceived exertion is not set. |
getRoute
fun getRoute(): ExerciseRoute?
Returns route of this session. Returns null if the session doesn't have route.
getSegments
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
fun getTitle(): CharSequence?
Returns title of this session. Returns null if the session doesn't have title.
hasRateOfPerceivedExertion
fun hasRateOfPerceivedExertion(): Boolean
Returns true if this session has an associated rate of perceived exertion.
hasRoute
fun hasRoute(): Boolean
Returns if this session has recorded route.
Return | |
---|---|
Boolean |
This value cannot be null . |
Properties
EXERCISE_DURATION_TOTAL
static val EXERCISE_DURATION_TOTAL: AggregationType<Long!>
Metric identifier to retrieve total exercise session duration using aggregate APIs in . Calculated in milliseconds.