I want display the two places distance in kilometers for that I write the following code:
hyd(17.38,78.48) eluru(16.7,81.1)
private String getDistance(doubl
Use this method
public static void distanceBetween (double startLatitude, double startLongitude, double endLatitude, double endLongitude, float[] results);
example
public static double CalculateDistance(double lat1, double lng1, double lat2, double lng2) {
float[] result=new float[1];
Location.distanceBetween (lat1,lng1,lat2, lng2, result);
return (double)result[0]/1000; // in km
}