The problem that ViewModel solves

Let me start with the truth – “ViewModel is a choice , not a compulsion” . You can use any architecture that works for you , and probably you have one ( if you don’t then please have one as bloating your UI components is the worst practice ) . …

Leaking memory from ViewModel

In this post we are going to explore some of the problems that can be solved by using LiveData .  A ViewModel must never reference a view, Lifecycle, or any class that may hold a reference to the activity context.  A ViewModel lives longer than an Activity or a Fragment …

Android alert dialog using Kotlin

During the flow of any app we often need to prompt the user to make some decision e.g. Deleting a file , posting comment etc . Below is the most simple way to show a promt . Here we are using AlertDialog to show a single button dialog , we …

Create a list with RecyclerView in Kotlin

Lists are the most common ways of representing collections of similar data . Thus a RecyclerView is a widget that we Android developers have to deal with very frequently . Following are the steps involved in implementing a RecyclerView . In this tutorial we shall implement the recyclerview using Kotlin. …