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
Intro to Kotlin/Native and Multi-platform Projects
Search
Dmitriy Gorbunov
May 29, 2019
Programming
31
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Intro to Kotlin/Native and Multi-platform Projects
Dmitriy Gorbunov
May 29, 2019
More Decks by Dmitriy Gorbunov
See All by Dmitriy Gorbunov
RxPM-library
dmdevgo
0
75
RxPM vs MVP vs MVVM
dmdevgo
0
240
Other Decks in Programming
See All in Programming
カツオ、ご期待ください
suneo3476
0
190
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
150
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
610
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
230
Jetpack Compose Mechanisms
skydoves
3
820
R8 の設定見直しでアプリサイズ削減
andpad
0
220
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
160
AWSに止められる覚悟してますか?
morizo_1984
2
540
気持ちぃ〜角丸 Squircle
ryu1013
0
310
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
0
1.4k
Featured
See All Featured
The agentic SEO stack - context over prompts
schlessera
0
970
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
Prompt Engineering for Job Search
mfonobong
0
520
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
550
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
エンジニアに許された特別な時間の終わり
watany
109
250k
Transcript
Введение в Kotlin/Native и мультиплатформенные проекты Дмитрий Горбунов Lead Android
Developer
Native vs Cross-platform
Multi-platform Server Kotlin/JVM iOS Kotlin/Native Android Kotlin/JVM Browser Kotlin/JS Common
code
Hello, Kotlin/Native fun main(args: Array<String>) { println("Hello, Kotlin/Native!") }
Kotlin/Native Kotlin Compiler LLVM .kt Intermediate Representation (IR) 10101 01010
10101
Kotlin/Native • Маленький размер рантайма (Hello World ~ 850 KB)
• Встроенный GC • C Interop • Objective-C and Swift Interop
Kotlin/Native Target Platforms ❏ Windows (x86_64) ❏ Linux (x86_64, arm32,
MIPS, MIPS little endian) ❏ MacOS (x86_64) ❏ iOS (arm32, arm64, x64) ❏ Android (arm32, arm64) ❏ STM32 ❏ WebAssembly (wasm32)
Kotlin/Native Binaries ➔ Executable file (*.kexe) ➔ Kotlin/Native library (*.klib)
➔ Apple framework (Obj-C framework) ➔ Dynamic library (*.so, *.dylib, *.dll) ➔ Static library
Platform-Specific Declarations // Common expect fun platformName(): String // Android
actual fun platformName(): String { return "Android ${Build.VERSION.RELEASE}" } // iOS actual fun platformName(): String { return UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion }
Platform-Specific Declarations // Common expect fun platformName(): String // Android
actual fun platformName(): String { return "Android ${Build.VERSION.RELEASE}" } // iOS actual fun platformName(): String { return UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion }
Multiplatform Module Common main expect class Bar fun foo(b: Bar)
{} Android main actual class Bar {} iOS main actual class Bar {}
Multiplatform Project Android-приложение (Android Studio) iOS-приложение (Xcode) Мультиплатформенный модуль
Multiplatform Module
Multiplatform Module expect fun platformName(): String
Multiplatform Module import platform.UIKit.UIDevice actual fun platformName(): String { return
UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion }
Multiplatform Module import android.os.Build actual fun platformName(): String { return
"Android ${Build.VERSION.RELEASE}" }
Shared Code Android View Presenter Repository DTO iOS View Interactor
Entity API DB SDK
Shared Code Android View Presenter Repository DTO iOS View Interactor
Entity API DB SDK
Shared Code Android View Presenter Repository DTO iOS View Interactor
Entity API DB SDK
Shared Code Android View Presenter Repository DTO iOS View Interactor
Entity API DB SDK KTOR SQLDelight kotlinx serialization ?
Shared Code Android View ViewModel ? Repository DTO iOS View
Interactor Entity API DB SDK KTOR SQLDelight kotlinx serialization ?
Issues • Multi-threaded coroutines https://github.com/Kotlin/kotlinx.coroutines/issues/462 • UI dispatcher for iOS
https://github.com/Kotlin/kotlinx.coroutines/issues/470 • Kotlin Generics to Swift Generics https://github.com/JetBrains/kotlin-native/issues/2429 • Kotlinx.serialization https://github.com/Kotlin/kotlinx.serialization/issues/395
Links • Официальный туториал https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html • Семпл приложения под Android
и iOS https://github.com/MobileUpLLC/Multiplatform-Sample • KotlinConf App - пример рабочего приложения от Jetbrains https://github.com/JetBrains/kotlinconf-app
Спасибо! Дмитрий Горбунов email:
[email protected]
telegram: @dmdev Habr: https://habr.com/ru/users/dmdev/posts/ RxPM:
https://github.com/dmdevgo/RxPM