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
370
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 New York 2025)
zsmb
1
260
Building a macOS screen saver with Kotlin (KotlinConf 2025)
zsmb
1
58
Compose Hot Reload is here, stop re-launching your apps! (Android Makers 2025)
zsmb
1
680
Building a macOS screen saver with Kotlin (Android Makers 2025)
zsmb
1
230
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
720
Kotlin Multiplatform at Stable and Beyond (Kotlin Vienna, October 2024)
zsmb
2
690
Composing an API the *right* way (Droidcon New York 2024)
zsmb
2
930
Composing an API the *right* way (Droidcon Berlin 2024)
zsmb
2
1.5k
What’s New in Compose Multiplatform - A Live Tour (droidcon Berlin 2024)
zsmb
2
740
Other Decks in Programming
See All in Programming
Benchmark
sysong
0
280
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
240
Node-RED を(HTTP で)つなげる MCP サーバーを作ってみた
highu
0
110
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
340
ReadMoreTextView
fornewid
1
490
Flutterで備える!Accessibility Nutrition Labels完全ガイド
yuukiw00w
0
120
Bytecode Manipulation 으로 생산성 높이기
bigstark
2
390
datadog dash 2025 LLM observability for reliability and stability
ivry_presentationmaterials
0
270
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
320
ASP.NETアプリケーションのモダナイズ インフラ編
tomokusaba
1
430
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
680
Select API from Kotlin Coroutine
jmatsu
1
190
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
49
14k
Into the Great Unknown - MozCon
thekraken
39
1.9k
RailsConf 2023
tenderlove
30
1.1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Gamification - CAS2011
davidbonilla
81
5.3k
Producing Creativity
orderedlist
PRO
346
40k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.4k
Build The Right Thing And Hit Your Dates
maggiecrowley
36
2.8k
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]