Class: Toybox.Activity.Info

Inherits:
Toybox.Lang.Object show all

Overview

The 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:

API Level 1.0.0

Instance Member Summary collapse

Instance Attribute Details

var altitude as Lang.Float or Null

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

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

Since:

API Level 1.0.0

Returns:

var ambientPressure as Lang.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:

API Level 2.4.0

Supported Devices:

Returns:

var averageCadence as Lang.Number or Null

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

Since:

API Level 1.0.0

Returns:

var averageDistance as Lang.Float or Null

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

Since:

API Level 1.2.2

Supported Devices:

Returns:

var averageHeartRate as Lang.Number or Null

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

Since:

API Level 1.0.0

Returns:

var averagePower as Lang.Number or Null

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

Since:

API Level 1.0.0

Supported Devices:

Returns:

var averageSpeed as Lang.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:

API Level 1.0.0

Returns:

var bearing as Lang.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:

API Level 2.1.0

Supported Devices:

Returns:

var bearingFromStart as Lang.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:

API Level 2.1.0

Supported Devices:

Returns:

var calories as Lang.Number or Null

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

Since:

API Level 1.0.0

Returns:

var currentCadence as Lang.Number or Null

The current cadence in revolutions per minute (rpm).

Since:

API Level 1.0.0

Returns:

var currentHeading as Lang.Float or Null

The true north referenced heading in radians.

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

Since:

API Level 1.0.0

Returns:

var currentHeartRate as Lang.Number or Null

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

Since:

API Level 1.0.0

Returns:

var currentLocation as Position.Location or Null

The current location.

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

Since:

API Level 1.0.0

Returns:

var currentLocationAccuracy as Position.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:

API Level 1.0.0

See Also:

Returns:

var currentOxygenSaturation as Lang.Number or Null

The current oxygen saturation in percent (%)

Since:

API Level 3.2.0

Supported Devices:

Returns:

var currentPower as Lang.Number or Null

The current power in Watts (W).

Since:

API Level 1.0.0

Supported Devices:

Returns:

var currentSpeed as Lang.Float or Null

The current speed in meters per second (mps).

Since:

API Level 1.0.0

See Also:

Returns:

var distanceToDestination as Lang.Float or Null

The distance to the destination in meters (m).

Since:

API Level 2.1.0

Supported Devices:

Returns:

var distanceToNextPoint as Lang.Float or Null

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

Since:

API Level 2.1.0

Supported Devices:

Returns:

var elapsedDistance as Lang.Float or Null

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

Since:

API Level 1.0.0

Returns:

var elapsedTime as Lang.Number or Null

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

Since:

API Level 1.0.0

Returns:

var elevationAtDestination as Lang.Number or Null

The elevation at the destination in meters (m).

Since:

API Level 2.1.0

Supported Devices:

Returns:

var elevationAtNextPoint as Lang.Float or Null

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

Since:

API Level 2.1.0

Supported Devices:

Returns:

var energyExpenditure as Lang.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:

API Level 1.2.0

See Also:

Supported Devices:

Returns:

var frontDerailleurIndex as Lang.Number or Null

The current front bicycle derailleur index.

Index values range from from 1 to the frontDerailleurMax.

Since:

API Level 2.1.0

Supported Devices:

Returns:

var frontDerailleurMax as Lang.Number or Null

The front bicycle derailleur maximum index.

Since:

API Level 2.1.0

Supported Devices:

Returns:

var frontDerailleurSize as Lang.Number or Null

The front bicycle derailleur gear size in number of teeth.

Since:

API Level 2.1.0

Supported Devices:

Returns:

var maxCadence as Lang.Number or Null

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

Since:

API Level 1.0.0

Returns:

var maxHeartRate as Lang.Number or Null

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

Since:

API Level 1.0.0

Returns:

var maxPower as Lang.Number or Null

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

Since:

API Level 1.0.0

Supported Devices:

Returns:

var maxSpeed as Lang.Float or Null

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

Since:

API Level 1.0.0

Returns:

var meanSeaLevelPressure as Lang.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:

API Level 2.4.0

Supported Devices:

Returns:

var nameOfDestination as Lang.String or Null

The name of the destination.

Since:

API Level 2.1.0

Supported Devices:

Returns:

var nameOfNextPoint as Lang.String or Null

The name of the next point.

Since:

API Level 2.1.0

Supported Devices:

Returns:

var offCourseDistance as Lang.Float or Null

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

Since:

API Level 2.1.0

Supported Devices:

Returns:

var rawAmbientPressure as Lang.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:

API Level 2.4.0

Supported Devices:

Returns:

var rearDerailleurIndex as Lang.Number or Null

The current rear bicycle derailleur index.

Index values range from from 1 to the rearDerailleurMax.

Since:

API Level 2.1.0

Supported Devices:

Returns:

var rearDerailleurMax as Lang.Number or Null

The rear bicycle derailleur maximum index.

Since:

API Level 2.1.0

Supported Devices:

Returns:

var rearDerailleurSize as Lang.Number or Null

The rear bicycle derailleur gear size in number of teeth.

Since:

API Level 2.1.0

Supported Devices:

Returns:

var startLocation as Position.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:

API Level 1.0.0

Returns:

var startTime as Time.Moment or Null

The starting time of the current activity.

Since:

API Level 1.0.0

Returns:

var swimStrokeType as Activity.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:

API Level 1.2.2

Supported Devices:

Returns:

var swimSwolf as Lang.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:

API Level 1.2.2

Supported Devices:

Returns:

var timerState as Activity.TimerState 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:

API Level 2.1.0

Returns:

var timerTime as Lang.Number or Null

The current Timer value in milliseconds (ms).

Since:

API Level 1.0.0

Returns:

var totalAscent as Lang.Number or Null

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

Since:

API Level 1.0.0

Returns:

var totalDescent as Lang.Number or Null

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

Since:

API Level 1.0.0

Returns:

var track as Lang.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:

API Level 2.1.0

Supported Devices:

Returns:

var trainingEffect as Lang.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:

API Level 1.2.0

See Also:

Supported Devices:

Returns:


Generated Sep 23, 2024, 3:32:47 PM