# kmp-logic-sharing-simple-example **Repository Path**: mirrors_Kotlin/kmp-logic-sharing-simple-example ## Basic Information - **Project Name**: kmp-logic-sharing-simple-example - **Description**: A simple project (created by the Kotlin Multiplatform wizard) containing shared business logic between Android, iOS, and Web native UI implementations. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-06-26 - **Last Updated**: 2026-03-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README This is a Kotlin Multiplatform project targeting Android (Jetpack Compose), iOS (SwiftUI), and Web (React). ![screenshot.png](screenshot.png) * [/iosApp](./iosApp/iosApp) contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform, you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project. * [/sharedLogic](./sharedLogic/src) is for the code that will be shared between app targets in the project. The most important subfolder is [commonMain](./sharedLogic/src/commonMain/kotlin). If preferred, you can add code to the platform-specific folders here too. * [/sharedUI](./sharedUI/src) is for code that will be shared across your Compose Multiplatform applications. It contains several subfolders: - [commonMain](./sharedUI/src/commonMain/kotlin) is for code that’s common for all targets. - Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app, the [iosMain](./sharedUI/src/iosMain/kotlin) folder would be the right place for such calls. Similarly, if you want to edit the Desktop (JVM) specific part, the [jvmMain](./sharedUI/src/jvmMain/kotlin) folder is the appropriate location. * [/webApp](./webApp) contains web React application. It uses the Kotlin/JS library produced by the [sharedLogic](./sharedLogic) module. ### Build and Run Android Application To build and run the development version of the Android app, use the run configuration from the run widget in your IDE’s toolbar or build it directly from the terminal: - on macOS/Linux ```shell ./gradlew :androidApp:assembleDebug ``` - on Windows ```shell .\gradlew.bat :androidApp:assembleDebug ``` ### Build and Run Web Application To build and run the development version of the web app, use the run configuration (`webApp`) from the run widget in your IDE’s toolbar or run it directly from the terminal: 1. Install [Node.js](https://nodejs.org/en/download) (which includes `npm`) 2. Build Kotlin/JS shared code: - on macOS/Linux ```shell ./gradlew :sharedLogic:jsBrowserDevelopmentLibraryDistribution ``` - on Windows ```shell .\gradlew.bat :sharedLogic:jsBrowserDevelopmentLibraryDistribution ``` 3. Build and run the web application ```shell npm install npm run start ``` ### Build and Run iOS Application To build and run the development version of the iOS app, use the run configuration from the run widget in your IDE’s toolbar or open the [/iosApp](./iosApp) directory in Xcode and run it from there. --- Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html)…