Alex Rivera | Logout

Android: How do a display a large animated gif given a url?

Asked 2009-05-01T01:29:13.597
15

Suppose I have the URL for large animated gif and I wanted to make a youtube like activity that displays the animation in a streaming way. How do I

  1. stream in the image?
  2. get it do display with actual animation?

I know ImageView is not the answer as it only shows the first frame.

A bonus would be having access to its buffering status so I can synchronize streaming sound as well -- this is part of a YTMND viewer application. While I could create a service that transcodes the public gif files into a nicer format, I'd like the app to function without additional dependencies.

Edit
Report

1 Answer

0

Maybe AnimationDrawable could work for you? EDIT: Not if you want to load from a URL like this post is about. Sorry

http://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html

Depending on the complexity of the GIF i.e. if it is a simple loading/progress indicator you could break the GIF apart, save each image separately and use the Android Framework's AnimationDrawable.

For simple progress bars this may be less error prone, maybe even more performant.

answered 2011-07-10T15:10:07.757

Your Answer