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
280
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
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
580
Kotlin Multiplatform at Stable and Beyond (Kotlin Vienna, October 2024)
zsmb
2
510
Composing an API the *right* way (Droidcon New York 2024)
zsmb
2
780
Composing an API the *right* way (Droidcon Berlin 2024)
zsmb
2
1.3k
What’s New in Compose Multiplatform - A Live Tour (droidcon Berlin 2024)
zsmb
2
610
Build a Multiplatform Future with Kotlin (Craft Conference 2024)
zsmb
1
240
Simplifying Build Configuration with Amper (KotlinConf 2024)
zsmb
3
260
Building with Kotlin for Android and Beyond (Google I/O Extended 2024 Budapest)
zsmb
2
700
Kotlin Multiplatform at Stable and Beyond (Android Makers 2024)
zsmb
2
1.6k
Other Decks in Programming
See All in Programming
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
250
Rubyでつくるパケットキャプチャツール
ydah
0
170
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
770
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
180
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
300
『改訂新版 良いコード/悪いコードで学ぶ設計入門』活用方法−爆速でスキルアップする!効果的な学習アプローチ / effective-learning-of-good-code
minodriven
28
4.1k
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
130
Flatt Security XSS Challenge 解答・解説
flatt_security
0
730
Beyond ORM
77web
11
1.6k
Amazon Nova Reelの可能性
hideg
0
190
Findy Team+ Awardを受賞したかった!ベストプラクティス応募内容をふりかえり、開発生産性向上もふりかえる / Findy Team Plus Award BestPractice and DPE Retrospective 2024
honyanya
0
140
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
170
Featured
See All Featured
A better future with KSS
kneath
238
17k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
Navigating Team Friction
lara
183
15k
Gamification - CAS2011
davidbonilla
80
5.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
BBQ
matthewcrist
85
9.4k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Writing Fast Ruby
sferik
628
61k
YesSQL, Process and Tooling at Scale
rocio
170
14k
Automating Front-end Workflow
addyosmani
1366
200k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Code Review Best Practice
trishagee
65
17k
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]