I wanted to update the server with latlong of current location when there is difference of x meters between current location and previous location.
I have a app where i wanted to track vehicle movement so the driver who is using that app inside the vehicle will automatically update its current location when there is difference of x meters between current position of cab and previously stored location. So other users will be able to locate this driver where exactly is.(So in this case should i run a thread to automatically request for update of current location or something).
How to find out if the distance between two latlong points so that i can find out if the difference between current location and previously stored location is X meters.
If i use requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener)
function i will be able to provide minDistance as X meters and it would do the job but it is not giving accurate update to server.
I have gone through this question here but as i am a beginner did not have clear idea. So i would appreciate if somebody helps how i can achieve this.