Migrate Android app to ComposeMultiplatform
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:
- Create Initial Android Project
- Implement Dependency Injection (DI) with Koin
- Implement Room Database (Room)
- Integrate Room database with entities, DAO, and repository
- Implement UI with Jetpack Compose
- Implementing KMP in Android App
- Integrating KMP with an Android App
- Create iOS project in KMP
- Integrating KMP with an iOS App
- Implementing DI in KMP with Koin
- Implementing Database in KMP with Room
- Migrate business logic (Room and VM)
- 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
Github Link
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