How to use the Location Sensor to Send a Text Message

I read you but the problem is that in Congo DR rentalsensor does not work, even the latitude and longitude gives zero. What to do because I can’t wait to finish this application.
thank you

Are you testing inside a building ? LocationSensor on your device (assuming it has one…) may only work outside in the open, and may need time (30 seconds) to get a fix

Thank you for the answer
I tested it outside it still does not answer, the problem is that even before a GPS gives a position it takes the time to connect to the satellites but what I ask locationsensor to do is automatic is why it does not work no, if you can help me with a code that will make sure that when i activate locationsensor take the time to connect before sending me my position in latitude and longitude.
thank you

if latitude = 0
then do nothing
else do what you want to do


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

If latitude is 0 what does that mean


The default values for latitude and longitude in the LocationSensor are 0 and 0

What you may need to do to get your app working is use a Block similar to this locationsensorhelp

A check like this ensures that your LocationChanged event will only fire if the location reported by your GPS receiver has achieved a satellite fix using at least three geopositional satellites and the results are no longer the default values.

To get specific advice, post an image of your code please.

A tutorial explaining how to use the Location Sensor is here Using the Location Sensor . You might want to read the tutorial that explains how to use your Android GPS.

well, you found it out yourself, didn't you?


That’s the code

You want to do something like this Benjamin:

However this code might send a message every time the LocationChanged event fires so you have to modify the code to work with your Button.