There is a requirement to find the real time distance traveled using google maps. This should be calculated by the phone app itself. When I mean real time, I mean for example if the user is traveling to point A, the user can get to the point in many ways, what I want to do is calculate the total distance the user has traveled real time and not just assume and calculate the distance between the two points (which would not give the correct answer).
I googled around for this problem but could not find any method in doing so.
I personally thought of storing the longitude and latitude on the phone in a list and after the user reaches the destination the distance is caluclated using these points. However this means that I have to decide the interval in which these points are stored (every 1 min or so), which would mean that I would place location points in the list even though the user was actually still on the same road, which is quite unnecessary. Unless if anyone knows how to store the points at the appropriate time or some other solution
I am well more or less stumped on this problem, any help is really appreciated
The mobile platform is Android
Thanks, MilindaD
I think the best solution is to save the position each X seconds, and then calculate the total distance iterating between them, and to get the time, you just need to see the diference between the last point and the first one.
This is how gps tracking apps work.
Hope this helps ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With