Networking
Using Ktor, you'll learn how to create a REST API networking setup that can be shared across platforms. We'll be using the Firebase REST API to authenticate users, as well as read and manage user data.
Build Android and iOS apps using shared Kotlin code, while keeping the UI completely native on each platform. Learn practical patterns that work in production.
Using Ktor, you'll learn how to create a REST API networking setup that can be shared across platforms. We'll be using the Firebase REST API to authenticate users, as well as read and manage user data.
Using the Room multiplatform database, we'll create a cache layer that is shared across platforms. This will be used to cache data that we retrieve from Firebase, allowing us to repurpose it for required functionality in our app.
Learn how to create shared code modules that can be imported as dependencies for different platforms of your app, as well as covering how to provide different implementations per-platform where required.
So that our project is well organized, you'll learn how to create multiplatform libraries, shared code modules and also how to organize platform specific code in isolated modules for improved navigation throughout the project.
While being able to write multiplatform code is a huge benefit in itself, you'll also be learning how to write tests for this shared code to prevent any regressions across platforms.
We'll be creating a native Android app using Jetpack Compose - replicating how this will look in your team and allowing us to keep the UI completely native while utilising shared multiplatform code.
We'll be creating a native iOS app using Swift UI - replicating how this will look in your team and allowing us to keep the UI completely native while utilising shared multiplatform code.
We'll be setting up dependency injection using Koin, creating a shared DI graph that can be consumed across both the Android and iOS apps.
Throughout the book we'll be building Jrnl, a journalling app that runs natively on both Android and iOS. Users can create an account, sign in, view their journal entries, create new ones and manage existing ones — all powered by a shared Kotlin core.
The Android app is built with Jetpack Compose, the iOS app with SwiftUI. Both share the same business logic, networking, persistence and state management underneath.
Each platform handles its own UI: navigation, layout, animation, and anything else that benefits from being native. Everything underneath that lives in shared Kotlin code.
This means the parts you don't want to write twice (business logic, networking, persistence, state management) get shared across both platforms. The parts your users actually see and interact with stay native.
Joe is a Google Developer Expert for Android with over 12 years of experience in mobile development. He writes regularly about Android development at joebirch.co, covering everything from Jetpack Compose to Kotlin Multiplatform.
He's also the author of Practical Jetpack Compose — a book covering the Compose UI toolkit from fundamentals through to production patterns.
Drop your email below and you'll get an email when the book is ready.