Improving UX with Android LiveData Architecture Component

Aishwary Dhare
Zuka Technology Blog
3 min readAug 21, 2020

Google launched Android Architecture Components in 2017, a collection of libraries that help you design robust, testable, and maintainable apps. Now widely adopted.

Coding benefits aside, these components can also be seen from a UX point of view.

This article will not go into detail of coding benefits and implementation (I will add links to recommended articles intended for that).
Focus will be on the UX strategies around these architecture components.

LiveData

LiveData architecture component provides an easy to implement way to refresh UI when data gets updated.

1. Design for Feedback

By Ivan Bjelajac

On pressing Add To Cart, user’s focus instantly moves to the shopping cart icon. As it instantly changes its state from empty to filled (& UX bonus with cute little animation of cart filling up)
LiveData saves from the stale empty cart or the awkward pull-to-refresh to change the icon.

These little-big-details can do wonders – “The details are not the details; they make the product”.

Check here implementation comparison between LiveData and traditionally used RxJava and EventBus

2. Design for Real-time

Source

Want to show a real-time data streaming from a Fitness Band, or a remote database like RTDB?

Traditional approach would be to continuously listen for incoming feeds in a background service — then 1️⃣ store incoming feed in the in-app database, then 2️⃣ fire events notify presentation layers, then 3️⃣ listen to the events, then 4️⃣ update UI with new database changes.

LiveData approach would be 1️⃣ store the feeds in database, and be ✔︎ done with it. LiveData will automatically listen to the database updates, and will make associated UI changes with it.

For implementation here is a brief version and a long version

3. Design for assuring progress

Source

Follow the 4-Second Rule, and use determinate progress bars for any processes that take longer than 4 seconds to load.

Users are more willing to tolerate a long wait time if they see a determinate progress bar. Learn more here

Your background worker needs an interface to report back its progress, and an instance of MutableLiveData will provide a concise and easy implementation.

Drop a comment if you need any help or sample code for implementing above mentioned UX benefits using LiveData.

I am one of the co-founders of Zuka Technologies — A Software Development Company, based out of Pune, India. You can follow our Medium Blog to find more articles on Android, iOS, Backend Technologies, Cloud Infra, DevOps, Blockchain and AI/ML, based on our experience from the numerous projects we developed over the years.

--

--

Aishwary Dhare
Zuka Technology Blog

Passionately coding for 10 years | Director of Engineering at MishiPay