Help with location sensor & clock

My location sensor is displaying: “no address available”

And when I click on button1, the messaging application is not opened,
but if I remove the clock (the whole clock part and interval), it works fine, but the current address is always displayed as “no address available”.

I tried changing it to Latitude & Longitude but it shows 0 0.

Hi and welcome. You have multiple issues Akshay.

Have you read Using the Location Sensor ? If you have not read it and done the tutorials, do so to learn how the LocationSensor works.

Here are some suggestions:

  1. Get rid of the Clock, you do not need it.

  2. Checking ever 5000 ms (5 seconds) is more frequent than the phone can/will send a text message. see # 1

  3. Learn how to use the Notifier See the image where you have issues. notifierAlert

  4. Learn how to use the TinyDB.

  5. Hint: get the LocationSensor to work without the TinyDB and Texting. 0,0 means the LocationSensor has not yet achieved a satellite fix. 0,0 is the default location that displays if no satellite fixes have been achieved (explained in Using the Location Sensor). 0,0 is located in the Atlantic Ocean and is the reason you get No location available. It takes usually about 30 seconds for the gps to get a satellite fix … set the LocationSensor.TimeInterval to perhaps 30000 ms and you should have better result. The following Blocks show how you might send text and use the LocationSensor

    that you might find helpful.

Try again. Get parts of the app to work with the LocationSensor then work with the Texting control Texting . When that works, develop the parts where you save numbers and things to the TinyDB.

Here are some resources to help you learn to use the AI2 tools. A very good way to learn App Inventor is to read the free Inventor’s Manual here in the AI2 free online eBook http://www.appinventor.org/book2 … the links are at the bottom of the Web page. The book ‘teaches’ users how to program with AI2 blocks.

There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles

How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling .

Also look here http://kio4.com/appinventor/index.htm and here http://www.imagnity.com/tutorial-index/ for more tutorials.

Good luck.

Regards,
Steve

Thanks for the help Steve. I’ve managed to fix almost all the problems of the location sensor.
And there are no errors with the functioning of the app.

But there is one problem that I face, after selecting 4 phone numbers (referring to tagA, tagB, tagC, tagD) and then closing the app and reopening it, it only shows single phone number - the last one I added (i.e., tagD).
For example, I added 4 phone numbers: 1111, 2222, 3333, 4444 and then I close the app and then open it, I can only see 4444 (the last one I added).
I can’t understand the cause of this problem. Any help would be greatly appreciated.

The way you are saving the phone numbers n the TinyDb, any new number being saved is OVERWRITING the previous entry. You need to create a list, and save the list .
What I see from your blocks, is you intend to send your location to 4 mobile numbers as a SMS.

  1. Create a List of numbers
  2. Save the List
  3. Create a loop. For every item in List Do ....... (To send the SMS)

I think this should work out for your requirement

I out the list view just to check the phone numbers getting appended to list. You can remove that.