Event Handlers

All of your blocks, the pieces that make your app perform tasks, will be connected with an event handler. Events are created whenever something in the real world happens to the app, such as when the user clicks a button, the phone’s location changes, or the phone receives a text message. Blocks exist for just about everything you want to do in an app; taking a picture, checking the GPS location, displaying text, changing the color of a component, finding out what the user entered into a text box, and so on. You can add (or remove) these blocks from an event handler, allowing the programming to determine the precise set of actions to take when the user presses a button.

When any event happens, App Inventor runs whatever blocks are ...

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.