Kennay Kermani

About common mistakes in the learning process and how to avoid them

Image for post
Image for post
Photo by Clemens van Lay on Unsplash

The digitalization led us to a point where most of our industries at some stage require coding skills. Therefore it is commonly said that programming is one of the most important skills to learn in the twenty-first-century.

Besides that, nowadays almost everyone has daily contact with computers and therefore potential the ability to access all the tools required to start coding. And even if that may have been a hurdle in the past for some people, the preconception of the nerdy programmer has long since passed.

These points may be only some of the reasons but summarized enough for many…


Small to medium size project ideas to build up practical coding experience

Image for post
Image for post
Photo by Octavian Dan on Unsplash

Based on my article on “Why many People Fail At Learning How To Code” where I gave the advice to not only rely on tutorials but rather gain practical experience by working on your own real projects, I want to share a list of examples for such kind of projects.

The list is not bound to any framework or programming language. Still, some ideas may fit better with one framework or another.

1. Rebuild Snake

Snake is a classical computer game where you control a snake that can only go in four directions. Upwards, downwards, left, and right. The goal is to…


And why you should be careful when using onViewCreated()

Image for post
Image for post
Image by Kennay Kermani

This short article is about a common problem in Android Development. How can we determine if our fragment has been recreated from a previous state?

This can mainly be a problem if you don’t make use of Jetpack’s Navigation Component and instantiate your fragments the old-fashioned way using a FragmentTransaction.

If you instantiate your fragments in the onViewCreated() method for example and use add instead of replace for your transaction, you will run into problems. You could quickly have multiple instances of your fragments in your respective container because of the fragment recreation without even noticing it.

Nevertheless which methods…


A quick look at the new material library component for showing progress to the user

Image for post
Image for post
Photo by Isaac Smith on Unsplash

In one of my last articles, I already talked about the new MaterialTimePicker component that just got released with the new Android material library version 1.3.0.

But the MaterialTickePicker was not the only new component that has been included in this update. We also got the new ProgressIndicator that we want to talk about in this article.

The Progress Indicator

This component has been included as one of the material design guidelines a long time ago. Unfortunately, a proper implementation with the mentioned material style never had been published for Android.

Therefore you always had to stick to the Androids’ native ProgressBar and…


A new build time era for annotation processing with Kotlin has arrived

Image for post
Image for post
Image by Kennay Kermani

In a recent post in the android developers blog, written by Ting-Yuan Huang‎ and David Winer, the new Kotlin Symbol Processing (KSP) has officially been announced to be in Alpha state and is compatible with Kotlin version 1.4.30 upwards!

As a reason behind why they build this new compiler plugin, they argue that many developers report build times that are far too long. In addition, it is a problem that there is no native annotation processing system for Kotlin yet and therefore libraries like Android Room for example need to rely on Java annotation processing.

The authors argue that this…


Image for post
Image for post
Image composition by Kennay Kermani, Background image by Vlado Paunovic

A quick overview on how to use the material components for picking date and time

Not only provides the material library the MaterialDatePicker for easily implementing date selection with material style. With the recently released version 1.3.0 of the Android material library, we now finally have stable access to the MaterialTimePicker component which allows easy time selection.

In this article, I provide you a quick overview of how to use both of these components with practical code examples.

Preparations

Let’s start with the MaterialDatePicker which was firstly introduced in version 1.1.0-alpha09 of the Android material library.

First, create a new project with a single activity and call it MainActivity. Go to your app-level build.gradle


Tips on how to stop the thought carousel and get your sleep

Image for post
Image for post
Photo by kevin laminto on Unsplash

Sleep problems are not only local but global problems [1] that can be found in all of our performance-oriented societies. For example, the Centers for Disease Control and Prevention shows in one of their studies [2] that about 29% of U.S. adults reported having less than 7 hours of sleep per night.

Approximately 10% even had daily sleep problems in the last 30 days of the point in time of the study. Lack of sleep or sleep problems, in general, can cause various physical as well as mental health risks [3].

Often it’s the problem that after a stressful day…


How to set up a simple pub-sub with manual acknowledgment

Image for post
Image for post
Photo by Joel Holland on Unsplash

In this tutorial, I want to show you how you can easily set up RabbitMQ with docker and integrate it into your Spring application to easily implement a pub-sub procedure.

Note: In order to follow this tutorial, you should have some basic knowledge in setting up a Spring Boot application and know how to run a Docker container.

Publish-Subscribe-Pattern

First, let’s start with some quick fundamentals about the Publish-Subscribe-Pattern. The pattern is very simple but powerful. The following image shows the main concept:


Image for post
Image for post
Image by Kennay Kermani

A quick hint on how to safely resolve attributes in your custom views with kotlin

Androids KTX extension functions frequently come to the rescue in situations wherein the old days, Java had forced us almost always to write multiple lines of code even for the smallest repetitive tasks.

Now with the luxury of extension functions in Kotlin, many times we can save these lines and therefore come often (but not always) to better readability and maintainability of our code.

One of these is the withStyledAttributes extension function that I want to talk about in this article.

The old way

First, we want to set up a very simplistic custom view. …


When money is not equal to money based on the way you gained it

Image for post
Image for post
Photo by Sharon McCutcheon on Unsplash

There are many situations where we act weird in relation to the value of our money. Just think about how 1 liter of cola in the supermarket costs sometimes only about 1$. Even at this cheap price, you sometimes stand in front of the shelf and wonder if it’s really worth the price.

Then imagine the situation where you are at the restaurant. Suddenly you have no problem paying 4€ for 0.25l of cola. Let’s let out the fact that the restaurant has to pay their staff etc. But you are willing to pay four times the price for four…

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