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

Exercise: Flick

The app Flick (see Figure 5.9) creates a ball that can be flicked across the screen or moved by shaking the phone.

Image

Figure 5.9 The final product of the app.

1. To begin, open a new project and name it Flick.

2. Drag out a canvas. We then want it to fill the screen, so change the width and height on the canvas to Fill Parent. This tells the canvas to take up all the available space in the app.

3. Drag out a ball. Drop it into the canvas; ball components can be placed only in a canvas. To make it a little easier to see and flick, change the size by making the Radius 10 (see Figure 5.10).

Figure 5.10 The Radius adjusts the speed ...

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