O'Reilly logo

Android How to Program by Paul Deitel, Abbey Deitel, Harvey Deitel

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

9. Doodlz App

Objectives

In this chapter you’ll:

• Detect when the user touches the screen, moves a finger across the screen and removes a finger from the screen.

• Process multiple screen touches so the user can draw with multiple fingers at once.

• Use a SensorManager to detect accelerometer motion events to clear the screen when the user shakes the device.

• Use an AtomicBoolean object to allow multiple threads to access a boolean value in a thread-safe manner.

• Use a Paint object to specify the color and width of a line.

• Use Path objects to store each line’s data as the user draws the lines and to draw those lines with a Canvas.

• Use a Toast to briefly display a message on the screen.

Outline

9.1 Introduction

9.2 Test-Driving the Doodlz ...

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