06-22-2023 03:58
06-22-2023 03:58
We are developing an app for open water swimming. Unfortunately, we are not able to read the exercise distance, even though GPS is enabled and working. The exercise.stats.distance from the device always return 0, but when viewing the activity in the Fitbit dashboard the distance seems to be measured pretty accurately.
Is there another way to track the elapsed distance directly on the device?
Answered! Go to the Best Answer.
06-22-2023 13:13
06-22-2023 13:13
Good question!
There's a chance that the Exercise API deliberately ignores the GPS (assuming unreliability) during a swim, like it does with heart rate. You could test this theory by specifying a different exercise type when starting the Exercise session.
I suspect that the Geolocation API would always work (except if using connected GPS), but it would be up to you to determine distance based on position readings. This might actually be an advantage for open-water swimming, since you'll usually want straight-line distance as opposed to track length.
06-22-2023 13:13
06-22-2023 13:13
Good question!
There's a chance that the Exercise API deliberately ignores the GPS (assuming unreliability) during a swim, like it does with heart rate. You could test this theory by specifying a different exercise type when starting the Exercise session.
I suspect that the Geolocation API would always work (except if using connected GPS), but it would be up to you to determine distance based on position readings. This might actually be an advantage for open-water swimming, since you'll usually want straight-line distance as opposed to track length.
07-22-2023 11:32
07-22-2023 11:32
Thank you very much, it works. We use this approach now in our Swim Trainer app: