How to add Lottie Animation in an Android app Last Updated : 27 Sep, 2025 Comments Improve Suggest changes 5 Likes Like Report This article is about enhancing the User Interface of the mobile application by adding Lottie animation files into our mobile app. The Lottie animations are free to use vector animation files. These animation files can be found at the official site here. Many famous applications use this such as Uber, Netflix, Google, Airbnb, Shopify, etc.Below is an example of Lottie Animation: Dynamic properties of Lottie AnimationsThese can be used to give the app a theme.These can be added in response to any event such as error, success, etc.These can be animated to a single part of the animation in response to any user.Responding to view sizes or other values not known at design time.Advantages of LottieIt supports a larger set of After Effects features.Developers can set the progress to add the animation to a gesture, event, etc.Masks are anti-aliased.Developers have the freedom to change speed and color of a specific part of an animations dynamically.Approach: Step 1: Add this dependency into the App level gradle module of the project and then sync the gradle with the project. This library enables us to use Lottie's animations: Java // Lottie dependency def lottieVersion = "3.4.0" implementation "com.airbnb.android:lottie:$lottieVersion" Step 2: Choose any animation from here and download the JSON file of animation Downloading the JSON animation fileStep 3: Now include the XML code into the layout file where you want to show the animation. Here the file name for JSON file is assumed to be animation. Different methods through which Lottie can take JSON filesA JSON animation: src/main/res/raw A JSON file: src/main/assets A zip file: src/main/assets Below is the XML code: XML <com.airbnb.lottie.LottieAnimationView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/animation_view" app:lottie_rawRes="@raw/animation" app:lottie_autoPlay="true" app:lottie_loop="true"/> Step 4:(optional) Adding controls to animation: Adding custom progress: Here the initial and the final value for progress is customized. Java // Custom animation speed or duration. ValueAnimator animator = ValueAnimator.ofFloat(0f, 1f); animator .addUpdateListener(animation -> { animationView .setProgress( animation .getAnimatedValue()); }); animator.start(); Adding Animation listener: Different listeners can be added with the lottie animations. Java // Declaring the animation view LottieAnimationView animationView = findViewById(R.id.animationView); animationView .addAnimatorUpdateListener( (animation) -> { // Do something. }); animationView .playAnimation(); if (animationView.isAnimating()) { // Do something. } Output: Reference: https://github.com/airbnb/lottie-android Create Quiz How to Add Lottie Animation in Android App? Comment I infoaryan Follow 5 Improve I infoaryan Follow 5 Improve Article Tags : Android Android-Animation Explore BasicsIntroduction to Android Development 5 min read History of Android 15+ min read Best Way to Become Android Developer â A Complete Roadmap 7 min read Android Development Prerequisites [2025] - Things to Learn Before Android Development 8 min read Android App Development Fundamentals for Beginners 6 min read Android Architecture 5 min read Android System Architecture 3 min read Android Boot Process 4 min read Difference between Java and Kotlin in Android with Examples 3 min read Interesting Facts About Android 3 min read Software Setup and ConfigurationDownload and Install JDK on Windows, Mac and Linux 6 min read Guide to Install and Setup IntelliJ IDEA for Android App Development 5 min read Guide to Install and Setup Visual Studio for Android App Development 4 min read How to Run the Android App on a Real Device? 2 min read Resolving frequently occurring errors in Android Development 3 min read Android Studio Tutorial 9 min read File Structure & ComponentsComponents of an Android Application 3 min read Introduction to Activities in Android 6 min read Services in Android with Example 10 min read Core TopicsHow Does Android App Work? 7 min read Activity Lifecycle in Android with Demo App 9 min read Introduction to Gradle 4 min read What is Context in Android? 9 min read Bundle in Android with Example 6 min read Activity State Changes In Android with Example 6 min read Processes and Application Lifecycle in Android 7 min read Desugaring in Android 4 min read Difference Between AndroidX and Android Support Libraries 3 min read Memory Leaks in Android 7 min read Layout & ViewLayouts in Android UI Design 3 min read Android UI Layouts 5 min read LinearLayout and its Important Attributes with Examples in Android 3 min read Android LinearLayout in Kotlin 2 min read Android RelativeLayout in Kotlin 4 min read ConstraintLayout in Android 6 min read TextView widget in Android with Examples 5 min read TextView in Kotlin 3 min read Working With the TextView in Android 7 min read Autosizing TextView in Android 6 min read ButtonButton in Android 3 min read How to Add Radio Buttons in an Android Application? 5 min read RadioButton in Kotlin 4 min read How to add Toggle Button in an Android Application 3 min read ToggleButton in Kotlin 2 min read RadioGroup in Kotlin 3 min read Intent and Intent FiltersWhat is Intent in Android? 4 min read Implicit and Explicit Intents in Android with Examples 6 min read How to Send Data From One Activity to Second Activity in Android? 7 min read How to open dialer in Android through Intent? 3 min read Creating Multiple Screen Applications in Android 6 min read How to Open Camera Through Intent and Display Captured Image in Android? 6 min read Toast & RecyclerViewToasts for Android Studio 2 min read What is Toast and How to Use it in Android with Examples? 6 min read Android Toast in Kotlin 3 min read How to Change Toast font in Android? 3 min read How to add a custom styled Toast in Android 4 min read RecyclerView in Android with Example 7 min read Android | Horizontal RecyclerView with Examples 4 min read How to create a nested RecyclerView in Android 5 min read How to Create RecyclerView with Multiple ViewType in Android? 6 min read RecyclerView using ListView in Android With Example 5 min read Fragments & AdaptersIntroduction to Fragments | Android 5 min read Fragment Lifecycle in Android 8 min read How to Create a New Fragment in Android Studio? 2 min read How to Create Swipe Navigation in Android? 6 min read ViewPager Using Fragments in Android with Example 6 min read ArrayAdapter in Android with Example 3 min read SimpleAdapter in Android with Example 7 min read SimpleExpandableListAdapter in Android with Example 10 min read AdapterViewFlipper in Android with Example 5 min read BaseExpandableListAdapter in Android with Example 10 min read Like