"Maybe" Bug -> Toybox has :ActivityRecording

Hello!

I'm not sure, but I think I found a bug. When I want to create an ActivityRecording session I always check if(Toybox has :ActivityRecording) and it is always come back with FALSE (on device and simulator). However if I skip this line, the program is 100% percent working, which means my device/simulator has ActivityRecording. 

  • I don't see this with the 3.1.8 SDK,and a device app, and the targets I tried.

    Sys.println("h="+(Toybox has :ActivityRecording));

    always shows true.

    Are you trying to do this in a widget?  What target?

  • Hey, I use 3.1.8 and developing watchapp on fenix 5plus. I do a total eclipse reset, and now it is working on fenix 5plus, fr 945 etc. So the problem was with my IDLE. What is interesting is that I load up the data to my watch and also had an issue.

    Thanks for checked for me! :) If there is an admin, please delete this post, I failed! 

  • In reality, it's a check you don't need for device apps, as all devices have ActivityRecording.

  • I'd like to ask one more thing, now I'm testing the Activity Recording with elapsedTime, but I will need elapsedDistance in my app. I see that elapsedTime starts counting when I start the recording, but when I stop it, the elapsedTime is still counting( I guess the elapsedDistance too). Is there any chance to stop the counting or should I save it into a temporary variable and subtract when I continue the recording?

  • Understand the difference between elastedTime and timerTime.

    elapspedTime is the time since you first start recording.  timerTime is how long you have been recording, so if you pause, it pauses.

    elapsedDistnce only changes while you are recording

  • I see, thank you very much both information was very useful for me, especially the timerTime!!! :)

  • I`d like to ask one more question, because you have more experience than me. So if at Activity Recording I set the :sport=> Running, then the watch app calculated the speed from hand movement (guess it`s using accelerometer), but if I set the sport to Cycling, the device is using the GPS to calculate the speed, but not counting the elapsedDistance (session is running). So my question is: if I want to use the GPS to calculate the speed then I have to calculate the elapsedDistance from Position, or there is other solution? 

  • No, actually all you have to do is enable GPS.  Look at the record sample in the SDK

    Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(:onPosition));

    then things are calculated using GPS.  You may want to check the accuracy in the callback (onPosition here) before you start recording to make sure you have a reasonable lock.

  • Yeah, I enabled the GPS! 

    First I test the app as Running Activity, in my Garden running around and it worked not bad, but when I sat into the car, the Speed and distance didn`t work, I stop the car get out, walk around and it`s worked till I sit into the car again (I kept my watch out of the window). While in cycling aactivity the speed calculation was good(without hand movement), but the distance was 0, and GPS was ready. I`ll do a full check again with accuracy checking, and also check the record sample!

    Thanks! :)