In my app I want to reach a specific destination from my current position and I'd like to inform me with a message, an alert,... if I take wrong direction from the destination
Asked
Active
Viewed 32 times
-1
-
What language? What framework or library? Edit your question and add more details. – Martin Dinov Jan 13 '14 at 10:12
-
i have built an adroid app and in my google map displayed my current location and a specific proximity alert. I want an alert to be visible when i get wrong direction from my destination – user3110726 Jan 14 '14 at 14:43
-
I've given you an answer that should get you going, but please update and improve your question, so that future readers can better understand what you are asking. – Martin Dinov Jan 14 '14 at 18:54
1 Answers
0
In general, a simple approach that should work is this: every time you get or check your position, calculate distance to the destination and if it's increased since the last time (which you need to keep track of), then display your alert. Since you added that this is for Android, you can do this as follows: Register a LocationListener
in requestLocationUpdates()
. Do the check for the distance check in the onLocationChanged()
method of the LocationListener
.

Martin Dinov
- 8,757
- 3
- 29
- 41