Sign in

Kennay Kermani

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…


A short guide about all possible WorkManager cancellation methods

Foto von Dids von Pexels

The Android WorkManager API is made for scheduling deferrable, asynchronous tasks. We reference tasks that got scheduled with this API as “work”. Your scheduled work is intended to run reliably by using this API, even if the device restarted.

But sometimes you need to cancel your scheduled work. Within this article, we will have a quick look at the four methods for implementing this task with the WorkManager API.

Work cancellation

When you schedule your work, you have various possibilities to identify your scheduled work.

The first option is to use the id that will be automatically generated when you create a…


A quick tip on how to combine these three layouts

Photo by Lucas George Wendt on Unsplash

The ConstraintLayout is a very powerful component that allows you to build complex layouts while retaining a flat hierarchy. In most cases, we have only a static layout that easily fits on one screen.

Nevertheless, we often come to the point where we have layouts that can dynamically expand their sizes. That is often the case when we use a RecyclerView which can contain an unknown number of items.

In such situations you have either the option to give the RecyclerView a fixed size and the user can scroll the items within that box or you wrap it in a…


Where and how to use the bottom sheet according to Material Design guidelines

Foto von Vladislav Vasnetsov von Pexels

Just as its name implies, a bottom sheet is anchored to the bottom of your screen and can be displayed either as modal dialog or directly be integrated into a layout.

In this article, we will take a look at this helpful component. We will see in what type of situations you can use it and how to implement each of its variations.

At the end of this article, you should have a deep understanding of how the Android Bottom Sheet component works and how to make use of it.

Usage

The component takes part in the Material Design Guidelines. For…


CODEX

Realize an infinite social media-like feed

Photo by Maxime Lebrun on Unsplash

You may know these infinite lists from e.g. your Pinterest, TikTok, or even your Instagram “explore” feed. It makes you want to scroll and scroll but unfortunately, you will never reach the end.

Features like these can really hook up your user, in terms like Nir Eyal describes in his famous book “Hooked — How to Build Habit-Forming Products”.

Today I will show you how you can easily achieve an infinite scrolling list for a RecyclerView with a combination of Android Room and Paging 3.

To follow along with this article, as the only requirement you should know how to…


About essential Android Studio / IntelliJ Shortcuts For Faster And Efficient Coding

So, I heard you are a developer and are still navigating through your code mostly with your mouse? Pathetic!

Within this article, I show you essential shortcuts to finally enable your full potential in terms of transforming your ideas into code.

If you make use of all shortcuts I will show you, and really force yourself to stop using the mouse whenever you can, you will increase your productivity immensely.

Today we will pave your way to become a true Coding Keyboard Warrior.

Me when I see people using mostly their mouse to navigate through their code

1 General Keyboard Shortcuts

First, we will…


Make your life easier by automating your testing distribution

Foto von SpaceX von Pexels

Who hasn’t experienced this issue? You are working hard on your new Android app and finally get to the point where you have a state of your product, that you want to show off to your stakeholders.

A widely used approach is either to upload your app to the Google Play Store and use the internal testing feature for example where you can distribute your application to a set of trusted testers.

You have also the opportunity to send a direct download link to your uploaded application file.

But that is often a huge pain, especially if you have no…


And why you should commit to a saving rate for a stable financial long-term strategy

Foto von Pixabay von Pexels

Take a look at Josh. Josh works 40 hours per week and gets 2000$ on his bank account at the end of every month. After he pays his rent, there are 1400$ left.

Over the course of the month, he pays for food and free time activities with his friends. At the end of the month, he looks at his bank account again and sees there are only 50$ left: “No, this month is nothing left to save” he thinks.

This is the completely wrong approach.

Josh has no plan at all how he can effectively build up savings. In…


Foto von Felix Mittermeier von Pexels

CODEX

Two quick hints on Kotlin Live Templates for using Androids LiveData

Live Templates can really make the life of us developers easier. These templates are a built-in tool within Android Studio that allows you to write pre-defined code snippets that let you add parameters while typing and are compatible with the IDEs auto-complete function (IntelliSense).

In one of my recent articles, I wrote an in-depth article about this tool and how it can facilitate your everyday life as an Android Developer. If you have no experience with Live Templates at all, I highly recommend reading that article first.

In this article, I propose two quick Live Templates that you can easily…


Photo by Dominik Schröder on Unsplash

Start your journey to Google Cloud deployment now

Getting into the world of cloud development can sometimes be a little bit overwhelming. In a recent article, I already showed you how you can set up a simple Pub-Sub implementation that is often used to communicate between services.

With this tutorial, I want to bring some light onto the required steps to bring your Spring Boot application with connection to a MongoDB Atlas instance into the cloud with the help of Google Cloud or to be more specific Google Cloud Run.

To follow this article in a practical manner there are some premises for your project.

I am assuming…

Kennay Kermani

Passionated Mobile & Backend Developer, besides tech I write about fitness, health, and self-development

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