O'Reilly logo

Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps by Mark Sherman, Derek Walter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required