Best of MVVM and MVI architecture patterns merged into one, for a perfect architecture for any Android project.

Image for post
Image for post
Photo by Tim Mossholder on Unsplash

TL;DR
If you are already aware of basic principles of architecture patterns and MVVM and MVI patterns in detail then skip the basics and jump to MVI + LiveData + ViewModel (or second) section of the article.

Content

  1. Best Architecture For Android : MVI + LiveData + ViewModel = ❤️ [This]
  2. Part 2: Communication Between Activity & Fragments/CustomViews via ViewModel [Coming soon]
  3. Part 3: Easy, Reviewable Steps For Java to Kotlin Migration [Coming soon]

Preface

There are so many architecture patterns available, each has some pros and cons. All those patterns try to achieve the same basic principles of architecture:

1. Separation…


I found the least known way to test robo scripts locally. Using this, we can be assured that the robo scripts that we have recorded & uploaded for the Google Play Store Pre-launch Report or Firebase Test Lab will work, most probably.

Image for post
Image for post
Monkey/Robo Test (Source: https://www.freeimages.com)

I am sure, most Android developers are aware of Firebase Test Lab and Google Play Console Pre-launch Report. These are really useful tools. Today, I am not gonna explain why, when and how to use those tools. But, I am gonna tell you, how can we get the most out of those tools with minimum efforts. So, before we begin with our topic, let me take everyone on the same page.

Robo Test (similar to Monkey Test) is a test performed by a robo on the target app which usually performs random actions by clicking random UI elements. But, that…


We will see, how can we add the latest stable version of Coroutines to Android project.

This article is a part of “Android Kotlin Coroutines: Basic Terminologies & Usage” article.

Updated (30 Oct 2018) for stable Kotlin plugin v1.3.
Note: Now onward, this post will not be updated unless required. So, it would be better if you add required dependencies from the official doc: https://github.com/Kotlin/kotlinx.coroutines

Here we are going see the steps involved in adding the stable version of Coroutines included in Kotlin v1.3.

Android Studio:
Step 1.
Go to Tools → Kotlin → Configure Kotlin Plugin Updates, select “Stable” in the Update channel drop-down list, and then click Check for updates.

Step 2. Add following…


Image for post
Image for post
Modified (Original Photo by Nick Dietrich on Unsplash)

The common terms used in Coroutines. Knowing these terms in advance will ease your learning process.

This article is a brief summary of official Kotlin doc and a few other resources that I have gone through over time during my learning. This is my attempt to simplify common terms used in the context of coroutines and give you the taste of the power, coroutine gives you which would inspire you to jump in the world of coroutines as asynchronous or non-blocking programming is a new reality.

Developing Apps using Kotlin is really fun. Code less, perform better suits very well for Kotlin. And with coroutines, it becomes sweeter. Coroutines are now stable and can be used…


How MVP works and its simple example showing implementation in Kotlin

TL;DR
Practically it is not feasible to summaries the MVP pattern here in few lines. But I can assure you that every single line of the following article worth your time. I bet it will give you enough understanding that you can implement it on your own. And still, if you are in a hurry I would suggest jumping at “How does MVP works?” section. Source code of the example.

Whenever any Android developer starts thinking of improving technical skills, the first thing that comes to his or her mind is the Architecture of the App. …


A lighter way to get that thing done smoothly.

Image for post
Image for post
Photo by Émile Perron on Unsplash

Update 1: Included lambda functions as an alternative.
Update 2: Included a link to Implementation example App on GitHub.

TL;DR
Instead of creating a custom ItemClickListener interface to getAdapterPosition() inside your Activity/Fragment/View and end up creating multiple Anonymous Classes under the hood for each item. Better pass the RecyclerView.ViewHolder using view.setTag() inside your ViewHolder and then getAdapterPosition() (…and many other things) from view.getTag() i.e. ViewHolder’s object inside your Activity/Fragment/View.
Implementation example App on GitHub

The Most Popular Way; The Problem

I know you must have already found a way to get onItemClickListener() for your RecyclerView Adapter. But sometimes the way we think is not always the…


Image for post
Image for post
Photo by Anthony Tran on Unsplash

Things they never tell anyone else.

Updated title of the article from “Introverts Decoded: Why am I still single?”

LOVE, love is a romantic yet a scary word for many introverts. For introverts, it is not easy to fall in love. Love takes away so many things from them, more importantly, solitude. In the first article of Introverts Decoded, we have seen how different they are from many others. We have seen they are loving and caring by heart.
Then, why are they still single? Why are they scared of falling in love? How could not everyone see their inner beauty? …


Image for post
Image for post
Replace default dialog with Custom Screen

Get convenient ways to handle uncaught exceptions for developers and testers.

TL;DR
UCE-Handler, an Android library helps you (developers, testers or users) to share the details of the uncaught-crash while you were using/testing the app during its development. The generated crash-log contains device info, OS info, exception-cause and track of all activities so the developers can work on it effectively. You can copy, share, view, email, and even save that crash-log to a file with just a click.

(Note: If you are in hurry, you can skip this big paragraph.) It’s a beautiful day, Monday, you really enjoyed last the weekend. Now you are ready to start your week with a…


I’ll explain the basic working of the ViewHolder and how to use it to get the expandable item layout in a simple way.

Image for post
Image for post
Dynamic Expandable RecyclerView

TL;DR
The basic idea is to calculate the maximum number of child items present in our collection and create views for it in onCreateViewHolder() function. Later on get the actual count of child items present at the current position and handle the visibility of all extra child views if there are any, in onBindViewHolder() function.

In the world of Android Apps, we like to take care of our users. We always try to get what our users want. Designing a clutter-free App is a part of it. So we do try to show as minimum and important data as possible…


Create Personal Archive of Your Favorite Bookmarks and Links (URLs) On-The-Go.

Image for post
Image for post

Update/Note: This app was published with the name Save Me -Pocket Lite which is changed to Linkaive later on.

Linkaive is an Android App designed for Readers, Quorans and all Internet Users who like to save and backup Links/URLs on the go.

While surfing the internet we came across so many links, and references that we feel like it will be useful in future. So what we used to do, we bookmark all those links in our browser, but now, all those links are limited to that particular browser. Some of us must have used the ‘Pocket’ App for this…

Rohit Surwase

Techie by Birth. Writer by Hobby. Observer by Nature. Unpredictable by Character. Android Developer (Google Certified) by Profession.

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