[CIQBUG] Cannot create a session for strength training

The following code produces an error in the simulator. I have not bothered to test it on a device.

var session = Rec.createSession({
:sport => Rec.SPORT_TRAINING,
:subSport => Rec.SUB_SPORT_STRENGTH_TRAINING,
:name => "weights"
});


The documentation around what sport/subsport combinations are supported is pretty poor.
  • Testing indicates that none of the SUB_SPORT_* values beyond SUB_SPORT_FLEXIBILITY_TRAINING work at all. The documentation seems to indicate that I should be able to do the following...

    var session = Rec.createSession({
    :sport => Rec.SPORT_TENNIS,
    :subSport => Rec.SUB_SPORT_MATCH,
    :name => "tennis_match"
    });


    Unfortunately that results in an Invalid Value error as well.

    Travis
  • Former Member
    Former Member over 10 years ago
    "When the Monkey C compiler finds a new symbol, it will assign it a new unique value."
    Before preprocessing this code look like:

    var session = Rec.createSession({
    1 => Rec.SPORT_TENNIS,
    2 => Rec.SUB_SPORT_MATCH,
    3 => "tennis_match"
    });


    Don't trust MonkeyC manual ;) I'm think "sport" => , "subSport" => work better :)
  • Former Member
    Former Member over 10 years ago
    Sorry guys, the max sub sport validation was accidentally set to the max sport value, so as Travis has observed, the max usable sub sport is currently SUB_SPORT_FLEXIBILITY_TRAINING.

    This should be fixed in the next release.
  • So, the problem has been fixed on the current 3.23 beta firmware for the 920XT, but firmware for other devices are is still affected.

    Any good ideas on how to avoid the crash on devices that don't have the fix other than to avoid their use entirely? I ask because I'm working on an app that allows the user to select the activity type/subtype from a menu. If I make the menu options available, then the application will crash for some activity subtypes. If I don't make the options available, then the requested functionality (specifically the ability to create strength training activities) will not be possible.

    I suppose a note in the app description mentioning the limitation and which device firmware versions are affected is reasonable, but I'm hoping to find a way to do it programmatically.

    Travis
  • What I see Travis, is that it will be fixed in the next version of the SDK, and THEN it will work in the firmware, but I might be wrong!
  • It may be fixed in the next version of the SDK, but it is definitely fixed in the 3.23 firmware for the 920xt. Kyle mentiones it in the fix list here, and I've verified it myself.
  • Former Member
    Former Member over 10 years ago
    Unfortunately, I don't think there is a good way at this time. We are working on adding a way to read the ConnectIQ version of the device within the app. This way, if a bug is fixed in version x.x.x you can check that you are running at least that version before enabling the feature.

    I think there are also plans to be able to require a ConnectIQ version for your app to run, so the user would be informed that they need an update to run a particular app.
  • Just to close the loop on this, this fix was included in the 1.1.1 SDK release.