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

KMP Tutorial #4: Compose Multiplatform — Share Your UI Across Android, iOS, and Desktop

In the previous tutorials, we shared business logic between Android and iOS. The UI stayed separate — Compose on Android, SwiftUI on iOS. But what if you could share the UI too? That is what Compose Multiplatform (CMP) does. Write your Compose code once. Run it on Android, iOS, Desktop, and Web. Same @Composable functions. Same Modifier chains. Same MaterialTheme. If you followed our Jetpack Compose tutorial series, you already know how to build Compose UI. CMP uses the exact same API. No new framework to learn. ...

April 2, 2026 · 9 min

KMP Tutorial #3: Understanding KMP Project Structure — Source Sets, Dependencies, and expect/actual

In the previous tutorial, we created a KMP project and ran it on Android and iOS. Now let’s understand exactly how that project is organized — because once you understand the structure, everything else in KMP makes sense. This is the tutorial that separates developers who struggle with KMP from those who build confidently. Take your time. The Core Idea: Source Sets A KMP project is organized into source sets. Each source set is a collection of Kotlin files that compile to specific platforms. ...

April 1, 2026 · 12 min

KMP Tutorial #2: Setting Up Your First Kotlin Multiplatform Project

In the previous tutorial, we learned what KMP is and why it matters. Now let’s get our hands dirty — create a real project, understand every file in it, write shared code, and run it on both Android and iOS. This is a long tutorial. Take your time. By the end, you will have a working cross-platform app and understand exactly how every piece fits together. Part 1: Setting Up Your Environment What You Need Tool Required Purpose Android Studio Yes IDE for KMP development (latest stable) Xcode Yes (Mac only) Builds and runs iOS apps JDK 17+ Yes Kotlin compiler depends on it Mac computer For iOS Apple requires Xcode, which only runs on macOS CocoaPods Optional Some KMP libraries need it for iOS If you are on Windows or Linux, you can still write shared code and build the Android app. But you cannot build or run iOS. There is no way around this — Apple controls iOS builds. ...

April 1, 2026 · 14 min

KMP Tutorial #1: What is Kotlin Multiplatform and Why Should You Learn It?

You are a Kotlin developer. You build Android apps. But your company also needs an iOS app. And maybe a desktop app. And a web app. Do you write everything four times? Do you switch to Flutter and learn Dart? Do you hire a separate iOS team? Or do you use the Kotlin you already know — and share your code across all platforms? That is what Kotlin Multiplatform (KMP) does. ...

April 1, 2026 · 8 min