Recorded activities are shown as Tennis I've been using _TENNIS and my app users are confused.
Recorded activities are shown as Tennis I've been using _TENNIS and my app users are confused.
my app users are confused
... and if you need the ID value for a Connect IQ app you wrote, then it is sub_sport 84 (Activity.SUB_SPORT_84). Check out the CIQ SDK
Depending on the specific watch it may be available on the watch itself, It may not be in the default list of activities, but can be added using the "+" sign at the end, under racket sports, or just on the list. I suspect it's only on newer watches..
This has come up before and it's not well documented, but when possible, I think Garmin wants you to use the new Activity.Sport/SPORT_* and Activity.SubSport/SUB_SPORT_* enums (available on 3.2.0+ devices.)
[https://developer.garmin.com/connect-iq/api-docs/Toybox/Activity.html#Sport-module]
The ActivityRecording Sport1/Sport2/SPORT_* and SubSport/SUB_SPORT_* enums are deprecated.
[https://developer.garmin.com/connect-iq/api-docs/Toybox/ActivityRecording.html#Sport1-module]
(If optimization is enabled, then the enums will resolve to integers at compile time and it won't matter which set of enum symbols you use, except ofc it's possible that certain integer values may not be accepted for some devices.)
In your case I think you need to use Activity.SPORT_RACKET (64) and Activity.SUB_SPORT_PICKLEBALL (84).
According to the docs, SUB_SPORT_PICKLEBALL is only available starting with API Level 4.1.6. If you tried to use it on an older device, it's possible that it would fail / crash.
To maintain backwards compatibility with older watches, you could use code such as the following:
if (Activity has :SUB_SPORT_PICKLEBALL) { // use Activity.SUB_SPORT_PICKLEBALL } else { // use TENNIS/GENERIC/whatever }
Thanks for the advice. I do support older watches.