The Basics

A list is multiple pieces of data stuck together, one after another. Those pieces of data are in order, meaning that whatever is in slot 1 of the list will stay there unless you move it. Every item in the list has a number, starting with 1. Figure 6.3 shows what lists look like to the phone. Each cell is a place you can put something (a number, a piece of text, or anything else), and each something has a number. There are no empty items: Each item has to have something in it, and no numbers are skipped.

Image

Figure 6.3 What a list looks like in the phone’s memory.

The list itself is a container. Regardless of how much stuff is inside ...

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.