I'm fetching the user's best current position using this snippet:
LocationManager ltrLocationer = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
Location locLocation = ltrLocationer.getLastKnownLocation(ltrLocationer.getBestProvider(criteria, true));
I have a two Double
objects containing a latitude and a longitude respectively. I'd like to check the distance in metres between the current coordinates and the the aforementioned value. How can I do this?
This sounded like a pretty simple thing to accomplish but I haven't been able to find an example illustrating this. Thanks.