Profiling and how to optimise your app startup and kill ANRs

Very often when building an app, you get taken away in the code architecture, building different components, and getting stuff done. You want features out, and very often you don’t have time to optimise stuff. Sadly, this is the way software development has gone in recent years, especially during the IT layoffs in the recent couple of years. One thing that always gets missed and usually gets resolved is that your app just becomes slow. ANRs or Application Not Responding is an often thing that happens with mobile apps and people learn about it only when people actually start complaining from it. “Hey, we see a dialog that says Close app” is the most common thing you will hear from users. And this is when you realized they have already opened Pandora’s box for you. I hope with this post to make you aware of how to identify such potential issues and try to fix them before they occur. Let’s go.

June 19, 2025 · 9 min · gmirchev90

Android app fails to build with SSLHandshakeException

Resolving javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed Recently, I tried to build an Android project and it failed with the above error. It was a super nasty error to fix and I spent quite some time on it.

August 22, 2024 · 1 min · gmirchev90

Local KtLint configuration for Android

KtLint & Detekt are tools that help us keep our code formatted in the same way and sometimes even help us spot errors before they are actually merged to master or develop. Most of the CI integrations already include a detekt step before the unit tests are run. To avoid waiting for the CI, you can easily integrate ktlint as part of Git hooks. So every time when you decide to commit, Git hooks run and ktlint analyzes the committed files and prevents you from pushing until you fix your errors.

October 28, 2022 · 3 min · gmirchev90

Fix the display of the toolbar in Android Studio

From time to time I get this really nasty bug where the toolbar in Android Studio is aligned to the start of the screen. I mean the part where you select the device and press Run, for some reason sometimes just moves to the left and bringing it back to the right is a bit of a pain. Also if you hide the main navigation toolbar by accident, then it is really hard to bring it back. Here is the solution: ...

September 28, 2021 · 1 min · gmirchev90

Android Studio Arctic Fox not building a signed APK

Generating a signed build using Android Studio Arctic Fox version 2021.3.1 seem to be a tricky thing to do. I spent several hours just to figure out where the issue is and at the end, I still don’t know what is the exact reason for signing to not work.

August 17, 2021 · 2 min · gmirchev90

Tricky parts when implementing unit tests for Android in Kotlin

Testing data classes in Kotlin As we all know, data classes are final by default on Kotlin and if you try to use Mockito and mock such a class, you will get an exception. What you need to do is add this file:

November 12, 2020 · 3 min · gmirchev90

Android Studio Live Templates

I was really wondering how I can remove repetitive tasks from Android Studio by assigning shortcuts or tags and I found that IntelliJ has Live Templates which I bet that little programmers use. So as an example I wanted when I type the word “tag” within a class the following to be autocompleted:

May 4, 2020 · 1 min · gmirchev90