KMP Tutorial #14: Error Handling and Logging in Kotlin Multiplatform

Your app will crash. The network will fail. The server will return unexpected data. The database will be empty when it should not be. The question is not if errors happen — it is how you handle them. Good error handling makes the difference between an app that shows a helpful message and an app that shows a blank screen. In KMP, you need error handling that works on every platform. No Android-specific exceptions, no iOS-specific patterns. Shared error handling for shared code. ...

April 5, 2026 · 8 min

KMP Tutorial #13: Testing in Kotlin Multiplatform

You have shared code running on Android and iOS. But how do you know it works correctly on both platforms? You test it. KMP has built-in support for testing. Tests written in commonTest run on every platform automatically. Write once, verify everywhere. Test Source Sets KMP projects have test source sets that mirror the main source sets: shared/src/ ├── commonMain/ → shared code ├── commonTest/ → tests for shared code (runs on all platforms) ├── androidMain/ → Android-specific code ├── androidTest/ → Android-specific tests ├── iosMain/ → iOS-specific code └── iosTest/ → iOS-specific tests Tests in commonTest are the most valuable — they verify your shared logic on every target platform with a single test file. ...

April 5, 2026 · 7 min

KMP Tutorial #12: Navigation in Compose Multiplatform

Your app has multiple screens. A note list, a note detail, a settings page, a profile screen. Users need to move between them. On Android, Jetpack Compose uses navigation-compose. On iOS with SwiftUI, you use NavigationStack. Two different APIs for the same concept. In Compose Multiplatform, you can share navigation too. The navigation-compose library now works on all platforms — Android, iOS, Desktop, and Web. Navigation Options in CMP There are several navigation libraries for Compose Multiplatform: ...

April 4, 2026 · 6 min

KMP Tutorial #11: Clean Architecture in Kotlin Multiplatform

You have learned Ktor for networking, SQLDelight for databases, Koin for dependency injection, and shared ViewModels. You have all the building blocks. But how do you organize them? Without structure, your project becomes a mess. Networking code mixed with UI logic. Database queries inside ViewModels. Platform code scattered everywhere. Clean Architecture solves this. It gives you clear layers with clear rules about what goes where and what can depend on what. ...

April 4, 2026 · 9 min

KMP Tutorial #10: Shared ViewModel in Kotlin Multiplatform

On Android, ViewModels hold UI state and survive configuration changes. On iOS, ObservableObjects do the same job. Two platforms, two patterns, two codebases. But the logic is often identical. Loading a user list, handling errors, managing form state — the business logic does not change between platforms. Only the UI does. With KMP, you can write your ViewModel once in commonMain and use it on both Android and iOS. Since androidx.lifecycle:lifecycle-viewmodel version 2.8, ViewModel officially supports Kotlin Multiplatform. ...

April 4, 2026 · 7 min

KMP Tutorial #9: Koin — Dependency Injection in Kotlin Multiplatform

In the previous tutorials, we created Ktor clients, SQLDelight databases, and DataStore instances by hand. We passed them manually to repositories, which we passed to ViewModels, which we passed to screens. That works for small apps. But as your app grows, the wiring becomes painful. You need a way to automatically connect everything together. That is what Koin does. It is a lightweight dependency injection framework for Kotlin — and it works perfectly in KMP. ...

April 3, 2026 · 7 min

KMP Tutorial #8: DataStore — Key-Value Storage in Kotlin Multiplatform

In the previous tutorial, we used SQLDelight for structured data — tables with rows and columns. But not everything belongs in a database. Simple settings like “dark mode on/off”, “last selected tab”, or “auth token” need something lighter. That is what DataStore does. It is Google’s replacement for SharedPreferences, and it works on Android, iOS, and Desktop through KMP. What is DataStore? DataStore is a key-value storage library. Think of it like a dictionary: ...

April 3, 2026 · 8 min

KMP Tutorial #7: SQLDelight — Database in Kotlin Multiplatform

In the Ktor tutorial, we loaded data from the internet. But what happens when the user has no internet? The app shows nothing. You need a local database — and in KMP, that means SQLDelight. SQLDelight is the opposite of Room. Room generates SQL from Kotlin. SQLDelight generates Kotlin from SQL. You write real SQL queries, and SQLDelight generates type-safe Kotlin code. It works on Android, iOS, Desktop, and Web — all from the same .sq files. ...

April 3, 2026 · 11 min

KMP Tutorial #6: Ktor Client — Networking in Kotlin Multiplatform

Every app needs to talk to the internet. On Android, you use Retrofit. On iOS, you use URLSession. Two different libraries, two different APIs, two different codebases. In KMP, you use Ktor Client — one networking library that works on every platform. Write your API calls once in commonMain, and they work on Android, iOS, Desktop, and Web. What is Ktor? Ktor is a networking framework by JetBrains (the same team behind Kotlin). The client side lets you make HTTP requests from shared code. ...

April 2, 2026 · 9 min

KMP Tutorial #5: KMP vs Flutter vs React Native — Which Should You Choose in 2026?

This is the most common question in cross-platform development: which framework should I use? The honest answer: there is no universal winner. Each framework has a different philosophy, different strengths, and fits different teams. This article will help you make an informed decision — not sell you on one framework. I will compare them across 10 dimensions with real data from 2026. The Three Philosophies Before we look at features, understand the core philosophy of each: ...

April 2, 2026 · 9 min