This is the codebase for an upcoming course featuring Kotlin Multiplatform Mobile.
- Ktor (Network Client)
- SQL Delight (Caching Client)
- Kotlinx.datetime
- Jetpack Compose
- Jetpack Compose Navigation
- (Single activity, zero fragments)
- Accompanist Coil
- Hilt
- I decided to use AAC ViewModel because it gives so much state management stuff for free. Maybe in the future a shared viewmodel will be more practical. I'll talk about this in detail in the course.
- See this tweet thread if you want to do some reading: https://twitter.com/ianhlake/status/1388517293005574144
- SwiftUI
Important Android Studio and gradle configuration information for this project.
I've been using "Android Studio Arctic Fox (2020.3.1) Canary 8". I was using a newer version but had some issues. If you want to decrease the probability that you will have random issues that I did not, use the same version as me.
You can download here: Android Studio Archive.
Make sure you install this plugin. It will make your life way easier.
The Kotlin Multiplatform Mobile (KMM) plugin makes it easier to develop a Kotlin Multiplatform Project in Android Studio.
Install here: Kotlin Multiplatform Mobile Plugin
Make sure your shared build.gradle
contains this configurations
block in the android{...}
configuration section. The "getting started" guide on the kotlinlang.org website used to contain this but it doesn't anymore for some reason. Maybe it is not needed for newer versions of Canary. I'm not sure. But my projects do not build without it.
build.gradle.kts (shared)
... stuff
android {
compileSdkVersion(30)
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdkVersion(21)
targetSdkVersion(30)
}
configurations { // <--- This
create("androidTestApi")
create("androidTestDebugApi")
create("androidTestReleaseApi")
create("testApi")
create("testDebugApi")
create("testReleaseApi")
}
}
... more stuff
Make sure you have this setting in android studio:
- Mitch Tabian
- Daniele Barconcelli
- Ekaterina Petrova
- Dmitry Savvinov
- Kevin Galligan
- Kotlin conf 2019
- Ben Asher and Alec Strong
- kotlin conf 2019