Animation strategy

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Animation strategy

Postby Michael_Matveev » Wed Jan 16, 2008 1:29 am

Hello All,

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.
&&dev
Michael_Matveev
Freshman
Freshman
 
Posts: 6
Joined: Wed Jan 16, 2008 12:42 am

Top

Postby res » Fri Jan 18, 2008 12:55 am

Well Lunar Lander is shipped with the SDK from Google so you think they would promote best practices.
res
Senior Developer
Senior Developer
 
Posts: 146
Joined: Tue Nov 20, 2007 8:14 pm
Location: United States

Top

Return to General

Who is online

Users browsing this forum: No registered users and 6 guests