I’ve found two types of animation strategy. First, it is calling invalidate method within onDraw method of View subclass, like in Lunar Lander.
The second one is using a separate thread that generates messages to update view, like in A Bouncing Ball - Bacic Graphics Animation Demo example.
What is the best approach to implement animation? My application must react on the key pressing and currently implements the first strategy.
After pressing a key in series the screen continues updating, even I had stopped pressing it. OTOH the animation must be processed when no key is pressed.