I am implementing an application to search for nearest local venues from a gps coordinates database.
i am using the Location class distanceTo()
function to calculate distance between two location the current one and the one from the database.
currentloc.setLatitude(loc.getLatitude());
currentloc.setLongitude(loc.getLongitude());
dbcurrent.setLatitude(C.getDouble(latindex));
dbcurrent.setLongitude(C.getDouble(lonindex));
distance = currentloc.distanceTo(dbcurrent);
this work fine and i am able to use this distance to calculate proximity in the rest of my app, but the distance it self is not apparently in meters i am getting result like 4134801.4 i am sure that the distance is 3200meters in this case.
Is there any explanation or solution for this issue.
thank you all.