I am using google map api v2 in my android application, I am able to show the map and put markers on it, but now I am stuck with the problem in which I need to find out the distance between two markers or points placed on map, I have already gone through the docs but didn't find anything helpful in this case.
If anyone knows how to solve this then please help me.
Thanks
Best Answer
In
Google Map API V2
You haveLatLng
objects so you can't usedistanceTo
(yet).You can then use the following code considering oldPosition and newPosition are
LatLng
objects :For more informations about the
Location
class see this link