Module: Toybox.ActivityRecording
Overview
The Activity Recording module will allow Apps to access the FIT file recording capabilities of the device.
Apps can use this module to allow the user to start and stop recordings, create laps, and save recorded data. SPORT_* and SUB_SPORT_* constants are provided as enums.
The SPORT_* defines the type of activity, but is not guaranteed to change device behavior. This may cause different algorithms to be applied to the sensor data. For example, a device that does not natively support SPORT_MULTISPORT recording will not gain SPORT_MULTISPORT transition features. However, the FIT file can be defined as SPORT_MULTISPORT and MULTI_SPORT algorithms may be applied to the sensor data.
SUB_SPORT_* allows for clarification of sport when recording.
See Also:
Classes Under Namespace
Classes: Session
Constant Summary
-
Sport1
-
Sport2
-
SubSport
-
TimerEventType
This enum may be removed after System 8.
Name | Value | Since | Description | See Also |
---|---|---|---|---|
SPORT_GENERIC | 0 | API Level 1.0.0 |
Sport used for sports not on the list |
|
SPORT_RUNNING | 1 | API Level 1.0.0 |
Sport used for running |
|
SPORT_CYCLING | 2 | API Level 1.0.0 |
Sport used for multi-sport transitions |
|
SPORT_TRANSITION | 3 | API Level 1.0.0 |
||
SPORT_FITNESS_EQUIPMENT | 4 | API Level 1.0.0 |
Sport used for ANT enabled exercise equipment |
|
SPORT_SWIMMING | 5 | API Level 1.0.0 |
Sport used for swimming |
|
SPORT_BASKETBALL | 6 | API Level 1.0.0 |
Sport used for basketball |
|
SPORT_SOCCER | 7 | API Level 1.0.0 |
Sport used for soccer |
|
SPORT_TENNIS | 8 | API Level 1.0.0 |
Sport used for Tennis |
|
SPORT_AMERICAN_FOOTBALL | 9 | API Level 1.0.0 |
Sport used for American football |
|
SPORT_TRAINING | 10 | API Level 1.0.0 |
Sport used for activities such as strength training, cardio, etc |
|
SPORT_WALKING | 11 | API Level 1.0.0 |
Sport used for walking |
|
SPORT_CROSS_COUNTRY_SKIING | 12 | API Level 1.0.0 |
Sport used for cross-country skiing |
|
SPORT_ALPINE_SKIING | 13 | API Level 1.0.0 |
Sport used for alpine skiing |
|
SPORT_SNOWBOARDING | 14 | API Level 1.0.0 |
Sport used for snowboarding |
|
SPORT_ROWING | 15 | API Level 1.0.0 |
Sport used for rowing |
|
SPORT_MOUNTAINEERING | 16 | API Level 1.0.0 |
Sport used for mountaineering |
|
SPORT_HIKING | 17 | API Level 1.0.0 |
Sport used for hiking |
|
SPORT_MULTISPORT | 18 | API Level 1.0.0 |
Sport used for multi-sport events |
|
SPORT_PADDLING | 19 | API Level 1.0.0 |
Sport used for paddling |
This enum may be removed after System 8.
Name | Value | Since | Description | See Also |
---|---|---|---|---|
SPORT_FLYING | 20 | API Level 3.0.10 |
Sport used for flying |
|
SPORT_E_BIKING | 21 | API Level 3.0.10 |
Sport used for riding an e-bike |
|
SPORT_MOTORCYCLING | 22 | API Level 3.0.10 |
Sport used for motorcycling |
|
SPORT_BOATING | 23 | API Level 3.0.10 |
Sport used for boating |
|
SPORT_DRIVING | 24 | API Level 3.0.10 |
Sport used for driving |
|
SPORT_GOLF | 25 | API Level 3.0.10 |
Sport used for golfing |
|
SPORT_HANG_GLIDING | 26 | API Level 3.0.10 |
Sport used for hang gliding |
|
SPORT_HORSEBACK_RIDING | 27 | API Level 3.0.10 |
Sport used for horseback riding |
|
SPORT_HUNTING | 28 | API Level 3.0.10 |
Sport used for hunting |
|
SPORT_FISHING | 29 | API Level 3.0.10 |
Sport used for fishing |
|
SPORT_INLINE_SKATING | 30 | API Level 3.0.10 |
Sport used for inline skating |
|
SPORT_ROCK_CLIMBING | 31 | API Level 3.0.10 |
Sport used for rock climbing |
|
SPORT_SAILING | 32 | API Level 3.0.10 |
Sport used for sailing |
|
SPORT_ICE_SKATING | 33 | API Level 3.0.10 |
Sport used for ice skating |
|
SPORT_SKY_DIVING | 34 | API Level 3.0.10 |
Sport used for sky diving |
|
SPORT_SNOWSHOEING | 35 | API Level 3.0.10 |
Sport used for showshoeing |
|
SPORT_SNOWMOBILING | 36 | API Level 3.0.10 |
Sport used for snowmobiling |
|
SPORT_STAND_UP_PADDLEBOARDING | 37 | API Level 3.0.10 |
Sport used for paddle boarding |
|
SPORT_SURFING | 38 | API Level 3.0.10 |
Sport used for surfing |
|
SPORT_WAKEBOARDING | 39 | API Level 3.0.10 |
Sport used for wakeboarding |
|
SPORT_WATER_SKIING | 40 | API Level 3.0.10 |
Sport used for water skiing |
|
SPORT_KAYAKING | 41 | API Level 3.0.10 |
Sport used for kayaking |
|
SPORT_RAFTING | 42 | API Level 3.0.10 |
Sport used for rafting |
|
SPORT_WINDSURFING | 43 | API Level 3.0.10 |
Sport used for windsurfing |
|
SPORT_KITESURFING | 44 | API Level 3.0.10 |
Sport used for kite surfing |
|
SPORT_TACTICAL | 45 | API Level 3.0.10 |
Sport used for tactical |
|
SPORT_JUMPMASTER | 46 | API Level 3.0.10 |
Sport used for jumpmaster |
|
SPORT_BOXING | 47 | API Level 3.0.10 |
Sport used for boxing |
|
SPORT_FLOOR_CLIMBING | 48 | API Level 3.0.10 |
Sport used for climbing |
|
SPORT_BASEBALL | 49 | API Level 3.0.10 |
Sport used for baseball |
|
SPORT_SOFTBALL_FAST_PITCH | 50 | API Level 3.0.10 |
Sport used for fast pitch softball |
|
SPORT_SOFTBALL_SLOW_PITCH | 51 | API Level 3.0.10 |
Sport used for slow pitch softball |
|
SPORT_SHOOTING | 56 | API Level 3.0.10 |
Sport used for shooting |
|
SPORT_AUTO_RACING | 57 | API Level 3.0.10 |
Sport used for auto racing |
This enum may be removed after System 8.
Name | Value | Since | Description | See Also |
---|---|---|---|---|
SUB_SPORT_GENERIC | 0 | API Level 1.0.0 |
Sub-sport used if no other sub-sport is applicable |
|
SUB_SPORT_TREADMILL | 1 | API Level 1.0.0 |
Sub-sport for Running and Fitness Equipment |
|
SUB_SPORT_STREET | 2 | API Level 1.0.0 |
Sub-sport for Running |
|
SUB_SPORT_TRAIL | 3 | API Level 1.0.0 |
Sub-sport for Running |
|
SUB_SPORT_TRACK | 4 | API Level 1.0.0 |
Sub-sport for Running |
|
SUB_SPORT_SPIN | 5 | API Level 1.0.0 |
Sub-sport for Cycling |
|
SUB_SPORT_INDOOR_CYCLING | 6 | API Level 1.0.0 |
Sub-sport for Cycling and Fitness Equipment |
|
SUB_SPORT_ROAD | 7 | API Level 1.0.0 |
Sub-sport for Cycling |
|
SUB_SPORT_MOUNTAIN | 8 | API Level 1.0.0 |
Sub-sport for Cycling |
|
SUB_SPORT_DOWNHILL | 9 | API Level 1.0.0 |
Sub-sport for Cycling |
|
SUB_SPORT_RECUMBENT | 10 | API Level 1.0.0 |
Sub-sport for Cycling |
|
SUB_SPORT_CYCLOCROSS | 11 | API Level 1.0.0 |
Sub-sport for Cycling |
|
SUB_SPORT_HAND_CYCLING | 12 | API Level 1.0.0 |
Sub-sport for Cycling |
|
SUB_SPORT_TRACK_CYCLING | 13 | API Level 1.0.0 |
Sub-sport for Cycling |
|
SUB_SPORT_INDOOR_ROWING | 14 | API Level 1.0.0 |
Sub-sport for Rowing and Fitness Equipment |
|
SUB_SPORT_ELLIPTICAL | 15 | API Level 1.0.0 |
Sub-sport for Fitness Equipment |
|
SUB_SPORT_STAIR_CLIMBING | 16 | API Level 1.0.0 |
Sub-sport for Fitness Equipment |
|
SUB_SPORT_LAP_SWIMMING | 17 | API Level 1.0.0 |
Sub-sport for Swimming |
|
SUB_SPORT_OPEN_WATER | 18 | API Level 1.0.0 |
Sub-sport for Swimming |
|
SUB_SPORT_FLEXIBILITY_TRAINING | 19 | API Level 1.0.0 |
Sub-sport for Training |
|
SUB_SPORT_STRENGTH_TRAINING | 20 | API Level 1.0.0 |
Sub-sport for Training |
|
SUB_SPORT_WARM_UP | 21 | API Level 1.0.0 |
Sub-sport for Activity Warm-up |
|
SUB_SPORT_MATCH | 22 | API Level 1.0.0 |
Sub-sport for Sports with Matches (e.g. Tennis) |
|
SUB_SPORT_EXERCISE | 23 | API Level 1.0.0 |
Sub-sport for Exercise |
|
SUB_SPORT_CHALLENGE | 24 | API Level 1.0.0 |
Sub-sport for a Sport Challenge |
|
SUB_SPORT_INDOOR_SKIING | 25 | API Level 1.0.0 |
Sub-sport for Fitness Equipment |
|
SUB_SPORT_CARDIO_TRAINING | 26 | API Level 1.0.0 |
Sub-sport for Training |
Name | Value | Since | Description | See Also |
---|---|---|---|---|
TIMER_EVENT_START | 0 | API Level 3.0.10 |
Timer start event |
|
TIMER_EVENT_STOP | 1 | API Level 3.0.10 |
Timer stop event |
|
TIMER_EVENT_PAUSE | 2 | API Level 3.0.10 |
Timer pause event |
|
TIMER_EVENT_RESUME | 3 | API Level 3.0.10 |
Timer resume event |
|
TIMER_EVENT_LAP | 4 | API Level 3.0.10 |
Timer lap event |
|
TIMER_EVENT_RESET | 5 | API Level 3.0.10 |
Timer reset |
|
TIMER_EVENT_WORKOUT_STEP_COMPLETE | 6 | API Level 3.0.10 |
Workout step complete |
|
TIMER_EVENT_NEXT_MULTISPORT_LEG | 7 | API Level 3.0.10 |
Multisport leg started |
Typedef Summary collapse
Instance Method Summary collapse
-
createSession(options as { :sport as ActivityRecording.Sport or Activity.Sport, :subSport as ActivityRecording.SubSport or Activity.SubSport, :name as Lang.String, :poolLength as Lang.Float, :sensorLogger as SensorLogging.SensorLogger, :autoLap as { :type as Lang.Symbol, :entry as [ Position.Location, Position.Location ], :exit as [ Position.Location, Position.Location ] } }) as ActivityRecording.Session
Create a Session object with options determined by the caller.
Instance Method Details
createSession(options as { :sport as ActivityRecording.Sport or Activity.Sport, :subSport as ActivityRecording.SubSport or Activity.SubSport, :name as Lang.String, :poolLength as Lang.Float, :sensorLogger as SensorLogging.SensorLogger, :autoLap as { :type as Lang.Symbol, :entry as [ Position.Location, Position.Location ], :exit as [ Position.Location, Position.Location ] } }) as ActivityRecording.Session
Create a Session object with options determined by the caller.
Only one Session object is allowed to exist at a time. If there
is an existing object that has not been closed using the
save() or
discard() methods, this method will
return that object instead of creating a new one. On some products
running the 1.x virtual machine, creating a Session object requires a
large memory allocation. To free this memory, the Session must first be
successfully saved or discarded, and then app references to the Session
object should be set to null
.