Frequently asked questions
Q1) We know how to animate widgets now, but what about shapes or images that I create myself?
A) An ImageView
can hold any image you like. Just add the image to the drawable
folder and then set the appropriate src
attribute on the ImageView
. You can then animate whatever image is being shown in the ImageView
.
Q2) But what if I want more flexibility than this, more like a drawing app or even a game?
A) To implement this kind of functionality, we will need to learn another general computing concept, threads, as well as some more Android classes such as Paint
, Canvas
, and SurfaceView
. 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 20, Drawing Graphics.