Class: Toybox.Activity.Info

Inherits:
Toybox.Lang.Object show all

Overview

The Activity.Info class contains information about the current activity.

This information can be retrieved with the getActivityInfo() method. Fields in this class may return null so should be checked for null values prior to use.

Since:

1.0.0

Instance Member Summary collapse

Instance Attribute Details

var altitude as Float or Null

The altitude above mean sea level in meters (m).

Elevation is derived from the most accurate source: Barometer or GPS

Since:

1.0.0

Returns:

var ambientPressure as Float or Null

The ambient pressure in Pascals (Pa).

This returns ambient (local) barometric pressure as measured by the pressure sensor. The data is smoothed by a two-stage filter to reduce noise and instantaneous variation.

Since:

2.4.0

Supported Devices:

Returns:

var averageCadence as Number or Null

The average cadence during the current activity in revolutions per minute (rpm).

Since:

1.0.0

Returns:

var averageDistance as Float or Null

The average swim stroke distance from the previous interval in meters (m).

Since:

1.2.2

Supported Devices:

Returns:

var averageHeartRate as Number or Null

The average heart rate during the current activity in beats per minute (bpm).

Since:

1.0.0

Returns:

var averagePower as Number or Null

The average power during the current activity in Watts (W).

Since:

1.0.0

Supported Devices:

Returns:

var averageSpeed as Float or Null

The average speed during the current activity in meters per second (mps).

The average is computed as the elapsed 3-D accumulated distance divided by the elapsed time.

Since:

1.0.0

Returns:

var bearing as Float or Null

The current bearing in radians.

Bearing is the direction from your current location or position to the destination of navigation, dependent on your current location.

Since:

2.1.0

Supported Devices:

Returns:

var bearingFromStart as Float or Null

The bearing from the starting location to the destination in radians.

Bearing from start is the direction of desired track from the start of navigation to the destination in radians. This is only dependent on your location when a course is set, and it is not dependent on where you may have moved to during an activity

Since:

2.1.0

Supported Devices:

Returns:

var calories as Number or Null

The calories burned throughout the current activity in kilocalories (kcal).

Since:

1.0.0

Returns:

var currentCadence as Number or Null

The current cadence in revolutions per minute (rpm).

Since:

1.0.0

Returns:

var currentHeading as Float or Null

The true north referenced heading in radians.

This provides compass orientation if it is supported by the device.

Since:

1.0.0

Returns:

var currentHeartRate as Number or Null

The current heart rate in beats per minute (bpm).

Since:

1.0.0

Returns:

var currentLocation as Location or Null

The current location.

This member will always provide a null value unless the Positioning Permission is enabled.

Since:

1.0.0

Returns:

var currentLocationAccuracy as Quality or Null

The current GPS accuracy.

GPS accuracy values range from 0-4. A value of 0 indicates an accuracy value is not available, while a value of 4 indicates a good GPS fix.

Since:

1.0.0

Returns:

  • Number

    A Position.QUALITY_* value

var currentOxygenSaturation as Number or Null

The current oxygen saturation in percent (%)

Since:

3.2.0

Supported Devices:

Returns:

var currentPower as Number or Null

The current power in Watts (W).

Since:

1.0.0

Supported Devices:

Returns:

var currentSpeed as Float or Null

The current speed in meters per second (mps).

Since:

1.0.0

Returns:

var distanceToDestination as Float or Null

The distance to the destination in meters (m).

Since:

2.1.0

Supported Devices:

Returns:

var distanceToNextPoint as Float or Null

The distance to the next point in meters (m).

Since:

2.1.0

Supported Devices:

Returns:

var elapsedDistance as Float or Null

The elapsed distance of the current activity in meters (m).

Since:

1.0.0

Returns:

var elapsedTime as Number or Null

Elapsed time of the current activity in milliseconds (ms).

Since:

1.0.0

Returns:

var elevationAtDestination as Number or Null

The elevation at the destination in meters (m).

Since:

2.1.0

Supported Devices:

Returns:

var elevationAtNextPoint as Float or Null

The elevation at the next point in meters (m).

Since:

2.1.0

Supported Devices:

Returns:

var energyExpenditure as Float or Null

The current energy expenditure in kilocalories per minute (kcals/min).

Energy expenditure is a metric developed by FirstBeat that provides an estimation of the calorie burn rate calculated from heart rate data.

Since:

1.2.0

Supported Devices:

Returns:

var frontDerailleurIndex as Number or Null

The current front bicycle derailleur index.

Index values range from from 1 to the frontDerailleurMax.

Since:

2.1.0

Supported Devices:

