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
72
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
83
Michael Jess - Enabling enterprise mobility with SAP
droidcon_berlin_2018
0
130
Ronen Sabag - Lean async code with Kotlin’s coroutines
droidcon_berlin_2018
0
86
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
87
Miquel Beltran - No More □ (tofu) Mastering Emoji on Android
droidcon_berlin_2018
0
140
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
240
Other Decks in Programming
See All in Programming
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
560
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
110
FDEが実現するAI駆動経営の現在地
gonta
2
240
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
190
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
230
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.8k
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
130
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
140
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
9
5.9k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
360
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
210
OpenSpecのproposalにbrainstormingを持たせてみた
tigertora7571
1
160
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
WENDY [Excerpt]
tessaabrams
11
39k
Crafting Experiences
bethany
1
230
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
240
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
45k
Design in an AI World
tapps
1
270
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Paper Plane
katiecoart
PRO
2
52k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
250
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
550
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