I have a navigation program, and if there are 4 waypoints, I would like to highlight on the details list which part you are currently on, and also I could show the distance to the next waypoint and the total distance.
So, you may have:
- Go right on Main Street, 1.3 miles
- Go left on Broadway, .5 miles
- Go left on Concord Blvd, 2 miles
But, how do I determine when a phone starts on a different waypoint.
Using the LocationManager you can set several ways for updates on a particular program. Use LocationManager.addProximityAlert() to be alerted if you’re in a particular distance to a waypoint. Additionally you can use
Locationclasses to get distance for examplewaypoint.distanceTo(currentLocation);.