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
Intro to Kotlin/Native and Multi-platform Projects
Search
Dmitriy Gorbunov
May 29, 2019
Programming
1
26
Intro to Kotlin/Native and Multi-platform Projects
Dmitriy Gorbunov
May 29, 2019
Tweet
Share
More Decks by Dmitriy Gorbunov
See All by Dmitriy Gorbunov
RxPM-library
dmdevgo
0
68
RxPM vs MVP vs MVVM
dmdevgo
0
230
Other Decks in Programming
See All in Programming
Data-Centric Kaggle
isax1015
2
670
ThorVG Viewer In VS Code
nors
0
750
Basic Architectures
denyspoltorak
0
490
Implementation Patterns
denyspoltorak
0
230
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.6k
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
250
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.6k
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
3.4k
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.7k
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
850
Vibe codingでおすすめの言語と開発手法
uyuki234
0
190
AIエージェントの設計で注意するべきポイント6選
har1101
6
3.2k
Featured
See All Featured
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.8k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
290
Claude Code のすすめ
schroneko
67
210k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.8k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
120
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.1k
The Cost Of JavaScript in 2023
addyosmani
55
9.4k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
82
Building an army of robots
kneath
306
46k
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