Kotlin Multiplatform Project
This is a Kotlin Multiplatform (KMP) project powered by Compose Multiplatform. It allows you to share code seamlessly across Android, iOS, and Desktop, reducing development time while maintaining high performance and native feel.
A clean Architecture
The project is organized into modular directories to separate shared logic from platform-specific entry points.
/composeApp
This module contains the core of your application. It houses the UI and business logic that is shared across all platforms.
- commonMain: The most important folder. This contains code that runs on all targets. It includes shared Compose UI, navigation, business logic, and data models.
- androidMain: Contains Android-specific code, such as the MainActivity, Android Manifest, and any library integrations that require the Android SDK.
- iosMain: This is where you implement iOS-specific functionality. For example, if you need to call Appleās CoreCrypto, CoreLocation, or StoreKit APIs, you place those calls here.
- desktopMain: Contains code for the Desktop (JVM) target, including window configurations and desktop-specific resource handling.
/iosApp
Even though the UI is shared via Compose Multiplatform, every iOS app requires a native entry point to boot on Apple devices.
- Entry Point: Contains the Xcode project and the SwiftUI code that hosts the shared Compose view.
- Native UI: This is the place to add any native SwiftUI views if your project requires a hybrid approach.
Prerequisites
- Android Studio (Latest version) with the Kotlin Multiplatform plugin installed.
- Xcode (for iOS development).
- JDK 17 or higher.
Running the App
- Android: Select composeApp in the run configurations and click Run.
- iOS: Open the iosApp folder in Xcode and hit Cmd + R, or use the run configuration in Android Studio.
- Desktop: Execute the following command in your terminal:
./gradlew :composeApp:run
