Migrate Android app to ComposeMultiplatform

Daniyar Nurgaliyev
1 min readJun 21, 2024

--

We would first create a simple one screen ToDo app with Room database and Koin as dependency injection and would gradually migrate to KotlinMultiplatform (KMP) and then to ComposeMultiplatform (CMP).

We would not implement Navigation, Network, database migrations topics, and would not write UI in SwiftUI.

The idea is to demonstrate that the app written for Android canbe run on iOS devices.

Steps that we would follow:

  1. Create Initial Android Project
  2. Implement Dependency Injection (DI) with Koin
  3. Implement Room Database (Room)
  4. Integrate Room database with entities, DAO, and repository
  5. Implement UI with Jetpack Compose
  6. Implementing KMP in Android App
  7. Integrating KMP with an Android App
  8. Create iOS project in KMP
  9. Integrating KMP with an iOS App
  10. Implementing DI in KMP with Koin
  11. Implementing Database in KMP with Room
  12. Migrate business logic (Room and VM)
  13. Move Android UI to KMP or migrate KMP to CMP

Technical stack for the Clean Android app, KMP and CMP would be:

  • Local database: Room
  • Dependency injection - Koin
  • Navigation: only 1 screen
  • Network: no network fetching
  • UI: Jetpack compose

1. Create Initial Android Project

Create Clean Android Project using wizard. For UI it should be Jetpack compose only, without xml layouts.

Hint: Checkout main branch

--

--