Kotlin Multiplatform Mobile Docs Help

Samples

This is a curated list of Kotlin Multiplatform Mobile (KMM) samples.

Do you have a great idea for a sample, or one you would like to add to the list?
Feel free to reach out to us and tell us about it!

KMM sample

This official sample from the Kotlin team demonstrates the Kotlin Multiplatform Mobile (KMM) basic concepts. Learn how to configure Gradle to build a simple KMM project with Android and iOS targets, how to share code in a common source set, and how to use expect and actual declarations in cases where code cannot be shared: https://github.com/Kotlin/mpp-example

CocoaPods integration samples

These official samples from the Kotlin team demonstrate how to use CocoaPods in KMM projects.

KaMP Kit

This application demonstrating KMM concepts uses some popular KMM libraries and has a simple set of features you can use as a reference.
This is a good place to start if you’ve learned everything you can from basic KMM examples and want to dig a bit deeper: https://github.com/touchlab/KaMPKit

Moko template

This “not-so-simple“ template covers Multiplatform Gradle DSL configuration, modular architecture, and the use of moko libraries. Also, Views are native in this sample, but ViewModels are multiplatform.
If you're interested in sharing not only the business logic layer, but also a presentation layer, this project could give you some inspiration: https://github.com/icerockdev/moko-template

PeopleInSpace

This minimalistic but powerful sample demonstrates how KMM can be integrated with modern UI frameworks, such as Swift UI and Jetpack Compose. It also accompanies a series of interesting blog posts and even has a nice bonus – watchOS target usage: https://github.com/joreilly/PeopleInSpace

GitFox SDK

This library for creating client applications for GitLab servers is a nice example of an open-source production-ready Multiplatform SDK. By looking through its code, you can learn how to work with networks and authorization, how to integrate your Multiplatform SDK with iOS and Flutter apps, and how to bypass some of the most common pitfalls users encounter while working with KMM: https://gitlab.com/terrakok/gitlab-client/
Fun fact: this project was created by one of our team members, who was a mobile developer before coming to the KMM team!

Last modified: 28 August 2020