views:

48

answers:

1

Yo guys,

I'm trying to get into native android development coming from an Actionscript 3.0 background.

My question is: what is the standard convention for creating basic movement in Android? By movement I mean a 2D graphic moving across the screen for instance.

Is it by using timers to fire a general update() method?

I have seen some things about the onDraw() method of Views but it doesn't seem to be used very often (if at all) and I'm guessing this is because it would be very restrictive and would fire just as soon as the phone can handle it, not when you need it, but really I'm not sure.

Anything is much appreciated, and an example would be very lovely indeedy! :)

+1  A: 

If your activity is mostly graphics (e.g., a game), use the Canvas and the rest of the 2D graphics APIs.

If, instead, your activity is going to be based around widgets (buttons, checkboxes, text entry fields, etc.), then use a TranslateAnimation.

CommonsWare