Android Distance Calculate getDistance(double lat1, double lon1, double lat2, double lon2)

Here you can find the source of getDistance(double lat1, double lon1, double lat2, double lon2)

Description

get Distance

Declaration

public static double getDistance(double lat1, double lon1, double lat2,
            double lon2) 

Method Source Code

//package com.java2s;

import android.location.Location;

public class Main {
    public static double getDistance(double lat1, double lon1, double lat2,
            double lon2) {
        float[] results = new float[1];
        Location.distanceBetween(lat1, lon1, lat2, lon2, results);
        return results[0];
    }/*w  ww.  j a  v a2 s. c o m*/
}

Related

  1. dist(PointF p1, PointF p2)
  2. distance(int q1, int r1, int q2, int r2)
  3. distanceBetweenTwoLatLongs(Location oldLocation, Location newLocation)
  4. distanceInMeters(float distance)