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 6877457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:36:10+00:00 2026-05-27T04:36:10+00:00

Can we use Gif image in android anywhere? I’ve used one example for this

  • 0

Can we use Gif image in android anywhere? I’ve used one example for this type of image. It shows like immovable only.

How can we use as Gif(movable) image? Is this possible in Android?

Anyone guide me?

  • 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-27T04:36:11+00:00Added an answer on May 27, 2026 at 4:36 am

    I played gif image like this…

    public class GIFDemo extends Activity {
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(new GIFView(this));
        }
        private static class GIFView extends View{
    
            Movie movie,movie1;
            InputStream is=null,is1=null;
            long moviestart;
            long moviestart1;
            public GIFView(Context context) {
                super(context);
                is=context.getResources().openRawResource(R.drawable.cartoon);
                is1=context.getResources().openRawResource(R.drawable.animated_gif);
                movie=Movie.decodeStream(is);
                movie1=Movie.decodeStream(is1);
                //BitmapFactory.Options opts = new BitmapFactory.Options();
                //opts.inJustDecodeBounds = true;    // this will request the bm
               // opts.inSampleSize = 10;   
                //movie=Movie.decodeFile("C:\\cartoon.gif");
            }
    
            @Override
            protected void onDraw(Canvas canvas) {
                canvas.drawColor(0xFFCCCCCC);
                super.onDraw(canvas);
                long now=android.os.SystemClock.uptimeMillis();
                System.out.println("now="+now);
                 if (moviestart == 0) {   // first time
                     moviestart = now;
    
                 }
                 if(moviestart1==0)
                 {
                     moviestart1=now;
                 }
                 System.out.println("\tmoviestart="+moviestart);
                 int relTime = (int)((now - moviestart) % movie.duration()) ;
                 int relTime1=(int)((now - moviestart1)% movie1.duration());
                 System.out.println("time="+relTime+"\treltime="+movie.duration());
                 movie.setTime(relTime);
                 movie1.setTime(relTime1);
                 movie.draw(canvas,10,10);
                 movie1.draw(canvas,10,100);
                 this.invalidate();
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can we use a gif image as a background? i want to set an
I would like to use a GIF image as a loading animation on my
I have a CSS like this ul { list-style-image:url(images/bulletArrow.gif); } ul li { background:
Android supports three image formats with this rating: PNG (preferred), JPG (acceptable) and GIF
If I have an image - say 20*20 pixels I can use this line
Is there a .NET library I can use to programmatically generate my own GIF
When putting a favicon on your site, you can apparently use an animated gif,
You can use more than one css class in an HTML tag in current
Has anyone ran into this issue? We have a mobile site that can't use
I was trying to convert a GIF image (Ajax waiting like): to AVI that

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.