We briefly introduced the Canvas class in the previous recipe, using it to draw a shape. Objects that have an onDraw()
callback, like Views, provide one for us, but the real power of the Canvas is that it gives us control over all our draw()
calls so that we can change our graphics in real time.
Here we will use a Canvas, along with a Paint object to produce a graphic that will follow the user's finger as it moves across a touch screen.
This task is similar to the previous one. If you like, load it up and edit it according to what you find here. Otherwise start up a new project from scratch in Eclipse.
If you have not yet come across touch listeners, you might want to take a quick look at the recipes in Chapter 6, Detecting User Activity first as they are explained in more detail there.