I want to display animated GIF images in my aplication. As I found out the hard way Android doesn't support animated GIF natively.

However it can display animations using AnimationDrawable .

Develop > Guides > Images & Graphics > Drawables Overview

The example uses animation saved as frames in application resources but what i need is to display animated gif directly.

My plan is to break animated gif to frames and add each frame as drawable to animationdrawable.

Does anyone know how to extract frames from animated GIF and convert each of them into Drawable ?

Best Answer

Android actually can decode and display animated GIFs, using android.graphics.Movie class.

This is not too much documented, but is in SDK Reference . Moreover, it is used in Samples in ApiDemos in BitmapDecode example with some animated flag.