MapIt_MIT -- data not persisting

43 views
Skip to first unread message
Assigned to ewpa...@gmail.com by steve....@gmail.com

CC

unread,
Apr 15, 2019, 8:48:56 PM4/15/19
to MIT App Inventor Forum
Hi,
I downloaded the app MapIt_MIT from http://explore.appinventor.mit.edu/displaying-maps . It ran this morning on a macbook pro and I am using an AI Companion, which is an Android phone with sim/wifi.

Earlier in the day, the app worked as intended. The data persisted. But now, the data no longer persists. I deleted the app and re-downloaded. I restarted the phone and the macbook. I cleared the data from the MIT AI2 Companion on my phone. I did a Hard Reset of the Connect. 

I just don't understand why it worked earlier and now it doesn't. Does anyone have any ideas? Absolutely nothing seems to work for me on App Inventor...





SteveJG

unread,
Apr 15, 2019, 8:58:28 PM4/15/19
to MIT App Inventor Forum
Did you compile the app and load it to your phone/tablet   and then saved the location information after you compiled?

CC

unread,
Apr 15, 2019, 9:53:48 PM4/15/19
to MIT App Inventor Forum
Hi Steve,

I compiled the app and loaded it on my phone and ran it a couple times and added data after waiting a couple minutes and the data is not persisting. It must be this app because another app using TinyDB is working and the data in it is persistent even from a few days ago. If you have any other ideas, please let me know? Thank you.

SteveJG

unread,
Apr 15, 2019, 10:02:44 PM4/15/19
to MIT App Inventor Forum
Wow.  Something is wrong  ... I compiled the app and loaded it on my phone and ran it a couple times and added data after waiting a 
couple minutes and the data is not persisting.

compile.PNG

Is this how you compiled  

CC

unread,
Apr 16, 2019, 8:44:28 AM4/16/19
to MIT App Inventor Forum
Hi Steve,
Thank you for your help. Yes, that is how I ran it. 

Device     Build->App(provide QR code for .apk)

Phone     read QR from phone->put in data -> closed.

Phone     Opened icon on phone-> no data. Put in data after a few minutes. Closed. Repeat, no data.

This app worked for me before I downloaded the cloud version that Tim made. That is just coincidence, right?








SteveJG

unread,
Apr 16, 2019, 9:35:11 AM4/16/19
to MIT App Inventor Forum
This is an MIT tutorial I have never done CC.  I just downloaded and compiled and installed on an Android 4.2 Tablet.     Enter Address  , then Submit, then Select Location and press the one location you want  Then view map.     Pressing  My Locatio On the Map shows where I am. but only one time.

Yes, there is something wrong... the address is NOT saving in the apk version.  Why, I do not know.   Not my code...I will look at this later today or perhaps someone else will compile the tutorial and discover why.

-- Steve

TimAI2

unread,
Apr 16, 2019, 12:12:07 PM4/16/19
to MIT App Inventor Forum
The blocks are a bit odd when creating the Listpicker elements, and the listpicker elements are not created on startup of the app.

The data is persisting, just not being displayed :)

Review the blocks in the initData and the appendNewAddress procedures

Hossein Amerkashi

unread,
Apr 16, 2019, 12:32:50 PM4/16/19
to MIT App Inventor Forum
I haven't been through entire thread. Have you tried creating .apk and running the .apk?

-Hossein.

TimAI2

unread,
Apr 16, 2019, 2:33:26 PM4/16/19
to MIT App Inventor Forum
I have performed a gentle remix on Map-It using the built-in map component instead of google maps, and also fixed the data persistence
(if only my house wasn't like a faraday cage, and I didn't have to step outside to test gps and data/phone networks!)
aia attached
MapIt_MIT_remix.aia

SteveJG

unread,
Apr 16, 2019, 3:07:44 PM4/16/19
to mitappinv...@googlegroups.com
@ Hossein   ... yes, the issues is after compiling, then running and adding the address data the data does not reappear after closing the app and restarting.  Three of us experienced this behavior.  Yes we created and ran the apk ...  The Google Maps display fine; the issue is the addresses do not reload on rerunning the compiled app.so they do not appear in the LIstPIcker.

Hossein Amerkashi

unread,
Apr 16, 2019, 3:48:24 PM4/16/19
to MIT App Inventor Forum
@Steve

I believe there are slight differences between what has been posted in MIT tutorial and the version in my blog here [1]. Could someone take the source (and / or .apk) from there and check?



-Hossein.

SteveJG

unread,
Apr 16, 2019, 7:20:57 PM4/16/19
to MIT App Inventor Forum
The MapIt tutorial code on the MIT tutorial page can be fixed with the following change:

mapitfix.PNG

Add the underlined two blocks in the initData Block.  The change will  make the addition  of Locations persistent.   So, add the underlined two Blocks to the Procedure, recompile and run the app.

Does that work for you CC?

Regards,
Steve

CC

unread,
Apr 16, 2019, 7:56:27 PM4/16/19
to MIT App Inventor Forum
Steve, 
IT WORKS. Thank you so much for your persistence in finding a solution. 
Reply all
Reply to author
Forward
0 new messages