Category: Kotlin
-
Postmortem: ProGuard is annoying
This morning I received several crash reports from last night’s release. I wasn’t able to replicate this crash on my debug environment. So this should be a production-only crash. The first thing that came to my mind while I read the crash report is that this is a Proguard issue. The crash was happening in […]
-
Realm Kotlin Tutorial
First things first, make sure you followed the official Realm tutorial on how to install it on your Android project. Here’s how I implemented it on my Android project using Kotlin. After installation, initialize the Realm instance on your Application class or your launcher Activity. Create your Realm object by extending the RealmObject class. Let’s […]
-
Call Multiple APIs using Coroutines
Every time my app starts, I need to call 2-3 URL endpoints to get the latest data from the API. Every app encounters this scenario one way or another. I need to know when each API call finishes so that I can prompt the user a Snackbar or dialog to indicate that I already got […]
-
Bluetooth printer scanning using Kotlin
One of the requirements of my current project is to be able to establish Bluetooth connection and send texts to print. See the video below for the result. Let’s create an empty Android project and let’s call it BluetoothPrintingSample. Then, create a layout folder inside res folder. Let’s create a simple layout called activity_print.xml. Open […]
-
Pass list of objects in Intent using Kotlin
Every Android developer is familiar with passing data between Activities using Bundle. The old Java way was to implement Parcelable class and then you override all the required methods. See example below. You can read more of the details here. I’m not really a fan of this type of implementation because it will make my […]