1. Choose your Lottie

Pick the Lottie for your Android app. You may have your own or you may want to select one from the 1000s of Lottie animations available for free on LottieFiles.

It's important to test your selected Lottie using the LottieFiles app for Android to make sure the animation you've chosen will play the same Android as sometimes not all animations are built with features supported in the Lottie Android player.

Just scan the QR code under the animation on LottieFiles with the app to preview the animation.

2. Setup your project

Getting started with Lottie is very straightforward. This guide assumes that you are using Android Studio as your IDE. If you’re using a different IDE, you can still use the same instructions.

From your project structure panel, select your projects build.gradle file and add the following lines inside your dependencies block:

def lottieVersion = "3.4.0" 
implementation "com.airbnb.android:lottie:$lottieVersion"

Replace lottieVersion with the latest available.

The latest version is:

lottieVersion

Add LottieAnimationView to your layout

The lottie-android library provides a LottieAnimationView which will take care of rendering your animations for you. Add it to your layouts where you want to place your animations.

<com.airbnb.lottie.LottieAnimationView
     android:id="@+id/animationView"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     app:lottie_url="REPLACE_JSON_URL"
     app:lottie_autoPlay="true"
     app:lottie_loop="true"/>

Bundling animations with your app

If you need your animations to work offline, you can bundle your animations with your application by including them in your projects raw resources.

If your project does not have one, create it by going to File>New>Folder>Raw Resources Folder. If your animation contains images, you can bundle them all together in a .zip with your .json and follow the same procedure.

Download the animation, rename it to animation.json or animation.zip depending on your use-case, and place into your raw resources folder.

Update your layout code to use the bundled animation

<com.airbnb.lottie.LottieAnimationView
    android:id="@+id/animationView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:lottie_rawRes="@raw/animation"
    app:lottie_autoPlay="true"
    app:lottie_loop="true"/>

Your first Android project with Lottie animations is ready to go! All that’s left for you to do from here is to configure your project further and customize the animation behaviour. The official documentation for lottie-android provides further information on these configurations.

Get more in your Android apps with our most optimized format - dotLottie

To further optimize Android apps, consider using dotLottie files. dotLottie is an evolution of the Lottie format, created to address some limitations of the original Lottie format. This file format gives developers a more efficient way to implement animations as it uses ZIP tech for compression, which reduces your file size up to 80% more than a standard Lottie. This advanced format compresses multiple animations, assets, and themes into a single .lottie file, drastically reducing file sizes and boosting loading speeds.

Beyond improved performance, dotLottie simplifies asset management, which makes it easier for teams to maintain consistency across platforms. It supports interactive state machines and theme switching without added complexity. Your developers will appreciate the seamless integration and reduced bandwidth needs, ensuring users enjoy high-quality animations with minimal lag.

We also offer developers Lottie Runtimes, as well as independent runtimes and libraries to render Lottie animations. We are compatible with dozens of libraries and runtimes from other major tech companies and platforms which includes Android.

That's how you get started but there's so much more you can do. For more tips on how to use Lottie with your projects, check out our blogs on working with Lottie animations.