Sign in

Kennay Kermani

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

Photo by from

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 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 .

However, if…

Implement buttons with style

Photo by on

The look and feel of an app is one of the main factors when it comes to the point of how the overall app experience appears to the user.

In general, we see rather static buttons in mobile apps. Therefore, if you want your UI to really stand out, why don’t you try to use animated buttons?

In this article, I will show you how you can use a Lottie Animation to use the animations to represent different button states and also to have really nice click animations.

What we will achieve

The inspiration for this article came when I implemented a button in…

Lessons Learned from updating my app to targetSdkVersion 31

Photo by on

Android 12 is coming. With Beta 4, it has just reached platform stability. Taking a look at the timeline below, the final build is expected to be released in November 2021.

A practical example

Photo by from

is the recent evolution state of . The component allows you for example to easily integrate paging REST Endpoints or let you load database entries from Android Room in a paging manner.

If you use the library as it is intended, you will not have any problems. Regardless of whether you load the data directly from an API or database, the data is determined by that data source.

But what if we need to edit the items that are already queried and set to our adapter?

How to solve this issue is what we are going…

Merge multiple LiveData sources into one

Photo by from

The LiveData component is and is nowadays widely used for implementing the Observer pattern while automatically considering the 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 on

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 .

With the introduction of the , 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 . It drastically facilitates consistent behavior for navigation within your Android app. …

Save unnecessary code for loading data with bundle arguments.

Photo by from

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 from

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 , , or .

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 from

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 by

Kotlin Inline Classes are a subset of the . 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…

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