Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standard way of displaying animated talking characters: Android

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.

like image 403
portfoliobuilder Avatar asked Oct 01 '22 01:10

portfoliobuilder


People also ask

What are the two different types of view animations in Android?

The animations are basically of three types as follows: Property Animation. View Animation. Drawable Animation.

What are the two different types of view animations?

There are two types of animations that you can do with the view animation framework: Tween animation: Creates an animation by performing a series of transformations on a single image with an Animation. Frame animation: or creates an animation by showing a sequence of images in order with an AnimationDrawable .

What is the difference between ValueAnimator and ObjectAnimator?

ObjectAnimator is a subclass of ValueAnimator. Main difference is that in case of ValueAnimator you have to override onAnimationUpdate(...) method where you will specify where to apply animated value: ValueAnimator animator = ValueAnimator.

How do I animate a view in Android?

You can use the view animation system to perform tweened animation on Views. Tween animation calculates the animation with information such as the start point, end point, size, rotation, and other common aspects of an animation.


1 Answers

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.

like image 97
karvoynistas Avatar answered Oct 03 '22 07:10

karvoynistas