Reputation: 579
I am new android application developer. I have create a mapview application where i need to calculate the distance of two geo point.How can i do that.
Upvotes: 1
Views: 2156
Reputation: 64700
Use the Location.distanceBetween method:
GeoPoint prev, current;
float[] results = new float[3];
Location.distanceBetween(prev.getLatitudeE6()/1E6, prev.getLongitudeE6()/1E6, current.getLatitudeE6()/1E6, current.getLongitudeE6()/1E6, results);
Upvotes: 4