A Brief Story About Animations in Android

Victor Oliveira
Level Up Coding
Published in
5 min readJul 25, 2023

--

Photo by Vitor Paladini on Unsplash. Android adaption by the author.

In the prehistoric era, cave paintings served as a powerful form of communication, documenting various aspects of daily life, including hunting scenes and spiritual beliefs. These visual depictions not only conveyed information but also offered valuable insights into the cultural, artistic, and historical dimensions of ancient civilizations. Their enduring legacy continues to captivate and inspire us today, despite their static nature. On the other hand, whether overall talking about modern society or specifically speaking of mobile applications, the use of motion is employed to enhance visual elements and achieve more effective communication. The goal of this article then is to tell a brief story about the evolution of animations in Android.

Role

Animations are a crucial part of mobile applications, offering numerous benefits that improve the User Experience (UX). Well-designed animations can create memorable moments for users. They draw attention, provide cues, and offer feedback, ultimately enhancing engagement and making interactions feel more intuitive and enjoyable.

Android 1.0

Since its initial commercial release on September 23, 2008, the Android API has featured the ImageView widget for showcasing images. However, in its initial version, showing short animated images natively or in Graphics Interchange Format (GIF) proved to be a very challenging task. At that time, Android development was not as well-established, and many of the libraries commonly used for this purpose today did not yet exist.

Searching for Android & GIF keywords on Stack Overflow, the oldest question related to Android animation dates back to May 1, 2009:

It’s fascinating to observe the progression of solutions. In that same year, a developer introduced a slightly complex solution for downloading, buffering and animating GIFs using Canvas. Two years later, another developer reminded them about AnimationDrawable, which also had been available since Android 1.0. It took several more years before someone finally highlighted Glide as an out-of-the-box alternative to fulfill the mentioned requirement.

Android 2.2

At that time, Android had limited built-in capabilities for handling animations. As for the web platform, animated GIFs were not supported in the Android browser until the release of Android 2.2, known as Froyo, on May 20, 2010. The reason for this delay remains uncertain, whether it was due to a bug or a missing feature. Users had already noticed the absence of proper GIF support in Android’s browser as early as 2009, but it wasn’t until Froyo’s release in 2010 that users began to acknowledge the functionality. Afterward, some manufacturers still encountered issues with GIF playback, even in Froyo, indicating ongoing challenges to achieve consistent behavior across different devices.

Glide

While there are numerous libraries available for loading visual content in Android, Glide stands out as one of the pioneers with built-in support for animated GIFs. It made its initial debut on August 27, 2013, with a stable release. However, seems it wasn’t until version 3.3.0, nearly a year later, that the first explicit mention of the GIF format indicated a support introduction. The developers’ enthusiasm for the GIF playback feature was evident, resulting in several improvements in the subsequent version of Glide.

Lottie

The engineering team at Airbnb has made a significant improvement in how animations are presented on Android. Lottie, a JSON-based file format, allows easy delivery of cross-platform animations that can be scaled without losing quality.

Lottie examples taken from the Introducing Lottie article

Since its release on February 1, 2017, Lottie has successfully addressed a crucial need in the market. It strikes a balance between utilizing high-quality cross-platform graphics and managing the associated costs of storage, transportation, and rendering. Today, Lottie is probably one of the most significant libraries for visual communication in Android applications.

Motion Layout

MotionLayout was initially introduced at Google’s I/O 2018 but was officially released as a stable version two years later on August 21, 2020. It serves as a significant extension of ConstraintLayout, specifically designed to apply motion and animate widgets. By enabling the movement and resizing of UI elements, MotionLayout provided the Android OS with a valuable capability to enhance UX.

While creating animations with MotionLayout does require some coding effort, it has successfully addressed another gap in the market. It serves as a viable alternative for apps with strict size restrictions, as it doesn’t rely on any third-party Software Development Kit (SDK).

Rive

Rive is a highly promising technology that aims to compete with Lottie. The company, founded by twin brothers Guido & Luigi Rosso, has been around since 2016, even though the first Android release was only introduced on April 29, 2021. As of July 2023, Rive has not gained significant adoption within the Android community and remains relatively unknown.

As stated on Rive’s blog, they have provided a performance comparison against Lottie to showcase the disruptive nature of their technology:

Lottie vs. Rive performance comparison.

Since its early versions, Rive for Android has supported traditional development based on XML layouts. However, only on June 6, 2022, an issue was raised regarding proper support for Jetpack Compose. It took until September 5, 2022, for Rive to catch the attention of a Developer Relations Engineer focused on Compose, who offered support to explore the possibility of a compatible declarative UI on Rive’s SDK.

Nearly a year later, on April 13, 2023, a small example demonstrating the integration of Rive with Jetpack Compose was added to their repository. In an effort to contribute and facilitate adoption, here’s a brief step-by-step guide on how to incorporate Rive for declarative UI in Android.

Rive Animation — Oni: Thunder God’s Tale Fan Art by Michael B. Myers Jr. on Dribbble

From the early days with static images to the advent of GIFs and the emergence of libraries like Glide and Lottie, animations have become a crucial part of enhancing user experience in modern mobile applications. The introduction of Motion Layout has further expanded the possibilities of creating dynamic and engaging UI elements.

While each technology has its unique strengths, Rive, as a relatively new player in the field, seeks to disrupt the market. Although it shows promise, Rive is still in the process of gaining recognition within the Android community. As an Android developer, it has been and will continue to be, wonderful to witness the evolution of animations in this ecosystem.

And you? How much do you enjoy animations? Tell me more about your perspectives in the comments. Thank you for reading until the end. Stay tuned for upcoming articles! =}

--

--