Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps
by Derek Walter, Mark Sherman
Lists as Data Structures
Sometimes you don’t need a long, expanding list of entries. Sometimes you have just a few things that you want to keep organized and together. You can use lists to create little structures for your things, much like the color list gave structure to red, green, and blue values.
For instance, consider an app that keeps track of bills that need to be paid each month. For each bill, the user inputs a name (text), a day of the month it is due (number), and an amount (number). We can use a list to bind these three things together into a single unit that we can move around. Figure 6.18 shows such a list, which we can then consider to be “a bill.”
Figure 6.18 A list that provides structure for “a bill,” made from a name, a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access