How to add a GIF Image in android studio example

Android, Android UI/UX Tutorials, UI UX

In this tutorial we will add a gif image in android studio. You can use this gif simply as an image in your project and play with its attributes as per your requiremnts. You can use this gif image in android splash screen. Use it as a gif ImageView as an example.

To add a gif image in android studio and use it as a gif image on splash screen in android. Follow the steps below and you are good to go.

buildscript {
    repositories {
        google()
        jcenter()
        mavenCentral()
    } dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
}

Add a repository

Add mavenCentral() repository in first build.gradle file of project level. Same as shown in the below code.

Implement Dependency

Add this dependency inside your 2nd build.gradle file of app level inside the dependencies at the bottom of file.

implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'

Sync the Project

Once you added both the dependency and repository in your project. Click on the sync now link at the right top corner. Wait for few seconds until the project synced.

Use GIF file in the design

You can use the gif image in android splash screen by simply following the code mentioned below and play with its attribute as per your own requirements.

<pl.droidsonroids.gif.GifImageView
    android:id="@+id/gifImageView"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:src="@drawable/travel"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />

Q: How to add a gif image in android studio?

To add a GIF image in android studio or use it in Splash screen. You 1st have to add a mavenCentral() repository and then add a dependency in your build.gradle file

Let's Connect

Videos are always a better source for in-depth knowledge. So, connect with me at YouTube.

Download Project

Flutter Login App UI Source Code- How to Create a complete Flutter app - Flutter education app - Flutter app UI Design - Flutter Course - Flutter Complete App 2022
Dashboard Source COde - Dashboard design in flutter - flutter dashoard - flutter app design 2022 - Flutter UI - Flutter homepage

Latest Courses

Flutter Login App UI Source Code- How to Create a complete Flutter app - Flutter education app - Flutter app UI Design - Flutter Course - Flutter Complete App 2022
Learn flutter from scratch in 4 hours - Flutter Crash Course - Coding with T

Latest Tutorials

Flutter Profile page UI Design - Flutter app design 2023 - Profile Screen Flutter UI - Flutter 2023
Flutter Firebase phone authentication - Firebase Phone auth tutorial in flutter - Flutter Firebase phone number authentication 2022
Firebase Authentication in flutter - Flutter firebase authentication 2022 - firebase auth tutorial 2022 - firebase flutter auth
How to setup firebase in flutter 2022 - Flutter firebase setup
Dashboard Source COde - Dashboard design in flutter - flutter dashoard - flutter app design 2022 - Flutter UI - Flutter homepage

Join Our Mailing List

Join our mailing list to receive the latest, Free Courses, Video Tutorials, free codes and updates regarding Tutorials and services. You will also start getting coupons on the related services.

You have Successfully Subscribed!

FLUTTER APP

Learn Flutter App development from scratch. Create LOGIN APP that can be used with any application which requires Login Sign Up functionality.

You can watch it on YouTube or read and get source code from Blog Post.

You have Successfully Subscribed!