Skip to content

Instantly share code, notes, and snippets.

@JFriel
Created May 31, 2015 10:37
Show Gist options
  • Save JFriel/132a67b2a8e6a16f4bfc to your computer and use it in GitHub Desktop.
Save JFriel/132a67b2a8e6a16f4bfc to your computer and use it in GitHub Desktop.
public getDistance(float latA, float latB, float longA, fload longB){
//Used to find distance between two LatLongs
Location locationA = new Location("point A");
locationA.setLatitude(latA);
locationA.setLongitude(lngA);
Location locationB = new Location("point B");
locationB.setLatitude(latB);
locationB.setLongitude(lngB);
float distance = locationA.distanceTo(locationB);
return distance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment