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

Programming Blocks

Now that we have the interface set, we need to program some blocks so the artistic creativity can take place.

1. In the drawer, click on Canvas1 and pull out two different blocks: when Canvas1.Touched and when Canvas1.Dragged (see Figure 4.10).

Image

Figure 4.10 The blocks to handle canvas touch events.

These blocks respond to two different actions that the user can take with the canvas. Dragged is triggered when the user slides a finger across the canvas. Touched is triggered when the user taps on the canvas in one place. In both of these events, we need to paint information about that specific drag or touch onto the canvas in ...

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