Hello,
I am developing a simple application to monitor inline skating activities for the Vivoactive 5 and Vivoactive HR models because these models do not have a native application for this modality.
On the Vivoactive 5, I'm experiencing an issue where activity tracking sometimes stops unexpectedly. This is frustrating because the user has to save the activity and start a new one manually. Additionally, if they overlook the issue immediately, a significant portion of the workout data is lost.
I haven't been able to reproduce what causes the problem consistently. However, one time, it occurred when a goal notification appeared. After dismissing the notification and returning to the app, the speed (KM/h) remained at zero, and the recorded distance stopped increasing. This isn't just a display issue, as saving the activity confirmed that the total recorded distance matched what was shown on screen.
To debug this, I added a GPS signal indicator to the screen. When the issue occurs, the signal status drops to POOR and never recovers to GOOD.
I also noticed that this model allows users to switch from the app to view the watch face and then return. When doing this, the app sometimes loses the GPS signal but eventually recovers. This temporary loss means activity tracking pauses until the app becomes active again, causing minor data loss. I was able to block lateral switching, but I'm unsure if it's possible to prevent other actions, such as the app going inactive when receiving a notification or when the action button is held to open the quick action menu.
I'm using ActivityRecording for activity tracking, and no calculations are done within the app. I use Positioning events solely to force screen updates and display activity data.
I checked the documentation and found a note in the Position class stating that if the app goes inactive, it will stop receiving events but should resume once it becomes active. However, in the Core Topics/Application and System Modules section, it states:
"If the app is recording an activity and receiving position events, it will continue to receive events in the inactive state. If the app is not recording an activity, it is blocked from modifying the GPS state."
Based on this, the app shouldn't lose the GPS signal when inactive—but that’s exactly what's happening.
Is there anything I can do as a developer to prevent this issue?
I noticed that the simulator has an App Lock Enable option, and I wondered if that could help, but I couldn’t find anything in the documentation about enabling it programmatically.
Has anyone else experienced this issue?
It's worth mentioning that these models don't have a native app for inline skating tracking, so I had to create one.
More information:
Some code:
// this is how i create the session ActivityRecording.createSession({ :name => "Patinação inline", :sport => Activity.SPORT_INLINE_SKATING, :subSport => Activity.SUB_SPORT_GENERIC, }); // This is how I activate the sensors before creating the session and starting the activity. function onStart(state as Lang.Dictionary?) as Void { Sensor.setEnabledSensors([Sensor.SENSOR_HEARTRATE]); Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(:onPosition)); } // This is what I do at the positioning event function onPosition(loc as Position.Info) as Void { WatchUi.requestUpdate(); }