Here's an example of a multiplatform app with shared UI and network logic built with Kotlin Multiplatform and Compose Multiplatform for Android, iOS and Desktop.
Android (Dark theme) | iOS (Light theme) |
---|---|
Desktop |
---|
The project follows the Kotlin Multiplatform structure, allowing code sharing between Android and iOS platforms. Here's a brief overview of the project structure:
shared
: Contains shared Kotlin code that is used by both Android and iOS.androidApp
: Contains the Android-specific code, including activities, UI components, and Android-specific dependencies.iosApp
: Contains the iOS-specific code, including view controllers, SwiftUI views, and iOS-specific dependencies.desktop
: Contains the desktop-specific code for the Kotlin Multiplatform project, targeting desktop platforms such as Windows, macOS, and Linux.
- Select
androidApp
from Run Configurations in Android Studio - Click Run
- Select
iosApp
from Run Configurations in Android Studio. Be aware of editing the Run Configurations to select corresponding iOS target devices. - Click Run
- Open the project from Android Studio
- Execute the command
./gradle :desktop:run
to run the desktop module.
This project is licensed under the MIT License.