To understand how the LocationSensor works please read this article and do the two Projects
Exploring with Location Sensor in AI2The location sensor object is used to communicate with the global positioning satellite receiver (GPS) in your phone/tablet. When the LocationSensor communicates with the built-in GPS receiver, the GPS can determine the location of your device. The sensor can also work with network/wifi location services. Finding a location using the network uses very different techniques to determine a location. Location means, the device's present latitude and longitude or it can mean your street address.
Your simple app does not work for a variety of reasons:
1) You initially tried to find an exact latitude and longitude ...Scott explained why that does not work.
2) A property of the LocationSensor called Accuracy (explained in the tutorial). When you read the tutorial it explains that the GPS frequently does not know exactly where the Android is with any precision.
3) Your present code is an attempt to create a ring-fence; determining whether the device is within that fence is problematical. The app might not be working for a variety of reasons depending on how often you program the LS to get a satellite fix or you are located South or North of the equator or to the West or East of the Prime Meridian (that affects how you set up your logic blocks) ..and you obscured the most important part of your geocoordinates. Also, the TTS code might be creating an issue with timing...AI2 is event driven,
4) Other things can go wrong: Does your device have a GPS receiver? If it does not and you depend on network, Accuracy is terrible . Do you use the most accurate geolocation method Provider = gps and then lock it or do you use no settings and let the LS select what method it wants to use? Do you see the GPS icon flashing occassionally at the top of your device screen..that shows the GPS receiver is trying to obtain a satellite fix.
5) the GPS receiver itself in many devices is not very precise, unless you monitor Accuracy continually, you will never know whether the GPS has a poor or very good satellite fix.
When finished with the LS tutorial perhaps read and do this tutorial
The Maps 104 tutorial describes Accuracy in a different way than the LS tutorial.
There are several solutions to your original problem, knowing when you arrive at a particular location.
Solutions include:
2) Using the LS DistanceInterval property to determine how close your device is to a certain point (google the forum for a discussion that mentioned Halte Alarm ..Christophe solved his problem that way. DistanceInterval is discussed in the LS tutorial
3) Calculate the distance from the Android's current location to the desired location every minute or so, when the distance is small, you are there (the second tutorial demonstrates several ways to calculate distance). You will have to write code to poll the calculation.
5) When all else fails look at a paper map, phone the residents of the house and ask them if they see your Android outside perhaps?
Hope this helps Nico. When a developer realizes the GPS in phones is basically stupid, he/she can program around the device's limitations when he understands how the hardware and software tools work.
Regards,
Steve