This project is a reimplementation of the Kotlin Multiplatform (KMP) tutorial 'Create a multiplatform app using Ktor and SQLDelight' using Jetpack Compose for Mobile Multiplatform. It demonstrates how to build a cross-platform application that runs on both Android and iOS using shared Kotlin code and Compose for UI.
- Kotlin Multiplatform: Shared business logic across Android and iOS.
- Jetpack Compose: Modern UI toolkit for building native UIs.
- Compose for Multiplatform: Compose UI components for both Android and iOS.
- Dependency Injection: Using Koin for dependency management.
- Networking: Using Ktor for making network requests.
- Database: Using SQLDelight for local database management.
- Pull to Refresh: Implemented using dev.materii.pullrefresh.
commonMain: Contains shared code for both Android and iOS.androidMain: Contains Android-specific code.iosMain: Contains iOS-specific code.
- Compose: For building UI.
- Koin: For dependency injection.
- Ktor: For networking.
- SQLDelight: For database management.
- Coil: For image loading.
-
Clone the repository:
git clone https://github.com/yourusername/kmplaunches.git cd kmplaunches -
Open the project in Android Studio:
- Use Android Studio Arctic Fox or later.
-
Build the project:
- Sync the project with Gradle files.
- Build the project to download all dependencies.
- check your system with KDoctor
- install JDK 17 or higher on your machine
- add
local.propertiesfile to the project root and set a path to Android SDK there
To run the application on android device/emulator:
- open project in Android Studio and run imported android run configuration
To build the application bundle:
- run
./gradlew :composeApp:assembleDebug - find
.apkfile incomposeApp/build/outputs/apk/debug/composeApp-debug.apkRun android simulator UI tests:./gradlew :composeApp:pixel5Check
To run the application on iPhone device/simulator:
- Open
iosApp/iosApp.xcprojectin Xcode and run standard configuration - Or use Kotlin Multiplatform Mobile plugin for Android Studio
Run iOS simulator UI tests:
./gradlew :composeApp:iosSimulatorArm64Test
Run the desktop application: ./gradlew :composeApp:run
Run desktop UI tests: ./gradlew :composeApp:jvmTest
This project is licensed under the MIT License. See the LICENSE file for more details.
Special thanks to:
- Kotlin Multiplatform
- Jetpack Compose
- Koin
- Ktor
- SQLDelight
- Coil
- PullRefreshLayout
- Create a multiplatform app using Ktor and SQLDelight
- Add Network Status Detection
- Add Routes and Navigation with Voyager
- Add Unit Tests (lol)
- Add Flow testing with Turbine.
- Add UI Tests with Jetpack Compose Testing
- CI/CD with GitHub Actions
Pre-commit hooks with Ktlint or Detekt- Rename the app to CMPLaunches
- A decent looking error screen (that captures a few different http errors into a few easily readable messages)
- Searching, Sorting and Filtering
- Responsive UI layout for tablets and desktop
- Preview for Jetpack Compose using the workaround for lack of multiplatform preview support shown here.
- Desktop support (Might as well!)