Android Lottie load Json Adobe After Effect Animation Tutorial

Airbnb has released a new library “Lottie” to render an animation by loading the JSON file or load from the network. However, there have several ways to create and render the animation in android. In the old post, I had written on how to adding animation in your project if you looking for another approach. Lottie available to use for Android and iOS that parses Adobe After Effects animations exported as JSON with Bodymovin and renders them natively on mobile. You need to design an animation by using Adobe After Effects in order to add the animation effect to your Android project. There have many open source Adobe After Effect files for Lottie available to download and this is the link. In this tutorial, I will tell you on how to use Android Lottie load JSON Adobe After Effect Animation in your local project.

Creating a New Project

1. Open Android Studio IDE in your computer.
2. Create a new project and Edit the Application name to “LottieAnimationExample”.
(Optional) You can edit the company domain or select the suitable location for current project tutorial. Then click next button to proceed.
3. Select Minimum SDK (API 15:Android 4.0.3 (IceCreamSandwich). I choose the API 15 because many android devices currently are support more than API 15. Click Next button.
4. Choose “Empty Activity” and Click Next button
5. Lastly, press finish button.

Add lottie library in gradle

Open build.gradle  (module:app) and add lottie library in your dependency section. After that click sync.

Add a new assets folder

Right click the app module > new > Folder > Assets Folder. After that add your Adobe After Effects JSON file in this assets folder. You can download from the following link.

Edit activity_main.xml layout

After that, open your activity_main layout and add lottie animation view. This view will load a JSON file called “load_space.json” from your assets folder. Make sure the name is correct.

Edit class

Go to mainactivity class and edit it to the below sample source code. You can customize the speed and color of your animation.

Run Your Project

Finally, you can run your project and test out the Lottie animation.

(Android Lottie load Json Adobe After Effect Animation)

Source Code

(Visited 1,923 times, 1 visits today)

Yong Loon Ng

Ng Yong Loon, better known as Kristofer is a software engineer and computer scientist who doubles up as an entrepreneur.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *