Documentation request for the LocationSensor

Hi Steve,

I was wondering if you had access to the location sensor documentation on the Mit App Inventor website (http://ai2.appinventor.mit.edu.ezproxy.canberra.edu.au/reference/components/sensors.html#LocationSensor)? I was wondering if you could please add (or request someone to add) the piece of information that if you are using particular location sensor properties at the beginning of your code, they will not function properly as the location sensor takes time to receive the user's location information. This indicates the effect of not having the location information readily available in terms of a coding standpoint. I realize that part of this is already mentioned on the website: "Location information might not be immediately available when an app starts. You’ll have to wait a short time for a location provider to be found and used, or wait for the LocationChanged event." However, I would really appreciate if you (or someone who has access) could add on the information that I mentioned earlier so that other people do not run in the similar problem that I did. Please let me know what you think.

Hi Jay. The developers will see your post and hopefully can accommodate your request. I sent them a message to let them know.

When the LocationSensor is enabled, it sends a request to the GPS hardware to obtain a satellite fix to determine it's location. On most hardware, this takes 40 to 60 seconds for the GPS radio to confirm it's location and the LocationSensor to trigger a LocationChanged event. Developers expect an immediate response. As you discovered, that does not happen. Until a LocationChanged event following a satellite fix occurs, the default latitude of 0 and longitude of 0 are reported.

In all my apps using Location/Map requests I usually use this code (or something similar) to let the user know whether the LocationSensor is acquiring valid data. The Notifier.ShowAlert is a reminder to the user to try again to get a location and whate while the LocationSensor/GPS receiver do their homework.

-- Steve

A post was split to a new topic: How can I increment a variable at Midnight