Your atStop Procedure is probably doomed to failure. I think you specify a specific latitude/longitude the LocationSensor needs to exactly match a location in a database. An exact match of coordinates seldom happens. Why?
- the LocationSensor does not really know where it is with any precision. Read about the Property called Accuracy to clarify this phenomenon. Using the Location Sensor explains the issue of uncertain, imprecise information. Unsure? Do the two tutorial examples - just load the aia's to your device and experiment. A LocationSensor, resting on a desk, reports locations for the device ; note that no two readings are the same.
Graphically, this looks something like this
- If the device is moving rapidly, the device will probably blow through the specific geocoordinates between satellite fixes.
- if you sample coordinates more often than 30000 ms (every 30 seconds) you do not give the gps receiver an opportunity to achieve a new satellite fix (and report a new, perhaps ambiguous, location.
What you can do?
- use a ringed fence to determine you are there. See Location sensor (ringed fence / circular ringed fence) - #2 by SteveJG
- or continuously calculate the straight line distance from the device to the geocoordinates and when the distance gets close; decide you are there. Remember, most devices cannot resolve small distance changes with any reliability at all and not rapidly.
- a few years ago, a developer wrote a program to determine whether someone arrived or was arriving at a specific bus stop. I think it was called HalteAlarm, he used a different technique by using (from LocationSensor ) .. DistanceInterval ---- Determines the minimum distance interval, in meters, that the sensor will try to use for sending out location updates. For example, if this is set to 50, then the sensor will fire a
LocationChangedevent only after 50 meters have been traversed. However, the sensor does not guarantee that an update will be received at exactly the distance interval. It may take more than 5 meters to fire an event, for instance. It is also useful to check againstAccuracywhen using this property. When your device is moving, the accuracy of the detected location is constantly changing. He sets the DistanceInterval in the LocationSensor to 400 meters and finds this worked well for his purposes.
Think about how you are determining that you have arrived. I suspect you have a problem. Be aware what the gps hardware is capable of doing and you will finish your app. ![]()
Good luck.
Regards,
Steve

