Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 956005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:28:33+00:00 2026-05-16T00:28:33+00:00

Trying to play animated GIFs on Android here (see Android: How do a display

  • 0

Trying to play animated GIFs on Android here (see Android: How do a display a large animated gif given a url?). It’s anything but smooth. On Android 1.5, the Movie.decodeStream()/decodeFile() returns a null. On Android 1.6, with the GIF files I’ve got, it returns a zero-sized movie with zero duration – clearly not adequate.

The referenced question suggests splitting the GIF into frames (and then rendering these). How exactly do i accomplish that, please?

EDIT: tried opening one of my GIFs with GNU giflib in Windows. It choked on the very first frame. The GIF itself is all right, all browsers (save Android’s) display and animate it fine.

EDIT2: worked with giflib 4.1.4. Not sure what was broken in 4.1.6, but there you go. Next step: build giflib for Android via NDK, somehow integrate with the Bitmap class.

EDIT3: giflib it is. In conjuction with Bitmap.copyPixelsFromBuffer. The colors are all askew right now, but the basic design seems workable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:28:33+00:00Added an answer on May 16, 2026 at 12:28 am

    EDIT: I’ve migrated my project to Google GifFileDecoder, slightly patched. The MovieView class from the legacy solution remained mostly intact, but the GIF parsing logic is in Java.

    Couple points of interest:
    GifFileDecoder does its own looping. If the animation is looped and you do readFrame() until there are no more frames, this loop will be infinite; the decoder has its own wrap-around logic. Also, the buffer that readFrame() returns is being reused over and over, so don’t store the result of readFrame as it is, next time you call readFrame it will be overwritten. Make a deep copy instead. Also, the decoder assumes reading from a file, but can be trivially modified to read from any other stream, sacrificing the looping logic.

    Here’s the 10 year old answer, for old times’ sake:

    giflib 4.1.4 and NDK. You have to manually resolve the palette colors in the GIF to match one of Android’s ARGBxxxx formats, then pass the pixel array to a Bitmap object via copyPixelsFromBuffer(). If you want transparency and/or animation, you have to go through extension blocks and look for the one with code 0xf9.

    Shared my code, along with guidance, here: http://rathertech.blogspot.com/2014/04/splitting-gif-into-frames-on-android.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to play continuous stream using android mediaplayer.but am not able to
I'm trying to play around with an Android Service but the more I play
I'm trying to play with Scala in Android but the Manifest doesn't recognizes my
I'm trying to play a sound file from an iPhone program. Here's the code:
I am trying to play audio in a Java applet but it is not
I am trying to play audio buffered sound (.wav) using AudioTrack. Please see the
I am trying to play audio with the ACTION_VIEW intent, but regardless on what
Im trying to play an song then a person is calling my application. But
I'm trying to play Audio URL (streaming URL) in MPMoviePlayerController. (I'm aware of AVAudioFramework
I am trying to play and audio file using DirectX dll. Audio.FromFile(Message 1.mp3).Play(); But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.