Support for sports and sub-sports

I'd like to add 2 settings where the user can set the sport and the sub-sport. However I am not sure exactly how am I allowed / supposed to use these constants. IMHO there's some confusion in the documentation about the min api level: https://forums.garmin.com/developer/connect-iq/i/bug-reports/fix-documentation-of-min-api-level-in-activity-sport_-and-sub_sport_ 

Secondly am I allowed to combine each available sport with any available sub-sport? For example can I create a session with: SPORT_MOTORCYCLING and SUB_SPORT_INDOOR_ROWING? 

And more importantly how do I know either in compile time and / or run-time whether a device supports something? Does it matter at all? Or am I able to use ANY number as :sport and :subSport when creating a session as long as Garmin Connect supports it?

What about Rucking for example (https://forums.garmin.com/developer/connect-iq/i/bug-reports/bug-documentation-or-sdk-missing-recently-added-sports)

  • Thanks for the response! FIT File Viewer is an amazing tool, thank you for creating it!

  • Technically, it is possible to use an existing name, but you create a lot of confusion when you do so.

    My 2 cents on this:

    - devs may not care about the developer field name at all since end users don't see it in Connect (as the localized strings from resources are used instead)

    - devs may not care about duplicating a built-in field name (from FIT profile) because either the built-in field isn't displayed in Connect, it's not displayed in the same context as the CIQ field, or the built-in field isn't displayed with same name as what's in the FIT profile. (e.g. For walking activities, total_cycles / total_strides is displayed in Connect as "Steps" and its value is multiplied by 2).

    - devs may actually care using a specific developer field name if they are concerned about compatibility with a 3rd party app/site. The last time I checked (years ago), for 3rd party power to be accepted into Strava and Training Peaks, the FIT field had to be named "Power" *and* the correct native num had to be set.

    For example, Stryd Zones records stryd power with an internal field name of "Power", which seems like it could easily be confused with the native "power" field. Since both of these fields are shown in FIT File Viewer, I assume that field names that differ only by case are not considered to be duplicates. Perhaps it's ironic that Stryd avoids the problem of duplicate field names by using field names which are human-friendly, with proper capitalization and spaces to separate words instead of camel case or underscores. Then again, Garmin does say that the field name should use the device's current language, which implies they are allowing for at least the possibility that an end user will see it.

    ofc the field names in the FIT profile - profile.xlsx - aren't human-friendly. They're all lowercase with underscores to separate words, as in more suitable for source code than end users. For this reason, I don't really see the field name in the FIT profile as being exactly the same as the field name for a developer field.

    Anyway none of this is a criticism, I can see why duplicate field names would be a problem.