Recognized by Clutch.co as a top-rated Mobile App Development Company.
folio3-mobile
US 408 365 4638
START YOUR PROJECT
  • Solutions
    • Apps Discovery Services
    • Team Augmentation
    • Enterprise
    • AR/VR
    • IoT
    • Wearables
    • Field Sales
    • On Demand Apps
  • Industries
    • Retail
    • Agriculture
    • Healthcare
    • Pharmaceutical & Life Sciences
    • Manufacturing
    • Automotive
    • Logistics
    • Education
  • Technologies
    • Native Mobile Apps
      • iOS
      • Android
    • Cross Platform Apps
      • React Native
      • Flutter
      • Ionic
      • Xamarin
      • NativeScript
      • Sencha
  • Portfolio
  • Blog
  • Contact Us
Menu
  • Solutions
    • Apps Discovery Services
    • Team Augmentation
    • Enterprise
    • AR/VR
    • IoT
    • Wearables
    • Field Sales
    • On Demand Apps
  • Industries
    • Retail
    • Agriculture
    • Healthcare
    • Pharmaceutical & Life Sciences
    • Manufacturing
    • Automotive
    • Logistics
    • Education
  • Technologies
    • Native Mobile Apps
      • iOS
      • Android
    • Cross Platform Apps
      • React Native
      • Flutter
      • Ionic
      • Xamarin
      • NativeScript
      • Sencha
  • Portfolio
  • Blog
  • Contact Us

Create Cool Animations Using Lottie Android

Published by: Muhammad Haris Bin Abid | November 27, 2020 Jehangir Wahid
SCROLL AND BE AMAZED!
Home > Android App Development > Create Cool Animations Using Lottie Android

Creating beautiful and appealing UX is always challenging in mobile applications. We know pictures can speak a thousand words and then animation is surely level above. Creating beautiful but complex animations have always been a challenge in development. This process of creating complex animations has been extremely simplified by a library named ‘Lottie’. 

‘Lottie’ is a library from Adobe After Effects, which parses animations exported by After Effects as json with Bodymovin and natively renders them on mobile and also on the web. No extra engineering effort is required on the dev side. Lottie library is available on Android, iOS, React Native, Flutter, ReactJS, Web, Xamarin, NativeScript, Windows, Vue etc but in this blog we will stick to android implementation only. Let’s straight dive into the process and see how it works.

1: Find the animation JSON file:
First thing for making beautiful animations is the requirement of a JSON file of animation you need to display. If you are a designer or working with one you can ask him for an Adobe animation JSON file, exported with Bodymovin or if you are working independently you can always go to Lottie website, which is also a marketplace for Lottie animations which have tons of animations(free & paid). Once you’ve found your desired animation, all you need to do is download that .json file and put it into the “res/raw” folder of your project. I am using this animation for demo purposes from lottie website.

2: Adding Lottie Dependency

Add Lottie dependency to your app’s build.gradle file and sync the changes.

Insert the latest version available instead of ‘lottieVersion’

implementation 'com.airbnb.android:lottie:$lottieVersion'

3: Adding LottieAnimationView to your layout file

Just add the LotieAnimationView in your layout XML like any other element.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:app="http://schemas.android.com/apk/res-auto"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   tools:context=".MainActivity">

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

</RelativeLayout>

4: That’s it

You can hit the run button and see this animation.

Developing such stuff with android libraries can be an enormous challenge for developers and can take a few days or even weeks, but Lottie makes it a very easy process. You can also control the animation from java/kotlin which gives you more control. I hope this article has been simple and straightforward enough for you to understand and implement Lottie in your project. Thanks for reading and stay safe !


Avatar
About Muhammad Haris Bin Abid

Newsletter

Search

Archives

  • December 2020
  • November 2020
  • October 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • May 2019
  • Categories

    • Android App Development
    • App Development
    • App Testing
    • Blog
    • Elasticsearch
    • flutter-app-development
    • IOT
    • React Native
    • Staff Augmentation

Recent Posts

  • Startup Incubator – How to Make an App Start on Startup?
  • Jquery Vs. React: Which One Is The Best Option To Create An App For Business?
  • One codebase to rule them all – Sharing code in mobile & web apps using Flutter
  • What is Tree Shaking and Implementation in React
  • Vue VS. React – Crowning the King of Web App Development in 2021

Tags

  • android
  • Automation
  • cross-platform
  • development
  • firebase
  • ios
  • QA
  • react-native
  • Testing
  • Test Script

Newsletter

Newsletter

Post navigation

Previous How to Rename a Project in Android Studio
Next Vue VS. React – Crowning the King of Web App Development in 2021

Leave a Reply Cancel reply

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

Schedule an appointment with our Mobile App Development Expert

Footer Menu
  • Company
    • About Us
    • Portfolio
    • Blog
    • Careers
    • Contact Us
  • Solutions
    • Apps Discovery Services
    • Team Augmentation
    • Enterprise App Development
    • AR/VR Application Development
    • IoT Application Development
    • Wearables Apps Development
    • Field Sales
    • On-Demand Apps Development
  • Technologies
    • iOS
    • Android
    • React Native
    • Flutter
    • Ionic
    • Xamarin
    • NativeScript
    • HTML5
    • Sencha
  • Industries
    • Retail
    • Agriculture
    • Healthcare
    • Pharmaceutical
    • Manufacturing
    • Automotive
    • Logistics
    • Education

US Office

Belmont, California – 1301 Shoreway Road, Suite 160, Belmont, CA 94002

Pleasanton, California – 6701 Koll Center Parkway, #250 Pleasanton, CA 94566

Tel: +1 408 365 4638
Support: +1 (408) 512 1812

Mexico Office

Amado Nervo #2200, Edificio Esfera 1 piso 4, Col. Jardines del Sol, CP. 45050, Zapopan, Jalisco, Mexico

Bulgaria Office

49 Bacho Kiro Street, Sofia, 1000, Bulgaria

Canada Office​

895 Don Mills Road, Two Morneau Shepell Centre, Suite 900, Toronto, Ontario, M3C 1W3, Canada

UK Office

Export House, Cawsey Way, Woking Surrey, GU21 6QX

Tel: +44 (0) 14 8361 6611

UAE Office

Dubai, UAE – Dubai Internet City, 1st Floor, Building Number 12, Premises ED 29, Dubai, UAE

Tel: +971-55-6540154
Tel: +971-04-2505173

Pakistan Office

163 Bangalore Town, Main Shahrah-e-Faisal, Karachi –
75350

705, Business Center, PECHS Block-6, Shahrah-e-Faisal,
Karachi – 75350

First Floor, Blue Mall 8-R, MM Alam Road Gulberg III, Lahore

Tel: +92-21-3432 3721-4 

© 2020, Folio3 Software Inc., All rights reserved.

  • Privacy policy and terms of use
  • Cookie Policy
Follow us on
Facebook-f
Twitter
Linkedin-in

Get a free app audit

Tired of your app not performing up to the mark?

Get a free technology and app strategy review.