Returns:

var frontDerailleurMax as Number or Null

The front bicycle derailleur maximum index.

Since:

2.1.0

Supported Devices:

Returns:

var frontDerailleurSize as Number or Null

The front bicycle derailleur gear size in number of teeth.

Since:

2.1.0

Supported Devices:

Returns:

var maxCadence as Number or Null

The maximum cadence recorded during the current activity in revolutions per minute (rpm).

Since:

1.0.0

Returns:

var maxHeartRate as Number or Null

The maximum heart rate recorded during the current activity in beats per minute (bpm).

Since:

1.0.0

Returns:

var maxPower as Number or Null

The maximum power recorded during the current activity in Watts (W).

Since:

1.0.0

Supported Devices:

Returns:

var maxSpeed as Float or Null

The maximum speed recorded during the current activity in meters per second (mps).

Since:

1.0.0

Returns:

var meanSeaLevelPressure as Float or Null

The mean sea level barometric pressure in Pascals (Pa).

This returns barometric pressure calibrated to sea level. Since pressure varies dues to several factors, a GPS-based altitude must first be obtained, then the ambient (local) pressure is measured by the pressure sensor before conversion to a calibrated barometric pressure value.

Since:

2.4.0

Supported Devices:

Returns:

var nameOfDestination as String or Null

The name of the destination.

Since:

2.1.0

Supported Devices:

Returns:

var nameOfNextPoint as String or Null

The name of the next point.

Since:

2.1.0

Supported Devices:

Returns:

var offCourseDistance as Float or Null

The distance to the nearest point on the current course in meters (m).

Since:

2.1.0

Supported Devices:

Returns:

var rawAmbientPressure as Float or Null

The raw ambient pressure in Pascals (Pa).

This returns ambient (local) barometric pressure as measured by the internal pressure sensor. The data is the temperature compensated information read directly from the internal sensor.

Since:

2.4.0

Supported Devices:

Returns:

var rearDerailleurIndex as Number or Null

The current front bicycle derailleur index.

Index values range from from 1 to the rearDerailleurMax.

Since:

2.1.0

Supported Devices:

Returns:

var rearDerailleurMax as Number or Null

The rear bicycle derailleur maximum index.

Since:

2.1.0

Supported Devices:

Returns:

var rearDerailleurSize as Number or Null

The rear bicycle derailleur gear size in number of teeth.

Since:

2.1.0

Supported Devices:

Returns:

var startLocation as Location or Null

The starting location of the current activity.

This member will always provide a null value unless the Positioning Permission is enabled.

Since:

1.0.0

Returns:

var startTime as Moment or Null

The starting time of the current activity.

Since:

1.0.0

Returns:

var swimStrokeType as SwimStrokeType or Null

The swim stroke type from the previous length.

Swim stroke type values range from 0-6. Each Number value represents a different swim stroke type (e.g. freestyle, backstroke, etc.).

Since:

1.2.2

Supported Devices:

Returns:

  • Number

    An Activity.SWIM_STROKE_* value

var swimSwolf as Number or Null

The SWOLF score from the previous length.

SWOLF is an abbreviation for Swim-Golf, a measure of swimming efficiency. The score is obtained by adding the strokes per length to the total time of the length. For example, if it takes ten strokes and thirty seconds to swim a pool length, the SWOLF score is 40. Just like golf, a lower SWOLF score is better.

Since:

1.2.2

Supported Devices:

Returns:

var timerState as Number or Null

The recording timer state.

The timer state ranges from 0-3. A value of 0 indicates that the timer is off and there is no active recording, while a value of 3 indicates timer is on and there is an active recording.

Since:

2.1.0

Returns:

  • Number

    An Activity.TIMER_STATE_* value

var timerTime as Number or Null

The current Timer value in milliseconds (ms).

Since:

1.0.0

Returns:

var totalAscent as Number or Null

The total ascent during the current activity in meters (m).

Since:

1.0.0

Returns:

var totalDescent as Number or Null

The total descent during the current activity in meters (m).

Since:

1.0.0

Returns:

var track as Float or Null

The current track in radians.

Track is the direction of travel in radians based on GPS movement. If supported by the device, this provides compass orientation when stopped.

Since:

2.1.0

Supported Devices:

Returns:

var trainingEffect as Float or Null

The Training Effect score of the current activity.

Training Effect is a score developed by FirstBeat, which indicates an activity's level of effect on aerobic fitness. Scores range from 1.0 (easy) to 5.0 (overreaching).

Since:

1.2.0

Supported Devices:

Returns:


Generated Mar 10, 2021 4:39:31 PM