In android i fetched the latitude and longitude of the current position, i also have other two co-ordinates, i need to compare the two co-ordinates with met which is my co-ordinates and get the nearest one dynamically. I tried it but dynamically how to get it?
You can use distanceTo(Location dest)
for comparing locations or distanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude, float[] results)
for comparing coordinates.
Both methods give you the distance between two points. If you do it dynamically you only have to calculete wich is smaller.
More info about them: Location Android