答案 0 :(得分:1)
使用以下内容:
float[] result = new float[0];
Location.distanceBetween(startLatitude, startLongitude, endLatitude, endLongitude, result);
//The computed distance is now stored in results[0].
您也可以使用Google Maps Android API Utility Library: 它有静态方法来计算距离。
SphericalUtil.computeDistanceBetween(from,to)
//Returns the distance between two LatLngs, in meters.