This is a Kotlin Multiplatform (KMP) project designed to target both Android and iOS platforms, with features such as dependency injection, network requests, and Jetpack Compose for UI development.
This project is organized into a shared module and platform-specific modules for Android and iOS. Shared business logic, such as networking and dependency injection, is placed in the shared module, while UI code is separated by platform.
- Android Studio Flamingo or later
- Xcode 14 or later (for iOS development)
- Kotlin 2.0.20
- Gradle 8.5.2
Koin is used for managing dependencies across both platforms, allowing for shared ViewModels and DI configurations.
koin-core
koin-android
koin-androidx-compose
koin-compose-viewmodel
Ktor handles HTTP networking, with support for different engines across platforms (OkHttp for Android, Darwin for iOS). Serialization is done via kotlinx.serialization
.
ktor-client-core
ktor-client-okhttp
ktor-client-darwin
ktor-client-content-negotiation
ktor-serialization-kotlinx-json
On Android, we are using Jetpack Compose for declarative UI development. Compose components are integrated with ViewModels through Koin.
androidx-activity-compose
navigation-compose
androidx-lifecycle-runtime-compose
We use several Gradle plugins to simplify project configuration:
kotlin-multiplatform
android-application
android-library
compose-compiler
kotlin-serialization
- Clone the repository.
- Open the project in Android Studio.
- Sync the project with Gradle files.
- Build and run the Android app.
- Open
iosApp
in Xcode. - Build and run the iOS app using the desired simulator or physical device.
The shared module contains platform-independent business logic. This includes networking with Ktor, dependency injection with Koin, and Kotlin coroutines for concurrency.
To make changes to shared code:
- Modify the code in the
/shared
module. - Rebuild the project.
- Dependency Injection: Shared ViewModels across platforms using Koin.
- Networking: Ktor for HTTP requests with engine-specific implementations for Android and iOS.
- Jetpack Compose UI: Modern declarative UI for Android.
- Serialization: Using Kotlinx Serialization to handle JSON data in a cross-platform manner.
This project is licensed under the MIT License - see the LICENSE file for details.