HasLongitudeLatitude

79 views
Skip to first unread message

ewelme.w...@gmail.com

unread,
Mar 6, 2014, 9:01:51 AM3/6/14
to mitappinv...@googlegroups.com
What does the function "HasLongitudeLatitude" do and how would you use it?

I am looking for a function that will allow me to put a message on-screen that confirms that the GPS has acquired the satellite.

Thanks
David

Scott Ferguson

unread,
Mar 6, 2014, 9:43:07 AM3/6/14
to mitappinv...@googlegroups.com, ewelme.w...@gmail.com
The documentation here is incomplete so your guess is as good as mine -- although I am certain that those who have used GPS features should be able to help.
---
Scott

SteveJG

unread,
Mar 6, 2014, 11:44:35 AM3/6/14
to
hasLongitudeLatitude is a query to your device to find out if there is a gps on the device.
similarly, has altitude is to find out if the gps can determine altitude; some devices can, others cannot.

to know when the gps has aquired the required number of satellites, use the LocationSensor.LocationChanged.
set up a label with the word Wait in the designer.   In the blocks, set label.text to  Satellite Found.

The LocationChanged will only trigger when the lat or longitude change, the only way they can change is for the gps to realize it has sufficient fixes on satellites to report a valid lat/lon pair.

There is no way with ai 2 to determine the number of satellites the gps is using.   You can get an idea by looking at the accuracy of the gps.   there is a control for that;   use a button or a clock to request that info.    When the accuracy is on the order of 5 or ten meters, the gps is using many satellites, if the accuracy is +/- 50 meters, only a few satellites are being used.

regards,
steve

ewelme.w...@gmail.com

unread,
Mar 7, 2014, 6:00:37 AM3/7/14
to mitappinv...@googlegroups.com
SteveJG
Thanks for this really informative post.

Where would I find this sort of information?
The 'hint' button in the Block Editor only repeats what is written on the Block
and the documentation in the Library does just the same.

David

SteveJG

unread,
Mar 7, 2014, 8:11:13 AM3/7/14
to
You are welcome.  Scott posted the best link available and yes, using the hint button in the blocks editor provides some information.  The MIT development team is very small, just a few individuals and not all full time, so despite some very extensive documentation; all the capabilities of some controls are not discussed.  Volunteers provide most of the input and eventually documentation will improve.  I am part of a small team of volunteers.  We encourage new AI2 users to do the tutorials; learn, and when stuck, visit here.   Usually someone has a solution.

When I can not find some documentation in the AI2 Help, I peruse these forums, google a topic both within the forums and without (for example   google app inventor Location sensor  and you get lots of hits.  Then I explore.  If that does not work I 'experiment' with the control to see what happens when I query the methods of a control.  I am working on a tutorial w.r.t. the Location sensor that is almost ready.  I discovered how the controls in AI2 work by trial and error.  I already knew how to get similar information using a regular Windows PC.

I hope to post the tutorial somewhere.  I am knowlegable about gps technology in general because I retired from a profession making extensive use of satellite navigation.  You too David can become an expert; google     geolocation    or  Google Maps API   or Google Maps Static API.  If you like to do fun things, google  geocaching   .   Then perhaps, come back and share YOUR ideas.

Regards,
SteveG    


Reply all
Reply to author
Forward
0 new messages