@RussHWolf ( or )
What's New in Kotlin
Multiplatform
Droidcon Americas 2020
Russell Wolf
Slide 2
Slide 2 text
No content
Slide 3
Slide 3 text
Kotlin
is a language for...
• Android
• JVM (Server, Desktop)
• JS (Browser, Node)
• Native (LLVM, C interop)
• iOS (Objective-C Interop)
Slide 4
Slide 4 text
Kotlin Multiplatform
• Common code compiles to
multiple targets
• Platform-specific code can
interop with that platform
• Flexible - share only what makes
sense to your use-case
Slide 5
Slide 5 text
Kevin Galligan
"Shared UI is a history of pain and failure.
Shared logic is the history of computers."
Slide 6
Slide 6 text
Mobile is the killer app for
Kotlin Multiplatform
Slide 7
Slide 7 text
https://kotlinlang.org/lp/mobile/
Slide 8
Slide 8 text
MPP
KMP
KMM
Slide 9
Slide 9 text
Shared Code
Slide 10
Slide 10 text
Shared Code
Android Common iOS
Slide 11
Slide 11 text
Shared Code
Android Common iOS
Slide 12
Slide 12 text
Shared Code
Android Common iOS
Slide 13
Slide 13 text
Shared Code
Android Common iOS
Slide 14
Slide 14 text
Shared Code
Android Common iOS
Slide 15
Slide 15 text
Shared Code
Android Common iOS
Slide 16
Slide 16 text
Shared Code
Android Common iOS
Slide 17
Slide 17 text
Architecture
Slide 18
Slide 18 text
Common
iOS
Framework
Android
AAR
Architecture
Slide 19
Slide 19 text
Common
iOS
Framework
Android
AAR
Android
App
iOS
App
Architecture
kotlinx-coroutines
https://github.com/Kotlin/kotlinx.coroutines
• Suspend functions and Flows
• Separate single-threaded and multithreaded versions
• 1.3.9 vs 1.3.9-native-mt
Slide 41
Slide 41 text
ktor
https://github.com/ktorio/ktor
• Http client
• Uses native-mt coroutines version
Slide 42
Slide 42 text
kotlinx-serialization
https://github.com/Kotlin/kotlinx.serialization
• Multi-format serialization
• First stable release!
• API changes
• New docs
Slide 43
Slide 43 text
kotlinx-datetime
https://github.com/Kotlin/kotlinx-datetime
• New!
• Small API surface
• Report issues and use-cases
Slide 44
Slide 44 text
Jetpack Compose?
Slide 45
Slide 45 text
Community libs
• SqlDelight
• Multiplatform Settings
• Stately
• Koin, Kodein
• More at:
• https://github.com/AAkira/Kotlin-Multiplatform-Libraries
• https://kotlinlang.org/lp/mobile/ecosystem/