Kotlin 多平台移动端范例

This is a curated list of cross-platform mobile projects created with Kotlin Multiplatform.

You can find even more sample projects on GitHub, see the kotlin-multiplatform-mobile topic.

If you want to add your Kotlin Multiplatform project to this topic and help the community, follow the instructions in the GitHub documentation.

范例 - 图1

Sample nameWhat’s shared?Popular libraries usedUI FrameworkiOS integrationPlatform APIsTestsFeatures
Kotlin Multiplatform Mobile SampleAlgorithms-XML, SwiftUIXcode build phases-
  • expect/actual declarations
  • KMM RSS ReaderModels, Networking, Data Storage, UI StateSQLDelight, Ktor, DateTime, multiplatform-settings, Napier, kotlinx.serializationJetpack Compose, SwiftUIXcode build phases-
  • Redux for sharing UI State
  • Published to Google Play and App Store
  • kmm-ktor-sampleNetworkingKtor, kotlinx.serialization, NapierXML, SwiftUIXcode build phases--
  • Video tutorial
  • TodoAppDecomposeMviKotlinModels, Networking, Presentation, Navigation and UISQLDelight, Decompose, MVIKotlin, ReaktiveJetpack Compose, SwiftUIXcode build phases-
  • 99% of the code is shared
  • MVI architectural pattern
  • Shared UI across Android, Desktop and Web via Compose Multiplatform
  • mpp-sample-libAlgorithms----
  • Demonstrates how to create a multiplatform library (tutorial)
  • KaMPKitModels, Networking, Data Storage, ViewModelsKoin, SQLDelight, Ktor, DateTime, multiplatform-settings, KermitJetpack Compose, SwiftUICocoaPods--
    PeopleInSpaceModels, Networking, Data StorageKoin, SQLDelight, KtorJetpack Compose, SwiftUICocoaPods, Swift Packages-

    Target list:

  • Android Wear OS
  • iOS
  • watchOS
  • macOS Desktop (Compose for Desktop)
  • Web (Compose for Web)
  • Web (Kotlin/JS + React Wrapper)
  • JVM
  • D-KMP-sampleNetworking, Data Storage, ViewModels, NavigationSQLDelight, Ktor, DateTime, multiplatform-settingsJetpack Compose, SwiftUIXcode build phases-
  • Implements the MVI pattern and the unidirectional data flow
  • Uses Kotlin’s StateFlow to trigger UI layer recompositions
  • Food2Fork Recipe AppModels, Networking, Data Storage, InteractorsSQLDelight, Ktor, DateTimeJetpack Compose, SwiftUICocoaPods---
    BookshelfModels, Networking, Data StorageRealm-Kotlin, Ktor, kotlinx.serializationJetpack Compose, SwiftUICocoaPods--
  • Uses Realm for data persistence
  • NotflixModels, Networking, Caching, ViewModelsKoin, Ktor, Multiplatform settings, kotlinx.coroutines, kotlinx.serialization, kotlinx.datetime, NapierJetpack Compose-Android, Compose Multiplatform-Desktop--
  • Modular architecture
  • Runs on desktop
  • Sharing viewmodel