Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStats

Categories

🤖 Artificial Intelligence
☁️ Cloud and Infrastructure
💾 Data and Databases
💼 Professional Skills
🎯 Programming and Development
🔒 Security and Networking
📚 Specialized Topics
DATA_AND_DATABASES
HomeAboutTopicsPricingMy VaultStats
LEVEL 0
0/5 XP
GitHub
© 2026 CheatGrid™. All rights reserved.
Privacy PolicyTerms of UseAboutContact

Kotlin Multiplatform for Mobile Cheat Sheet

Kotlin Multiplatform for Mobile Cheat Sheet

Back to Mobile DevelopmentUpdated 2026-05-16

Kotlin Multiplatform for Mobile (KMP, also known as KMM) is JetBrains' official technology for sharing Kotlin code between Android and iOS applications while maintaining native UI on each platform. Unlike cross-platform frameworks that force a single UI paradigm, KMP focuses on sharing business logic, networking, data persistence, and domain layers while letting developers use native toolkits (Jetpack Compose on Android, SwiftUI/UIKit on iOS) for platform-specific experiences. As of 2026, KMP is production-ready and stable, with Compose Multiplatform enabling optional UI sharing across platforms. KMP eliminates code duplication without sacrificing native performance, and its incremental adoption path allows teams to migrate existing native apps module-by-module rather than rewriting from scratch.

What This Cheat Sheet Covers

This topic spans 20 focused tables and 204 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Table 1: Core KMP Architecture ConceptsTable 2: expect/actual DeclarationsTable 3: Platform-Specific ImplementationsTable 4: Shared Code Architecture PatternsTable 5: Networking with Ktor ClientTable 6: Data PersistenceTable 7: Serialization with kotlinx.serializationTable 8: Coroutines and Flow in Shared CodeTable 9: Source Sets and Module StructureTable 10: Gradle ConfigurationTable 11: iOS Integration and Swift InteropTable 12: Testing Shared ModulesTable 13: Dependency Injection with KoinTable 14: Compose Multiplatform for Shared UITable 15: Migration from Native AppsTable 16: Compose Multiplatform ResourcesTable 17: CI/CD and PublishingTable 18: Performance and OptimizationTable 19: Advanced KMP TechniquesTable 20: IDE and Tooling

Table 1: Core KMP Architecture Concepts

ConceptExampleDescription
commonMain source set
src/commonMain/kotlin/
// Shared business logic
The shared codebase where platform-agnostic Kotlin code lives
• Accessible to all targets
• Contains networking, domain logic, repositories, ViewModels, and utilities
• Compiles to all declared platforms
androidMain source set
src/androidMain/kotlin/
// Android-specific code
Android-specific implementation layer
• Accesses Android SDK APIs directly
• Provides actual implementations for Android platform
• Compiled with Kotlin/JVM for Android targets
iosMain source set
src/iosMain/kotlin/
// iOS-specific code
iOS-specific implementation layer
• Accesses iOS frameworks like UIKit and CoreData
• Provides actual implementations for iOS platform
• Compiled with Kotlin/Native to native iOS binaries
Shared module
shared/ (or composeApp/)
The KMP library module containing common, Android, and iOS source sets
• Generated as an .aar for Android and .framework/Swift Package for iOS
• Defines shared targets in build.gradle.kts
Source set hierarchy
commonMain → iosMain → iosArm64Main
Dependency chain of source sets
• Child sets inherit code from parent sets
• Enables incremental platform specificity
• Default hierarchy template simplifies target configuration
expect/actual mechanism
expect fun platform(): String
actual fun platform() = "Android"
Platform-specific API access from common code
• expect declares API in commonMain
• actual provides platform implementation in androidMain/iosMain
• Compiler ensures all targets provide implementations

More in Mobile Development

  • Jetpack Compose Cheat Sheet
  • Mobile Accessibility Implementation Cheat Sheet
  • .NET MAUI Cross-Platform Framework Cheat Sheet
  • Cross-Platform Mobile UI Component Libraries Cheat Sheet
  • Mobile App Analytics and Crash Reporting Cheat Sheet
  • Mobile App Testing Strategies Cheat Sheet
View all 40 topics in Mobile Development