In App Inventor, what is the TinyDB component used for? What is TinyWebDB used for?
TinyDB and TinyWebDB are both used to store data persistently so that it exists even after an app is closed and re-opened.
TinyDB is used to store and retrieve data from a database directly on the device. TinyWebDB is for storing and retrieving data on the web, and is thus used for apps that share data amongst users and devices.
TinyWebDB is more complicated to program than TinyDB. Explain the differences, being sure to mention the following blocks:
TinyWebDB can store data onto any App-Inventor-compatible web service, so unlike TinyDB, TinyWebDB has a ServiceURL property which you set to specify the particular web database to be used.
With TinyDB the app receives data from the database immediately on a call to GetValue. With TinyWebDB, on the other hand, retrieving data is a two step process: you first request data with TinyWebDB.GetValue. Data is not returned immediately to this block. Instead, when the data arrives from the web the TinyWebDB.GotValue event is triggered. Thus, put your code to process the data in this event handler.