Categories
Android Apps Architecture iOS Kotlin Multiplatform Multiplatform Mobile

Kotlin Multiplatform logging libraries

When developing with any platform, the existence of libraries is assumed. This is to delegate common tasks to out project code, in order to reduce development time and avoid common pitfalls already solved by other developers. Kotlin Multiplatform(KMM) is no different. Available libraries Since Kotlin is becoming more popular among Android/JVM developers, one might expect […]

Categories
Apps Kotlin Multiplatform Mobile

iOS app with Kotlin Multiplatform Mobile

Overview Kotlin Multiplatform Mobile(KMM) is a new feature from Jetbrains. It is an alpha feature but can already be used to create and publish apps for both iOS and Android. It is possible to write business (network and database) logic in Kotlin, and share this code between iOS and Android. ⛩Architecture Kotlin code compiles into […]

Categories
Kotlin

Create JSON manually with kotlinx.serialization

Kotlin serialization is a great library for serialisation in Kotlin. It is mainly geared towards serialising from objects to strings and back, but on closer look it also contains a comprehensive Json library. Even after discovering the documentation, though, the use of this new library might be confusing. 🕋 Serialisation to objects Consider a data […]

Categories
Architecture Automations Notion

Add a sequence diagram to Notion

Update I created a MacOS app that uploads PlantUML code to Notion. Check it out PlantUML to Notion uploader In order to express their ideas about a project’s architecture, developers can utilise the UML sequence diagrams. There are different ways to create and publish these diagrams, ranging from paid apps(8$/month, 100$) to free Confluence apps. […]

Categories
Architecture Java Kotlin

Callback styles for async tasks

For asynchronous tasks, the actions on completion need to be handled via a callback. There are different patterns to achieve this, with each having their own benefits and shortcomings. Interfaces One of the oldest callback styles are interfaces or anonymous classes. They are used to great effect in Android. As an example, with okhttp library, […]

Categories
Android Architecture Kotlin testing

Logging in a Java library

It can be useful to emit logs in a library. When doing so, one needs to consider when to emit, how to filter and who is responsible for printing/handling the logs. Correct logging should also be tested. When to log There are different reasons to emit a message, for instance on important events, undefined behaviour […]

Categories
Kotlin

Kotlin: Concatenating nullable strings

A null String is concatenated as “null” in Kotlin: What if the goal is to concatenate only if the second string is not null? There are a few options: if-else One of the solutions would be to check the null value with elvis(?:) operator: Now there is no “null”, but the whole “and second is” […]

Categories
Automations General

Workflow automations

Some of the smaller, repetitive tasks as a programmer can be automated and by doing so productivity improved and frustrations reduced. I am talking about tasks like moving the cursor, writing keystrokes and manipulating text and apps. My purpose is to use the trackpad less and keyboard more. By doing so you can focus more […]

Categories
Android Automotive

Car data points in Android Automotive

When following the Android Automotive overview, it might seem that not much of the car info is available for developers. It is even stated that only media apps are allowed and there is no documentation about car properties. Looking further into the car emulator and Android source code, it looks like more is on the […]

Categories
Android Apps Architecture testing

Part 2: Testing with MockK and Koin

One of the best things about MVVM is the use of separation of concerns principle which by design enables testing of each component in isolation. View, ViewModel and Model are all separated and thus easily testable. When thinking of testing, then unit testing comes to mind first and for that mocking of dependencies is required. […]