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

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

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