Knowledge base

Fixing Android DataStore migration from a data object to a data class

I had to implement this migration for an object that was stored in DataStore using Protobuf and Kotlinx Serialisable on Android. The original object looked like this: The new object was supposed to look like this: As you can see, the sealed interface implementation of Pending changed from a data object to a data class.…

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…

Making arguments work in Compose Navigation where there was XML

Jetpack Compose Navigation goes hand in hand with Jetpack Compose. The issue comes when you are coming from XML navigation. Passing arguments between screens is very easy in XML and by extending from Java.Serializable interface, everything was working like magic. But now, you open the Pandora’s box with Jetpack Compose and here is how you…

Why black-box tests could be a bad idea?

Blackbox tests are tests that are being done end-to-end. This means a UI automaton clicking on your mobile app that connects to the actual backend server – not prod, of course, but something close to staging. On Android specifically, you could use Espresso or UiAutomator to achieve those results. What are the issues with black-box…

How to tackle the R8 optimisation nightmare in a sane way?

Implementing R8 optimizations can always be a nightmare for the dev that has to do it. R8 is a compiler that works together with ProGuard to shrink, minify, and obfuscate your code. It can reduce significantly the APK size by removing classes that are not used at all. It checks the hierarchy of classes and…

Android app fails to build with SSLHandshakeException

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. Actually, there was only one fix that worked for me. Install a new Java environment or JDK and set it as a default Java…

Adding a custom lint rule to your Android project

We had one issue where people tend to create adapter classes inside fragments as properties and then forget to clear them out in onDestroyView. This actually creates a memory leak due to the adapter very often holding references to objects that were already destroyed. To prevent this from happening, we decided to create a custom…

Something went wrong. Please refresh the page and/or try again.


Follow My Blog

Get new content delivered directly to your inbox.