Categories
Android Apps Architecture Jetpack Compose Kotlin

Create a login screen with Jetpack Compose

In a previous post I described how to create a Github Repository browser app. The UI in that app was written using XML layouts(imperative UI). In the recent years developers have been finding it easier to define and update the views using the declarative UI paradigm. This leads to Google releasing Jetpack Compose 1.0 in […]

Categories
Architecture JSON Kotlin Kotlin Multiplatform MacOS

Kotlin Multiplatform in a MacOS app

If a Kotlin developer is familiar with her libraries and language paradigms, it might seem superfluous to learn their counterparts in Mac development. There comes in the possibility to use Kotlin Multiplatform(KMP) in a MacOS app, where familiar libraries and language can be used to generate a .framework, which in turn can be used in […]

Categories
Apps Architecture Kotlin Multiplatform Mobile

Kotlin Multiplatform app architectures

The recommended architecture for Android development is MVVM. However, when using Kotlin Multiplatform Mobile(KMM), the Jetpack’s ViewModel is not available. This means a different dependency or architecture needs to be used. There is no official way to go about this, but thanks to the Kotlin community, different approaches have surfaced. Separation of concerns The purpose […]

Categories
Architecture Kotlin

Kotlin Hydra constructors

After 4 years of Kotlin experience, one of the confusing parts still are the constructors. It appears like every time they seem figured out, you still find yourself googling for a solution in the next project. Compared to Java’s relatively straightforward definitions, Kotlin constructors are like Hydra’s heads. After understanding one concept about them, another […]

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
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
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. […]

Categories
Android Apps Architecture

Android App Architecture, Part 1

Not being familiar with modern Android App architecture and coming from the ViewController world, it is confusing jumping into the recommended MVVM architecture. There are also some parts of the official guide that are left for the reader to figure out, so I will write about my experience with implementing it in my repo browser […]