Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
89
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
92
Boris Farber & Nikita Kozlov - The_Build_Side_of_Android_App
droidcon_berlin_2018
0
230
Zan Markan - The state of Kotlin
droidcon_berlin_2018
0
90
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
340
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
Workers Cache を知る
syumai
0
370
contenteditable と日本語入力に向き合う
colorful12
0
200
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
ActionController meets Protocol Buffers
sorah
0
550
Domain-Driven Transformation
hschwentner
2
2.3k
Next.js: The final boss of Web Performance
guaca
0
280
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
430
R8 の設定見直しでアプリサイズ削減
andpad
0
220
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
790
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
Agents on Rails - Rails at Scale 2026
irinanazarova
0
570
Featured
See All Featured
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
59k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
480
We Have a Design System, Now What?
morganepeng
55
8.4k
Scaling GitHub
holman
464
140k
Between Models and Reality
mayunak
4
500
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
480
The untapped power of vector embeddings
frankvandijk
2
1.9k
Ethics towards AI in product and experience design
skipperchong
2
440
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
520
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
360
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