Chmouel Boudjnah Chmouel Boudjnah - 1 year ago 146
Android Question

Get the distance between two geo points

I want to make a apps that check what's the nearest place from where the user is. I can easily get the location of the user and I have a list of places with latitude and longitude.

What would be the best way to know the nearest place of the list against the current position.

I could not find anything in the google APIs.

I am worried I need to resort to my calculate and have to do math to calculate it.

What do you guys think ?

Cheers and thanks for reading or replying.

Answer Source
Location loc1 = new Location("");

Location loc2 = new Location("");

float distanceInMeters = loc1.distanceTo(loc2);


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download