In this chapter, you will learn how to handle touch events by writing a custom subclass of View named BoxDrawingView. This View will draw boxes in response to the user touching the screen and dragging.
Figure 32.1 Boxes drawn in many shapes and sizes
The BoxDrawingView class will be the star of a new project named DragAndDraw. Select New → Android Application Project. Configure the project as shown in Figure 32.2. Then create a blank activity named DragAndDrawActivity.
Figure 32.2 Creating DragAndDraw
DragAndDrawActivity will be a subclass of SingleFragmentActivity ...