Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Pragmatic Code Sharing with Kotlin Multiplatfor...
Search
Márton Braun
March 17, 2024
Programming
1
420
Pragmatic Code Sharing with Kotlin Multiplatform (Simonyi 2024)
Márton Braun
March 17, 2024
Tweet
Share
More Decks by Márton Braun
See All by Márton Braun
Blazing Fast UI Development with Compose Hot Reload (droidcon Berlin 2025)
zsmb
1
27
Blazing Fast UI Development with Compose Hot Reload (Android Budapest September 2025)
zsmb
1
31
Building with AI in Kotlin (DroidKaigi 2025)
zsmb
2
34
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
420
Building a macOS screen saver with Kotlin (KotlinConf 2025)
zsmb
1
140
Compose Hot Reload is here, stop re-launching your apps! (Android Makers 2025)
zsmb
1
780
Building a macOS screen saver with Kotlin (Android Makers 2025)
zsmb
1
320
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
810
Kotlin Multiplatform at Stable and Beyond (Kotlin Vienna, October 2024)
zsmb
2
800
Other Decks in Programming
See All in Programming
Things You Thought You Didn’t Need To Care About That Have a Big Impact On Your Job
hollycummins
0
230
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
0
300
バッチ処理を「状態の記録」から「事実の記録」へ
panda728
PRO
0
160
CSC305 Lecture 04
javiergs
PRO
0
270
XP, Testing and ninja testing ZOZ5
m_seki
3
700
Pull-Requestの内容を1クリックで動作確認可能にするワークフロー
natmark
2
520
overlayPreferenceValue で実現する ピュア SwiftUI な AdMob ネイティブ広告
uhucream
0
190
CSC305 Lecture 08
javiergs
PRO
0
220
なぜGoのジェネリクスはこの形なのか? Featherweight Goが明かす設計の核心
ryotaros
7
1.1k
Devoxx BE - Local Development in the AI Era
kdubois
0
130
CSC509 Lecture 03
javiergs
PRO
0
340
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
2
450
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
190
55k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
620
Optimising Largest Contentful Paint
csswizardry
37
3.5k
The Pragmatic Product Professional
lauravandoore
36
6.9k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.7k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Gamification - CAS2011
davidbonilla
81
5.5k
How to train your dragon (web standard)
notwaldorf
97
6.3k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
Automating Front-end Workflow
addyosmani
1371
200k
Transcript
Kotlin Multiplatform Kódmegosztás pragmatikusan Braun Márton Developer Advocate JetBrains
iOS Android Desktop Web Server
iOS Android Desktop Web Server
kotl.in/kmp-case-studies
None
None
Projekt kezdete
Projekt kezdete Kotlin/JVM .kt .class Java .java .class
Nyilvános bejelentés Projekt kezdete Open source Kotlin/JVM .kt .class Java
.java .class
Nyilvános bejelentés Projekt kezdete Open source Kotlin/JVM .kt .class Kotlin
1.0
Kotlin 1.0 Nyilvános bejelentés Projekt kezdete Open source JavaScript Kotlin/JVM
.kt .class Kotlin/JS .kt .js
Kotlin 1.0 Nyilvános bejelentés Projekt kezdete Open source Native JavaScript
Kotlin/JVM .kt .class Kotlin/Native .kt .klib|.kexe Kotlin/JS .kt .js
Kotlin 1.0 Nyilvános bejelentés Projekt kezdete Open source Native JavaScript
KMP stable
Kotlin 1.0 Nyilvános bejelentés Projekt kezdete Open source Native JavaScript
KMP stable Wasm Kotlin/JVM .kt .class Kotlin/Native .kt .klib|.kexe Kotlin/JS .kt .js Kotlin/Wasm .kt .wasm
Jetpack KMP Kotlin first Java + Kotlin Kotlin 1.0 Nyilvános
bejelentés Projekt kezdete Open source Native JavaScript KMP stable Wasm
iOS Android Desktop +
Desktop + Android iOS .kt .kt .class .framework
iOS .class .framework Desktop + Android .kt .kt
Common .kt .kt
.kt .kt .kt .kt Android Desktop iOS Common
.kt .kt .kt .kt Android Desktop iOS Common
.kt .kt .kt .kt Android Desktop iOS Common
.kt .kt .kt Android Desktop iOS Common .kt
.kt .kt .kt .kt Android Desktop iOS Common
.kt .kt .kt Android Desktop iOS Common class Person(val name:
String, var age: Int) fun greet(person: Person) { println("Hello, ${person.name}") }
.kt .kt .kt Android Desktop iOS Common fun List<Person>.duplicates(): Map<String,
Int> { return map { it.name.substringBefore(" ") } .groupingBy { it } .eachCount() .filter { (name, count) -> count > 1 } }
Android Desktop iOS actual Common expect actual actual
Android Desktop iOS Common expect actual actual actual
Android Desktop iOS Common fun getPlatform(): String expect actual actual
actual
Android Desktop iOS Common fun getPlatform(): String fun getPlatform(): String
= "Java ${System.getProperty("java.version")}" expect actual actual actual
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
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
Multiplatform libraries
github.com/terrakok/kmp-awesome
.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<String>() }
Shared logic
Shared logic Swing Desktop logic Android Views Android logic SwiftUI
iOS logic
Shared logic Swing Desktop logic Android Views Android logic SwiftUI
iOS logic
Shared logic Swing Desktop logic Android Views Android logic SwiftUI
iOS logic
Compose Multiplatform jb.gg/compose
Compose Multiplatform jb.gg/compose
Swing Desktop logic Android Views Android logic SwiftUI iOS logic
Shared logic
Desktop logic Android logic iOS logic Shared logic Shared UI
Compose Multiplatform
Desktop logic Android logic iOS logic Shared logic Shared UI
Compose Multiplatform Swing Android Views SwiftUI
Preview
None
None
None
None
None
None
None
Kotlin alapú szoftverfejlesztés VIAUAV41 Free Educational Licenses jb.gg/edulicense Kotlin Multiplatform
jb.gg/kmp Compose Multiplatform jb.gg/compose Fleet jb.gg/fleet Kotlin Multiplatform Kódmegosztás pragmatikusan zsmb.co/talks Braun Márton
[email protected]