KMP Tutorial #16: Building the Shared Data Layer — Offline-First with Ktor and SQLDelight

In the previous tutorial, we set up the Notes app architecture with a local database and shared ViewModels. Everything works offline. But real apps need to sync with a server. In this tutorial, we build the shared data layer — adding a Ktor API client, Data Transfer Objects (DTOs), an offline-first sync pattern, and a database migration. All of this code lives in commonMain and runs on both Android and iOS. ...

April 6, 2026 · 8 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

Kotlin Tutorial #24: Build a REST API with Ktor

In the previous tutorial, you built a CLI tool. Now let’s build a REST API. Ktor is Kotlin’s official framework for building asynchronous servers and clients. It is lightweight, flexible, and uses Kotlin coroutines. In this tutorial, you will learn: Setting up Ktor Routing (GET, POST, PUT, DELETE) JSON serialization with Content Negotiation In-memory storage Path parameters and query parameters Error handling with StatusPages Testing with ktor-server-test-host What We’re Building A Notes API with CRUD operations: ...

March 22, 2026 · 9 min