FAQ
- We know how to animate widgets now, but what about shapes or images that I create myself?
ImageViewcan hold any image you like. Just add the image to thedrawablefolder and then set the appropriatesrcproperty on theImageView. You can then animate whatever image is being shown in theImageViewwidget. - What if I want more flexibility than this, more like a drawing app or even a game?
To implement this kind of functionality, you will need to learn another general computing concept (threads) as well as some more Android classes (such as
Paint,Canvas, andSurfaceView). You will learn how to draw anything from a single pixel to shapes, and then how to move them around the screen in Chapter 28, Threads, Touches, Drawing, and a Simple Game.