Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps
by Derek Walter, Mark Sherman
Scope: Global and Local Variables
So far in this chapter, we’ve used two kinds of variables that are built into existing parts of App Inventor: the properties of a component and the parameters to an event. You likely will soon encounter a case when you need your app to remember something but those two built-in variables won’t do the job. You have two more kinds of variables available: global and local. In general, a variable is a location in the app that’s invisible where you can store some information. All the variable types in this chapter have that in common: They hold data. They also have names that make it easy for humans to use them while working on the app.
A global variable is accessible anywhere in your blocks. It can be read or written ...
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