Image for post
Image for post

In this article, we are going to discuss the internals of ViewModel which is a part of Android Architecture Components. We will first briefly discuss the usages of ViewModel in Android and then we will go in detail about how ViewModel actually works and how it retains itself on configuration changes.

Originally published at blog.mindorks.com

According to the documentation, the ViewModel class is designed to store and manage UI-related data in a lifecycle conscious way. The ViewModel class allows data to survive configuration changes such as screen rotations.

The ViewModel class also helps in implementing MVVM(Model-View-ViewModel) design pattern which is also the recommended Android app architecture for Android applications by Google. …


Image for post
Image for post

Welcome to the Advanced Room series which covers all the details about Room Persistent Library. In this series, we will start with the basics of Room, then we will learn how to use it. We will learn about the various components of Room in detail and we will also learn how to use Room with LiveData and other third-party libraries like RxJava and Kotlin coroutines. Here is the list of the blogs in this series:


Image for post
Image for post

Note: This article is part of the advanced Room series which covers all the details about the Room persistence library. You can read all the articles here:

Room — Data Access Objects(DAO)

In previous articles, we have covered how we can use Room persistence library to create a relational database very easily. Some of the advantages of using Room are compile-time query verification, no boilerplate code and easy integration with RxJava, LiveData and Kotlin Coroutines. …


Image for post
Image for post

Note: This article is part of the advanced Room series which covers all the details about the Room persistence library. You can read all the articles here:

Entity Relationships in Room

This article covers how we can define relationship between entities in Room persistence library.

Since SQLite is a relational database, entities can have relationships between them. …


Image for post
Image for post

Note: This article is part of the advanced Room series which covers all the details about the Room persistence library. You can read all the articles here:

How Room works internally?

In the previous articles, we discussed how we can use Room library (part of Google’s Jetpack project) to create relational persistence in Android applications. …


Image for post
Image for post

Note: This article is part of the advanced Room series which covers all the details about the Room persistence library. You can read all the articles here:

Room Database Migrations

Database migration is a very important concept in any application development. As we add and change features in your app, we have to update schema of our database. …


Image for post
Image for post

Note: This article is part of the advanced Room series which covers all the details about the Room persistence library. You can read all the articles here:

Room + LiveData

In the previous articles, we have discussed how we can use Room persistence library in our Android applications and how Room internally works. Also, we discussed about the different kind of operations we can do easily with the help of Room. …


Image for post
Image for post

Google has been continuously making changes in every version of Android for a better user experience. Battery(power) optimization is among one of the things which makes the user experience smooth. In earlier versions of Android, Google introduced features like Doze and App Standby modes which saves users’ battery.

Android Pie (Version 9 API level 28) introduced a new feature for better battery(power) management called App Standby Buckets. Each android application is now placed into one of the priority buckets based on the app’s usage patterns like how recently & how frequently the user has used the application. …


Image for post
Image for post
Source : Google Images

The Android platform provides us with many asynchronous techniques to help us run tasks both concurrently and off the UI thread. They help us in implementing a fast and responsive application, but we always have to make choices about which techniques to use. Sometimes its easy to decide — e.g., ThreadPoolExecutor for making multiple HTTP requests with an upper limit, CursorLoader when reading data from a provider-but often we face situations where several mechanisms could solve the problem. In those situations, it’s a natural habit to fallback on a mechanism we know and have used before. …


Image for post
Image for post

In Google I/O 2018, a new publishing format was introduced by Google known as Android App Bundle(.aab). A few out of many benefits of using app bundle are dynamic delivery, automatic multi-APK distribution, smaller APK size and dynamic feature modules.

Note : For more details about App Bundle, you can refer this blog.

What is Dynamic Delivery?

Google Play uses your app bundle to generate and serve optimized APKs for each user’s device configuration, so they download only the code and resources they need to run your app. For example, a user should not get x86 libs if the device architecture is armeabi. …

About

Deepanshu

Android Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store