Bernard de Wet

unread,
Sep 8, 2016, 10:39:11 AM9/8/16
to MIT App Inventor Forum

Hi guys... i made an app where the users can rename buttons to what they like. Every time they close the app the buttons that were renamed would go back to the default name. Why is that and how to keep the button like they renamed it?

Taifun

unread,
Sep 8, 2016, 11:15:12 AM9/8/16
to MIT App Inventor Forum
use TinyDB, see also http://ai2.appinventor.mit.edu/reference/components/storage.html#TinyDB

Apps created with App Inventor are initialized each time they run. This means that if an app sets the value of a variable and the user then quits the app, the value of that variable will not be remembered the next time the app is run. In contrast, TinyDB is a persistent data store for the app. The data stored in a TinyDB will be available each time the app is run. An example might be a game that saves the high score and retrieves it each time the game is played. 

TinyDB tutorial by Stephen

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 do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the
 Top 5 Tips: How to learn  App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by  Taifun.         



Bernard de Wet

unread,
Sep 8, 2016, 11:24:56 AM9/8/16
to MIT App Inventor Forum
Thanks man or woman! I store the name in the tinydb but then do i run a procedure to rename it from the tinydb when they start the app?
Reply all
Reply to author
Forward
0 new messages