Android
Desktop iOS
actual
Common
expect
actual actual
Slide 28
Slide 28 text
Android
Desktop
iOS
Common expect
actual
actual
actual
Slide 29
Slide 29 text
Android
Desktop
iOS
Common fun getPlatform(): String
expect
actual
actual
actual
Slide 30
Slide 30 text
Android
Desktop
iOS
Common fun getPlatform(): String
fun getPlatform(): String =
"Java ${System.getProperty("java.version")}"
expect
actual
actual
actual
Slide 31
Slide 31 text
Android
Desktop
iOS
Common fun getPlatform(): String
fun getPlatform(): String =
"Java ${System.getProperty("java.version")}"
fun getPlatform(): String =
"Android ${Build.VERSION.SDK_INT}"
expect
actual
actual
actual
Slide 32
Slide 32 text
Android
Desktop
iOS
Common fun getPlatform(): String
fun getPlatform(): String =
"Java ${System.getProperty("java.version")}"
fun getPlatform(): String =
"iOS ${UIDevice.currentDevice.systemVersion}"
fun getPlatform(): String =
"Android ${Build.VERSION.SDK_INT}"
expect
actual
actual
actual
Slide 33
Slide 33 text
Multiplatform libraries
Slide 34
Slide 34 text
github.com/terrakok/kmp-awesome
Slide 35
Slide 35 text
.kt .kt
.kt
Android
Desktop iOS
Common
import io.ktor.client.*
suspend fun loadHtml(): String {
val client = HttpClient()
val response = client.get("https://kotlinlang.org")
return response.body()
}