A sample Kotlin Multiplatform Compose Sudoku app for Android & Desktop. Most code is shared between Android & Desktop using Kotlin Multiplatform and Jetbrains Compose.
Android
(Compose)JVM
(Compose - Win / Linux / MacOS)
- Jetpack Compose - shared UI
- Decompose - navigation and lifecycle
- Mavericks - state management using MVI. For this project I created a minimalistic multi-platform ViewModel implementation using MavericksStateStore.
- Sudoku Game Logic A Sudoku generator and solver, ported to Kotlin multi-platform.
:common:sudoku
- displays a list of todo items and a text field:common:utils
- some shared utilities, including the state management classes:common:root
- UI entrypoint and navigation logic:common:compose-ui
- platform specific UI implementations (expect/actual funs):android
- Android application:desktop
- Desktop application
The root module is integrated into Android and Desktop apps.
- 99% of the code is shared: data, business logic, presentation, navigation and UI
- View state is preserved when navigating between screens, Android configuration change, etc.
- Model-View-Intent (aka MVI) architectural pattern
./gradlew :desktop:run
./gradlew :desktop:package
# outputs are written to desktop/build/compose/binaries
Open project in Intellij IDEA or Android Studio and run "android" configuration.