I am writing a distance calculating app and my approach has been the following.
1. Request location updates every 500ms.
2. Calculate the distance between the previous location and current location using the distanceTo() method in android.location.Location.
3. Update the total distance traveled.
An accuracy check is done to make sure the accuracy is within a given threshold, and only that are accurate enough are taken in for the distance calculation.
This works well and the accuracy has been good. However during slow moving traffic we've noticed that the distance traveled on the app is more than the actual distance traveled (according to the odometer). I believe this might be because the distance traveled is less than the accuracy given by the phone. Because of this the vehicle might have moved a 2-3 meters but since the accuracy is around 6-8 meters there is an error introduced to the distance calculation.
Has anyone had similar experiences with similar applications ? If so what would be the best approach to resolve this ?
Thanks.