问题
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.
回答1:
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);
来源:https://stackoverflow.com/questions/6283028/distance-of-two-geo-point-android