Acknowledged

Logging SPORT_VOLLEYBALL crashes the watch

I am the developer of the Volleyball App (Volleyball | Garmin Connect IQ). When I try to record an Activity as SPORT_VOLLEYBALL, it fails and crashes the App on the watch. The documentation does not contain SPORT_VOLLEBALL, but it seems to exist anyway (documentation on the SPORT Types is outdated).

Is there a way for me to record a volleyball activity (if the watch supports it)? Right now I do the following, which always seems to log as SPORT_GENERIC, but at least it does not crash the watch:

using Toybox.ActivityRecording as Record;
if (Record has :SPORT_VOLLEYBALL) {
  session = Record.createSession({:name=>"Volleyball", 
                                  :sport=>Record.SPORT_VOLLEYBALL,
                                  :subSport=>Record.SUB_SPORT_EXERCISE});
} else {
    session = Record.createSession({:name=>"Volleyball", 
                                    :sport=>Record.SPORT_GENERIC, 
                                    :subSport=>Record.SUB_SPORT_EXERCISE});
}



Parents
  • Hi Travis, thank you for you feedback - you solved my issue! I have seen the documentation that ActivityRecording SPORT_* Constants were depreciated, but I haven't found the replacing constants in the documentation.

    And yes, I was not precise with my description - it crashes my App (in a way that can not be cought with try/catch), but the watch is still OK. I will update the app to use the correct constants.

Comment
  • Hi Travis, thank you for you feedback - you solved my issue! I have seen the documentation that ActivityRecording SPORT_* Constants were depreciated, but I haven't found the replacing constants in the documentation.

    And yes, I was not precise with my description - it crashes my App (in a way that can not be cought with try/catch), but the watch is still OK. I will update the app to use the correct constants.

Children
No Data