Frequently asked questions
- I know how to animate widgets now but what about shapes or images that I create myself?
An
ImageView
can hold any image you like. Just add the image to thedrawable
folder and then set the appropriatesrc
attribute on theImageView
widget. You can then animate whatever image is being shown in theImageView
. - But what if I want more flexibility than this, such as for a drawing app or even a game?
To implement this kind of functionality, we will need to learn about another general computing concept (threads) as well as some more Android classes (such as
Paint
,Canvas
, andSurfaceView
). We will learn how to draw anything from a single pixel to shapes and then move them around the screen starting in the next chapter, Chapter 20, Drawing Graphics.