Originally published at https://www.chaddha.me/kotlin-coroutines-fundamentals on Dec 23, 2020.

The article covers why we need coroutines, it’s fundamental blocks in theory, and then shows them in action (code) to explain the blocks clearly.

Kotlin introduced Coroutines for asynchronous programming and more. This article covers why we need Kotlin Coroutines, it’s fundamental building blocks in theory, and then shows them in action (code) to explain the blocks clearly.

The code shown is available on Github as well.

Table of content

  1. Basic keywords and building blocks 2.1 Dispatcher 2.2 Coroutine job 2.3 Coroutine start 2.4 Coroutine context 2.5 Coroutine scope 2.6…


This is a guide for wireless adb debugging flow without needing to connect your device to your PC all the time. I’ve included steps and information to help non-android engineers (e.g. backend engineers, data analysts) setup adb for easier development.

This post was originally published at https://www.chaddha.me/wirless-adb

Beginner section

In case you are a seasoned android engineer, jump past the beginner section to “Connect to a device over Wifi”.

In case you are not an android engineer, you most likely don’t have the tools installed or correct settings on your device. Let’s setup them first.

What is adb?

Android Debug Bridge (adb) is a versatile…


Originally published at https://www.chaddha.me/practical-concept-coroutines-2/ on Dec 26, 2020.

This article covers the practical concepts for using coroutines in actual projects, different use-cases that arise, while showing the code in action to explain the concepts clearly.

If you are looking for some concepts not covered here — check the first part. If you are not comfortable with coroutine basics, I’ll suggest to read through one of my previous post where I covered the fundamentals of coroutines.

Table of content

  1. Custom coroutine scope
  2. Supervisor job and scope
  3. Exception handling
    4.1 1st Behaviour
    4.2 2nd Behaviour
    4.3 Notable points
  4. Structured concurrency 5.1…


Originally published at https://www.chaddha.me/practical-concept-coroutines-1/ on Dec 26, 2020.

This article covers the practical concepts for using coroutines in actual projects, different use-cases that arise, while showing the code in action to explain the concepts clearly.

This article covers the practical concepts for using coroutines in actual projects, different use-cases that arise, whie showing the code in action to explain the concepts clearly.

If you are not comfortable with coroutine basics, I’ll suggest to read through one of my previous post where I covered the fundamentals of coroutines.

Table of content

  1. Coroutine cancellation 2.1 Parent job is cancelled 2.2…


Photo by Pascal Debrunner on Unsplash

This was originally published at my personal blog.

There are plenty of guides around about using Dagger for Dependency Injection on Android. They explain what it is, why it is needed, but miss on explaining how to practically do it. Practically using dagger had eluded me for a long time.

Recently I had my aha moment on how I can use it practically. This success owes a lot to this article by Gabor Varadi.

This article will cover how to use dagger 2 in a simple situation. …


This post is meant for people looking to start android development, and also for people who have covered the basics and now are looking to improve themselves. I would be providing resources I came across while learning android development.

Getting started with android development

I think that one should learn a a bit of Java language before going into android development. You can take a course on Udacity, or watch Youtube videos or a book. I learned it from two sources: TheNewBoston Youtube video playlist of “Java (Beginner) Programming Tutorials” (Tip: Don’t install Eclipse. …


In this post, we will focus on the Loader API. If you do not know about MVP pattern, I’ll suggest you to read the Part 1 before this.

Example project for this post is at this link. The master branch explores both MVP and Loader API while the other only-mvp branch only explores MVP as explained in Part 1.

Loader API and the rotation problem The rotation problem is that we fetched some data by a costly operation like a network call or a complex query with transformation from a database. Then the user rotated the phone and we don’t…


This post will be split into two parts. The first part explains the need, the job of each component of MVP and then the actual code to make your project organized in Model-View-Presenter(MVP) pattern. While the second part will focus on Loader API, on how to use it to save your presenters during rotation.

The example project for this post is at this link.

The only-mvp branch of the example project deals with MVP only. The master branch shows an example of MVP and Loader API. We will cover the master branch in the second post.

Let’s understand the need for MVP.

We all started with…


The first thing that came to my mind when I first heard about Functional Reactive Programming (FRP) and RxJava was why?! Why switch from my comfortable Imperative programming and AsyncTask world? The answer was not clear at that time but after recent experiences I felt the need for it. In this part I will try to convince you, honestly myself as well a little bit, to learn RxJava and then we will discuss what it is we are trying to achieve using RxJava (Psst… Hint, it is a paradigm). …

Gaurav Chaddha

Software Engineer @Zomato. Passionate about tech, music, movies, gaming, coffee and food! Find my writing at https://www.chaddha.me/

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