Sign in

Kennay Kermani

Implement automated release signing without uploading your KeyStore file to your repository

Photo by Mati Mango from Pexels

Releasing an app to an app store like the Google Play Store is a common task that Android developers have to go through.

Because you need to verify that you are the owner of the respective app, you need to digitally sign your APK (Android application package) or AAB (Android App Bundle) before being able to upload it.

To be able to sign your application, you need to generate a .jks (Java KeyStore) file that contains your certificate.

If you are working alone on your app, you can easily use the Android Studio’s built-in Generate Signed Bundle/APK function.

However, if…


Merge multiple LiveData sources into one

Photo by Giallo fromPexels

The LiveData component is part of Android Jetpack and is nowadays widely used for implementing the Observer pattern while automatically considering the Lifecycle of the respective Android app.

It is mostly used for updating the UI with a new state of the respective ViewModel. By using this component we can switch from a pull to a push behavior when we need to inform our UI about state changes.

Sometimes you don’t only want to get informed about one single item but multiple ones.

Especially when it comes to multiple asynchronous LiveData streams that are required at the same time to…


How to pass arguments to previous destinations while navigating backward through your Android app

Photo by Glenn Carstens-Peters on Unsplash

In most cases, Android apps consist of multiple screens that are interconnected with each other. One screen can be accessed via interaction with another.

In earlier stages of Android development, one would rely on manually pushing and popping fragments via FragmentTransaction.

With the introduction of the Navigation component library, which got released within the context of Android Jetpack, manual handling of these transitions is now a thing of the past.

The first Navigation component library stable release is available since 2019. It drastically facilitates consistent behavior for navigation within your Android app. …


Save unnecessary code for loading data with bundle arguments.

Photo by Francesco Ungaro from Pexels

The Kotlin viewModels delegate lets us initialize our ViewModel in our Android app’s activities or fragments with no effort.

However, the drawback of this function is that we are limited to the initialization of our respective ViewModel without the ability to use any initial parameters via a constructor.

The problem

Because in many cases we have parameters that get passed by a previous screen via Navigation Component’s safe args or on the standard way via the arguments or intent bundle, we often need these parameters in our ViewModel.

If we show a list on our screen that depends on the respective parameters…


Handle app wide events easily without unnecessary coupling

Photo by Karol D from Pexels

The Event Bus design pattern is a well-known practice that has been widely used in many Android apps in the past to achieve an event-driven architecture.

With the slow replacement of Java by Kotlin over the recent years, this approach was almost forgotten. Kotlin itself and also other popular frameworks nowadays offer various options for implementing a publisher/subscriber architecture, such as Kotlin Flow, RxJava, or LiveData.

Because of that, the Event Bus approach has almost been forgotten, even if there were possibilities to reimplement this pattern. …


How to easily change and order your function or method parameters

Photo by Markus Spiske from Pexels

This article will be the second post in my new series about refactoring tips for Android Studio and IntelliJ IDEA.

In my last article, I talked about the “Find and Replace” feature which lets you easily change specific keywords across your whole project or scoped to explicit sections of your codebase.

This succeeding post will be covering another feature that astonishingly facilitates the refactoring of your code.

We will be talking about the “Change Signature”. As the name already implies, this feature allows you to easily refactor function signatures.

Change Signature

The “Change Signature” refactoring function can be found in the refactoring…


A brief introduction to the new wrapper class

Photo from Pixabay by Pexels

Kotlin Inline Classes are a subset of the Kotlin Value classes. An inline class can be used as a wrapper around some other type, described on a very high level.

Within this article, we take a detailed look at the new syntax for inline classes, introduced with Kotlin 1.5, and how to use the feature in practice.

Wrapper Classes

If you come from Java, a very good example for understanding the basic principle is to look at the wrapper classes for primitive types. Let’s take a look at the class Boolean, that wraps the primitive type boolean.

In contradiction to its companion…


How to easily find and replace keywords in your AndroidStudio or IntelliJ IDEA project

Photo by Maurício Mascaro on Pexels

This article will be the start of a new series of mine. Within this series, I will cover some quick and simple tricks that will help you to refactor and maintain your Android app.

I would like to start by talking about Android Studio’s Find and Replace feature. Since Android Studio is built on top of IntelliJ IDEA, this tip applies to IntelliJ as well, of course.

However, for the sake of simplicity, I will refer to Android Studio for the rest of the article.

Replace in Path

As you probably know, Android Studio provides a very good search tool “Find in Path”


A deep dive into the Constraint Layout helper components

Photo by Pawel Czerwinski on Unsplash

The ConstraintLayout is one of the most dynamic and powerful available Android ViewGroup components. Besides its variety of possibilities, it allows us to implement a flat view hierarchy, leading to improved performances when it comes to layout inflation compared to deeply nested layouts.

When it comes to the alignment of different components, the ConstraintLayoutprovides various helper components.

In this article, I want to talk about some of these helper components. In particular, we will review the Guideline, Barrier and Group components.

The Constraint Layout

The layout editor window allows us to adapt the View constraints directly inside the window without writing a single…


A short introduction to the ActivityResult API pre-built contracts

Photo by Markus Spiske from Pexels

Retrieving an image by user input is a common task in Android development. Yet it is far from straightforward to implement it. In earlier stages of Android Development, letting the user take a picture and preview it took quite some effort. The same goes for selecting an image via the gallery app.

But as time goes by, Google provides more and more APIs that make these tasks, and thus our everyday life as developers, easier. Nowadays we have access to the ActivityResult API, which allows us to use ActivityResultContract API.

In earlier stages, if we wanted to get a result…

Kennay Kermani

Passionated Mobile & Backend 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