App Inventor provides two components to facilitate database activity: TinyDB and
TinyWebDB. TinyDB is used to store persistent data directly on the Android device;
this is useful for highly personalized apps where the user won’t need to share her
data with another device or person, as in No Texting While Driving. TinyWebDB, on
the other hand, is used to store data in a web database that can be shared among
devices. Being able to access data from a web database is essential for multiuser
games and apps where users can enter and share information (like the MakeQuiz
app in Chapter 10).
The database components are similar, but TinyDB is a bit simpler, so we’ll explore it
first. With TinyDB, you don’t need to set up a database at all; the data is stored in a
database directly on the device and associated with your app.
You transfer data to long-term memory with the TinyDB.StoreValue block, as shown
in Figure 22-1, which comes from the No Texting While Driving app.