I have a general question. I want to know the standard way of displaying animated talking characters? The animation is just of mouths moving.
My initial thought were to use GIFs. Android can decode and display animation GIFs using the android.graphics.Movie class. Seems to work well, and keeps resources under control.
But someone else mentioned using AnimationSet, where I can add Animations to the Animation sets with addAnimation(), and then start the animation which will load all the animations together at once. This seemed to be more difficult, but he mentioned this was Industry standard way of doing animations.
I just want to confirm. What is the best way? The third alternative I know is to use videos. But if I had to choose between a video and a simple GIF, I think I would choose the GIF because of the size differences.
Any input on this? Thanks in advance.
First of all you want to animate some bitmaps sequentially (I guess). The gifs and the video way seems to be uneconomic and little bit expensive for your memory. So, there is two ways to achieve animations between sprites. The first way (and I would prefer this way for this situation) is as you mentioned above to use AnimationSet. The logic is quite simple. You declare the animation in xml files and then you load all this in your Activity code. You can take a look here and here.
The other option that you have is to use a timer and draw the animating sprites/bitmaps in your canvas. You can read this tutorial even if your problem is simpler.