Chapter 22. Working with Databases

Figure 22-0.
Working with Databases

Facebook has a database of every member’s account information, friends list, and posts. Amazon has a database of just about everything you can buy. Google has a database of information about every page in the World Wide Web. Though not to such a scale, almost every nontrivial app you can create will interact with a database.

In most programming environments, building an app that communicates with a database is an advanced programming technique: you have to set up a server with database software such as Oracle or MySQL and then write code that interfaces with that database. In many universities, such database programming isn’t taught until an upper-level software engineering or database course.

When it comes to databases, App Inventor does the heavy lifting for you (and lots of other useful things!). The language provides components that reduce database communication to simple store and get operations. You can create apps that store data directly on the Android device, and with some setup, you can create apps that share data with other devices and people by storing it in a centralized database on the Web.

The data stored in variables and component properties is short-term: if the user types some information in a form and then closes the app before that information has been stored in a database, the information will be gone when the ...

Get App Inventor 2, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.