Converting Animated GIFs to AnimationDrawables

Tushar Acharya
1 min readJan 4, 2016

--

Not very long ago, I was working on a client project which was extremely animation centric. The app had a lot of situations where the user has to be shown animation A when a huge background job B is executing.

Instead of using an AnimationDrawable or the Animation framework, embed a WebView displaying an animated GIF. - Marc Poppleton

Wanting an animated GIF is understandable, in that animated GIFs are easy for designers to create. However, using a WebView or a 3rd party GIF player for the sole purpose of displaying an animated GIF is a huge performance and memory killer.

So, I wrote a bash script to convert animated GIFs to AnimationDrawables at the command line and added a web front end to it -

http://tusharonweb.in/AndroidResourceTools/GifToAnimationDrawable/

You can find the source code on GitHub.

Do let me know if you find any issues with the above website or the script.

--

--