Hi!
I am making a calendar widget for myself and have stumbled across a problem regarding subtypes of sport. I am planning to use the UserActivityHistoryIterator (https://developer.garmin.com/connect-iq/api-docs/Toybox/UserProfile/UserActivityHistoryIterator.html) to get information of what sports I have performed on specific dates.
As a start I have added some FIT activity files to the simulator and have tried to print the activity type to the console. Extract of my test code:
____________________________
using Toybox.UserProfile;
using Toybox.System;
var userActivityIterator = UserProfile.getUserActivityHistory();
var sample = userActivityIterator.next();
System.println(sample.type);
______________________________
I noticed that both strength training and indoor cycling printed the number "18" (SPORT_MULTISPORT https://developer.garmin.com/connect-iq/api-docs/Toybox/Activity.html). In order to seperate them I need to retrieve the subtypes instead ("20" SUB_SPORT_STRENGTH_TRAINING, and "6" SUB_SPORT_INDOOR_CYCLING).
Do anyone know how I could do this? Or do you have an example code for a similar widget/app project that I can look at?
I am new to this, so please bear with me :-)