How to display an animated GIF?

0 votes

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?

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.

Oct 8, 2018 in Java by Sushmita
• 6,880 points
47 views

1 answer to this question.

0 votes
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 ApidDemos in BitmapDecode example with some animated flag.
answered Oct 8, 2018 by sharth
• 3,370 points

Related Questions In Java

0 votes
2 answers

How to convert an array to arraylist?

In Java 9 you can use: List<String> list= List.of("Hello", "World", ...READ MORE

answered Aug 1, 2018 in Java by samarth295
• 2,190 points
61 views
0 votes
2 answers

How to test that an array contains a certain value?

public static final String[] VALUES = new ...READ MORE

answered Jul 17, 2018 in Java by Sushmita
• 6,880 points
74 views
0 votes
2 answers

How do I read and convert an InputStream object to string type?

You can also use Java Standard Library ...READ MORE

answered Jul 17, 2018 in Java by Sushmita
• 6,880 points
5,527 views
0 votes
3 answers

How to sort an array in java?

import java.util.Arrays; public class Sort { ...READ MORE

answered Aug 24, 2018 in Java by parth295
• 4,640 points
94 views
0 votes
1 answer

How can we get the current location in Android?

First you need to define a LocationListener to handle ...READ MORE

answered Sep 25, 2018 in Java by parth295
• 4,640 points
80 views
0 votes
1 answer

Can't find class CognitoUserPoolsSignInProvider: Issue with Sign In integration

CognitoUserPoolsSignInProvider is ditributed as part of aws-android-sdk-auth-userpools library. Please import ...READ MORE

answered Sep 28, 2018 in AWS by Priyaj
• 57,490 points
81 views
0 votes
1 answer

How to Read/Write String from a File in Android

Writing a File in android: private void writeToFile(String ...READ MORE

answered Oct 3, 2018 in Java by sharth
• 3,370 points
1,051 views
0 votes
1 answer

How to count the number of occurrences of an element in a List?

We can use the static frequency() method. int ...READ MORE

answered Aug 21, 2018 in Java by sharth
• 3,370 points
70 views
0 votes
2 answers

How can I convert a String variable to a primitive int in Java

 Here are two ways illustrating this: Integer x ...READ MORE

answered Aug 20, 2019 in Java by Sirajul
• 45,510 points
250 views