9. Doodlz App: Two-Dimensional Graphics, SensorManager, Multitouch Events and Toasts

Image

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

Get Android™ for Programmers: An App-Driven Approach 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.