You read 20 articles, watched 6 videos, asked your colleagues about it, and somehow you still can’t understand how Coroutines work. You’re probably thinking it’s impossible to learn Coroutines. I felt the same before I started writing this article.

I spent the last few days learning as much as I could about Coroutines and I’ll distill all that in this 3 part series. It’ll answer questions such as “What’s the difference between a CoroutineScope and a CoroutineContext”, “Do I need to switch the dispatcher?”, “What is Structured Concurrency?”, “How to handle cancellation?”, etc…

I won’t go into detail on how…


Animations rarely change the core functionally of an app but you can’t deny they make a big difference for the user. When an app has great animations everything looks more fluid, it’s easier to understand how things fit together.

Transitions are used when you’re moving from one screen to another and you want to apply animations to one or multiple elements. In this article I’ll show you how to implement them in your app.

We’ll start with an app that has no animations and add the needed ones to improve it.

Without transitions / With transitions
Without transitions / With transitions
Without transitions / With transitions

Preparation

Before we start, make sure you’re not using the…


Today we’re gonna learn how to show a full screen activity instead of a notification when the device is locked.

By default Android will show the same notification it shows when the device is unlocked but in some cases, such as a phone call, you might want to display a full screen activity.

You can find the source code here.

Phone screen
Phone screen
Phone screen

Creating The Notification

Let’s start by creating a simple notification that’ll be used later to show an Activity on the look screen.

The first thing we need to do before creating the notification is creating the channel to display it.

First…


REST is simple and easy to get started. There’re hundreds of tutorials, a search on Medium would give you tons of results, and most developers are using it. When I started reading about gRPC things were not the same. Most of us are using it for the first time, there’re tutorials but you need to look through many until you find the answer you’re looking for, the community is growing but it’s not mature yet, etc.

This article walks you through the most important concepts you need to know to understand gRPC. …


Kotlin has many amazing features but one that stands out is extensions. Extensions are used to add functionality to existing classes. They are extremely useful at helping to reduce boilerplate code. The good thing is that you can add them to any class, including the ones from third-party libraries that you can’t modify. Most of the time we see Extension functions but Kotlin also supports Extension properties.

Useful Extension Functions

Let's start with some extensions that make the code easier to read, the ones that improve the code quality over time by reducing boilerplate code.

Context

The Android API changes over time and something…


These are my personal notes on the topic. Most of the content here is not mine. All sources can be found at the end of the article.

Activities are a main part of Android. Lifecycle methods is the way Android notifies state changes to the Activity. To provide a great user experience, you should know how to manage them.

If you haven’t read my article about Activity Lifecycles, you can read it here.

Lets take a look at some common scenarios using a single Activity

1. App is finished or restarted

This scenario happens when there’s only one activity in the back stack and:

  • The user…

The Activity class is an essential part of every Android app. Unlike traditional programming paradigms, the Android framework starts code in an Activity instance by invoking callback methods that correspond to specific stages of its lifecycle.

The activity state changes when the user rotates the phone, responds to a notification, or switches to another app. When these state changes happen, Android uses lifecycle callback methods to notify the activity about them.

A simplified illustration of the activity lifecycle
A simplified illustration of the activity lifecycle

onCreate()

This is the first callback called by the system. The activity is now on CREATED state.

You should perform basic application startup logic that should happen only once for…

Victor Brandalise

Learning, Unlearning and Relearning

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