Files
compose-multiplatform/examples/todoapp
Ryan Simon a749ade5d7 Fix issue where Android app is not launchable (#1758)
Launcher `Activity` should have `android:exported` attributes set to `true` so that app launchers have permission to launch the `Activity`.

Check official docs for more information: https://developer.android.com/guide/topics/manifest/activity-element#exported
2022-01-27 11:16:30 +03:00
..
2022-01-24 13:16:39 +03:00
2021-10-29 01:10:27 +03:00
2022-01-24 13:16:39 +03:00
2022-01-24 13:16:39 +03:00
2020-10-19 18:42:05 +01:00
2020-10-19 18:42:05 +01:00

An example of Kotlin Multiplatform todo app with shared Android/Desktop Compose UI and SwiftUI (not Compose) iOS.

This example supports the following targets:

  • Android (Compose)
  • Desktop/JVM (Compose)
  • Web/JavaScript (Compose)
  • iOS (SwiftUI, not Compose)

Libraries used:

  • Jetpack Compose - shared UI
  • Decompose - navigation and lifecycle
  • MVIKotlin - presentation and business logic
  • Reaktive - background processing and data transformation
  • SQLDelight - data storage

There are multiple modules:

  • :common:utils - just some useful helpers
  • :common:database - SQLDelight database definition
  • :common:main - displays a list of todo items and a text field
  • :common:edit - accepts an item id and allows editing
  • :common:root - navigates between main and edit screens
  • :common:compose-ui - Shared Compose UI for Android and Desktop
  • :android - Android application
  • :desktop - Desktop application
  • :web - Web browser application + Compose Web UI
  • ios - iOS Xcode project

The root module is integrated into Android, Desktop and iOS (non-Compose) apps.

Features:

  • 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
  • Pluggable UI - Compose UI for Android, Desktop and Web, SwiftUI (not Compose) for iOS

Running desktop application

./gradlew :desktop:run

Building native desktop distribution

./gradlew :desktop:package
# outputs are written to desktop/build/compose/binaries

Running Android application

Open project in Intellij IDEA or Android Studio and run "android" configuration.

Running Web browser application

./gradlew :web:jsBrowserDevelopmentRun

Running iOS application

Open and build the Xcode project located in ios folder.

Desktop