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
Said Tahsin Dane_Tobias Heine - Droidcon (Code)...
Search
droidcon Berlin
July 12, 2018
Programming
80
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Said Tahsin Dane_Tobias Heine - Droidcon (Code) Sharing is caring - An Introduction to Kotlin Multiplatform projects
droidcon Berlin
July 12, 2018
More Decks by droidcon Berlin
See All by droidcon Berlin
Jon Markoff - Best practice for apps
droidcon_berlin_2018
0
230
Jon Markoff - Voice in the enterprise
droidcon_berlin_2018
0
85
Michael Jess - Enabling enterprise mobility with SAP
droidcon_berlin_2018
0
140
Ronen Sabag - Lean async code with Kotlin’s coroutines
droidcon_berlin_2018
0
89
Boris Farber & Nikita Kozlov - The_Build_Side_of_Android_App
droidcon_berlin_2018
0
220
Zan Markan - The state of Kotlin
droidcon_berlin_2018
0
88
Miquel Beltran - No More □ (tofu) Mastering Emoji on Android
droidcon_berlin_2018
0
150
Laurent Gasser & Jeremy Rochot - Sharing a success story - A low cost, Customer driven and co-developed Android EMM
droidcon_berlin_2018
0
330
Hoi Lam - Adding ML Kit to Android Things And some TensorFlow things
droidcon_berlin_2018
1
250
Other Decks in Programming
See All in Programming
PyO3 で既存 Python 評価器を Rust core 化する ー wasm-bindgen でブラウザにも配るための設計
kdash
1
460
ALB ログから Trace を気合で繋げる技術
fohte
7
880
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
150
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.3k
Press start. Python's next generation.
willingc
PRO
3
310
私のClaude Code活用法 (個人開発編) - PHPerKaigi mini #4(2026/08/24)
panda_program
1
210
AIと壁打ちしながら進めるコスト管理
fufuhu
2
1.9k
業務時間外もAIに働いてもらう話
colorful12
3
10k
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
560
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
0
440
Deep dive into the select statement (GopherCon UK)
jespino
0
170
「AI時代、配布するPythonコードをどう守るか: 難読化の実験と判断軸」 #PyconJP2026
pkshadeck
PRO
2
170
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.8k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
560
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
290
The Pragmatic Product Professional
lauravandoore
37
7.4k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Six Lessons from altMBA
skipperchong
29
4.5k
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
520
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
What's in a price? How to price your products and services
michaelherold
247
13k
Transcript
(Code) Sharing is caring An Introduction to Kotlin Multiplatform Projects
Said Tahsin Dane Tobias Heine
Why sharing code? Costs Quality Sharing code within the company
Feature Teams
None
Why is sharing logic difficult?
None
None
None
How can you fix this ?
None
“The delivery mechanism is an annoying detail”
“Screaming Architecture”
Kotlin Multiplatform Project JVM out of the box JS kotlinjs
Native Kotlin/Native
apply plugin: 'org.jetbrains.kotlin.platform.common' dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version" testCompile "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version" testCompile
"org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin_version" } Kotlin Multiplatform Project - Common
apply plugin: 'kotlin-platform-jvm' dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" expectedBy project(":data-common") expectedBy
project(":io-common") testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" } Kotlin Multiplatform Project - Common JVM
apply plugin: 'kotlin' apply plugin: 'application' dependencies { compile project(':common-jvm')
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile 'no.tornado:tornadofx:1.7.14' testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" } mainClassName = 'com.novoda.gol.GameOfLife' Kotlin Multiplatform Project - Desktop Client
apply plugin: 'kotlin-platform-android' apply plugin: 'com.android.application' dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
expectedBy project(":common") testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" } Kotlin Multiplatform Project - Android Platform
Kotlin Multiplatform Project - Expected/Actual Common JVM
Game of Life
expect class GameLoop { fun startWith(intervalMs: Int, onTick: () ->
Unit) fun stop() fun isLooping(): Boolean } GameLoop - Common
actual class GameLoop { private var gameLoop: Disposable? = null
actual fun startWith(intervalMs: Int, onTick: () -> Unit) { gameLoop = Flowable.interval(intervalMs.toLong(), TimeUnit.MILLISECONDS) .subscribe { onTick() } } actual fun stop() = gameLoop!!.dispose() actual fun isLooping() = gameLoop != null } GameLoop - JVM
actual class GameLoop { private var gameloop: Int? = null
actual fun startWith(intervalMs: Int, onTick: () -> Unit) { gameloop = window.setInterval({ onTick() }, intervalMs) } actual fun stop() = window.clearInterval(gameloop!!) actual fun isLooping() = gameloop != null } GameLoop - JS
actual class GameLoop { private var gameloop: NSTimer? = null
actual fun startWith(intervalMs: Int, onTick: () -> Unit) { gameloop = NSTimer(NSDate(), 0.5, true, { onTick() }) NSRunLoop.currentRunLoop().addTimer(gameloop!!, NSRunLoopCommonModes) } actual fun stop() = gameloop!!.invalidate() actual fun isLooping() = gameloop != null } GameLoop - Kotlin/Native
apply plugin: 'konan' konan.targets = ['iphone', 'iphone_sim'] konanArtifacts { framework('KotlinGameOfLife')
{ enableMultiplatform true enableDebug true } } dependencies { expectedBy project(':common') } Kotlin/Native Gradle Plugin
Kotlin/Native AppCode Plugin
Kotlin/Native AppCode Plugin
What else did we share? Entities Models Presentation Layer Passive
Views What is left for platform-clients?
Multiplatform Libs are coming! K/N Coroutines are coming - slowly!
HttpClient Mocking library Sqlite for Kotlin multiplatform Reagent
What is missing for v1.0 ? Multithreading HTTP Reactive Code
Caching (Better) testing support Third party SDK’s (ads, tracking, ...)
References Code: https://github.com/novoda/spikes/tree/master/game-of-life-mul tiplatform Blog posts: https://blog.novoda.com/introduction-to-kotlin-multiplatform/ https://blog.novoda.com/kotlin-goes-ios/
Thanks for listening! Any Questions? Tahsin & Tobi