The One-Dimensional List

A single list is a one-dimensional structure. This is just like any list you would write on paper. It has items in an order from top to bottom (or left to right, depending on how you want to think about it). If we have a list, we can add things to it, whenever we want, nearly forever.

Here are some code blocks that will take the text from a text box and add it to a list every time a button is pressed (see Figure 6.17). This could be the beginnings of a note-taking app or a reminder app. The user types something in, and that is added to the list inside the phone when the button is pressed.


Figure 6.17 A copy of the text ...

Get Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.