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
Kotlin Beyond Android: 2019
Search
Guillermo Orellana
November 25, 2019
Programming
410
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Kotlin Beyond Android: 2019
Guillermo Orellana
November 25, 2019
More Decks by Guillermo Orellana
See All by Guillermo Orellana
All stacks Kotlin
wiyarmir
1
560
Full Stack Kotlin
wiyarmir
2
400
Kotlin beyond Android
wiyarmir
2
340
"Bring your Kotlin to Work" Day
wiyarmir
1
1.6k
Other Decks in Programming
See All in Programming
Creating Composable Callables in Contemporary C++
rollbear
0
130
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
AI時代のUIはどこへ行く?その2!
yusukebe
21
7.1k
Lessons from Spec-Driven Development
simas
PRO
0
190
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
170
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
510
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
130
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
160
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.1k
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
1.3k
net-httpのHTTP/2対応について
naruse
0
480
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
260
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
97
6.7k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
280
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
エンジニアに許された特別な時間の終わり
watany
107
250k
The untapped power of vector embeddings
frankvandijk
2
1.8k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Become a Pro
speakerdeck
PRO
31
6k
GraphQLとの向き合い方2022年版
quramy
50
15k
Designing for humans not robots
tammielis
254
26k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
390
Building Adaptive Systems
keathley
44
3.1k
Odyssey Design
rkendrick25
PRO
2
700
Transcript
Kotlin Beyond Android Guillermo Orellana @wiyarmir November 2019 Droidcon San
Francisco
None
We are in the US! And we are hiring in
Los Angeles! Backend, iOS, Android
None
None
None
None
Ctrl+Shift+Alt+K ⌘+⇧+⌥+K
None
None
Backend
None
fun main(args: Array<String>) { embeddedServer(Netty, 8080) { routing { get("/")
{ call.respondText("Hello World") } } }.start() } http://ktor.io/
API Tests #
@Test fun `when userId and password provided then user is
created`() = testApp(mockStorage) { handleRequest(HttpMethod.Post, endpoint) { addHeader( HttpHeaders.ContentType, ContentType.Application.FormUrlEncoded.toString() ) setBody( listOf( "userId" to testId, "password" to testPassword ).formUrlEncode() ) }.apply { assertThat(response.status(), equalTo(HttpStatusCode.Created)) }
Deploying
None
$ git push heroku master
Counting objects: 155, done. Delta compression using up to 36
threads. Compressing objects: 100% (50/50), done. Writing objects: 100% (89/89), 17.45 KiB | 0 bytes/s, done. Total 89 (delta 33), reused 75 (delta 19) remote: -----> Cleaning up!!... remote: -----> Building keynotedex from herokuish!!... remote: -----> Adding BUILD_ENV to build environment!!... remote: -----> Gradle app detected remote: -----> Installing JDK 1.8!!... done remote: -----> Building Gradle app!!... remote: -----> executing ./gradlew stage remote: To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https:!//docs.gradle.org/4.10.2/userguide/gradle_daemon.html. remote: Daemon will be stopped at the end of the build stopping after processing remote: > Task :buildSrc:discoverMainScriptsExtensions remote: > Task :buildSrc:compileKotlin remote: > Task :buildSrc:compileJava NO-SOURCE remote: > Task :buildSrc:compileGroovy NO-SOURCE remote: > Task :buildSrc:processResources NO-SOURCE remote: > Task :buildSrc:classes UP-TO-DATE remote: > Task :buildSrc:inspectClassesForKotlinIC remote: > Task :buildSrc:jar remote: > Task :buildSrc:assemble remote: > Task :buildSrc:discoverTestScriptsExtensions remote: > Task :buildSrc:compileTestKotlin NO-SOURCE remote: > Task :buildSrc:compileTestJava NO-SOURCE remote: > Task :buildSrc:compileTestGroovy NO-SOURCE remote: > Task :buildSrc:processTestResources NO-SOURCE remote: > Task :buildSrc:testClasses UP-TO-DATE remote: > Task :buildSrc:test NO-SOURCE remote: > Task :buildSrc:check UP-TO-DATE remote: > Task :buildSrc:build remote: > Task :backend:clean UP-TO-DATE remote: > Task :backend:discoverMainScriptsExtensions remote: > Task :common:compileJava NO-SOURCE remote: > Task :common:compileKotlinCommon remote: > Task :common:processResources NO-SOURCE remote: > Task :common:classes remote: > Task :common:inspectClassesForKotlinIC remote: > Task :common:jar remote: > Task :common-jvm:discoverMainScriptsExtensions remote: > Task :common-jvm:compileKotlin
remote: > Task :web:runDceKotlinJs remote: > Task :web:compileJava NO-SOURCE remote:
> Task :web:classes remote: > Task :web:compileTestKotlin2Js NO-SOURCE remote: > Task :web:runDceTestKotlinJs NO-SOURCE remote: > Task :web:webpack-config remote: > Task :web:webpack-helper SKIPPED remote: > Task :web:webpack-bundle remote: > Task :web:bundle remote: > Task :web:inspectClassesForKotlinIC remote: > Task :web:jar remote: > Task :web:assemble remote: > Task :web:karma-config SKIPPED remote: > Task :web:karma-run-single SKIPPED remote: > Task :web:compileTestJava NO-SOURCE remote: > Task :web:testClasses UP-TO-DATE remote: > Task :web:test NO-SOURCE remote: > Task :web:check UP-TO-DATE remote: > Task :web:build remote: > Task :backend:copyWebBundle remote: > Task :backend:processReleaseResources remote: > Task :backend:releaseClasses remote: > Task :backend:releaseJar remote: > Task :backend:release remote: > Task :stage remote: remote: Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. remote: Use '!--warning-mode all' to show the individual deprecation warnings. remote: See https:!//docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings remote: remote: BUILD SUCCESSFUL in 9m 8s remote: 32 actionable tasks: 31 executed, 1 up-to-date remote: w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions remote: -----> Discovering process types remote: Procfile declares types !-> web remote: -----> Releasing keynotedex (dokku/keynotedex:latest)!!... remote: -----> Deploying keynotedex (dokku/keynotedex:latest)!!... remote: -----> Attempting to run scripts.dokku.predeploy from app.json (if defined) remote: -----> App Procfile file found (/home/dokku/keynotedex/DOKKU_PROCFILE) remote: -----> DOKKU_SCALE file found (/home/dokku/keynotedex/DOKKU_SCALE) remote: =====> web=1 remote: -----> Attempting pre-!flight checks remote: -----> Attempt 1/5 Waiting for 5 seconds !!...
$ git push origin master $ git push heroku master
None
$ git push origin master
None
None
None
Web
override fun HTML.apply() { head { meta { charset =
"utf-8" } meta { name = "viewport" content = "width=device-width, initial-scale=1.0" } title { insert(caption) } insert(head) } body { div { id = "content" }
override fun HTML.apply() { head { meta { charset =
"utf-8" } meta { name = "viewport" content = "width=device-width, initial-scale=1.0, shrink-to-fit=no" } title { +"Keynotedex" } insert(head) link( rel = LinkRel.stylesheet, type = LinkType.textCss, href = "https:!//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" ) { attributes["integrity"] = "sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" attributes["crossorigin"] = "anonymous" } } body { div { id = "content" } script(src = "https:!//code.jquery.com/jquery-3.2.1.slim.min.js") { attributes["integrity"] = "sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" attributes["crossorigin"] = "anonymous" } script(src = "https:!//cdnjs.cloud!flare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js") { attributes["integrity"] = "sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" attributes["crossorigin"] = "anonymous" } script(src = "https:!//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js") { attributes["integrity"] = "sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" attributes["crossorigin"] = "anonymous" } script { insert(bundle) } }
Kotlin JVM kotlinc
https://en.wikipedia.org/wiki/React_(JavaScript_library)
KotlinJS kotlinc-js
window.onload = { document.getElementById("content") .innerHTML = "Hola" }
dynamic
val a: dynamic = 3 a.`types?` .I.`haven't`.heard .that.name.`in`.years = ")"
https://en.wikipedia.org/wiki/React_(JavaScript_library) +
None
None
Kotlin Native kotlinc-native
None
None
None
None
Kotlin Multiplatform
Multiplatform Modules
MyModule
jvmMain androidMain iosMain jsMain commonMain MyModule
jvmMain androidMain iosMain jsMain commonMain jvmTest androidTest iosTest jsTest commonTest
MyModule
jvmMain androidMain iosMain jsMain commonMain MyModule
jvmMain androidMain iosMain jsMain commonMain
expect / actual
jvmMain androidMain iosMain jsMain commonMain MyModule
Multiplatform libraries
@Serializable data class SubmissionResponse( val submission: Submission )
httpClient.submitForm<SignInResponse>( path = Paths.signIn, formParameters = parametersOf( "userId" to listOf(userId),
"password" to listOf(password) ) )
launch { getUserProfile.execute("user1") .fold( { state = Error(it) }, {
state = Content(it) } ) }
Code sharing
Repository Domain Logic Presentation View Binding UI Network
Repository Domain Logic Presentation View Binding UI Network
Repository Domain Logic Presentation View Binding UI Network
The present
$ curl \ https:!//keynotedex.wiyarmir.es/api/v1/conferences/ \ -H 'accept: application/json'
None
None
None
The future
Kotlin 1.3.60 • New Kotlin Native targets • Symbolication of
iOS crashes • Performance • New JS plugin improvements • Multithreaded native coroutines preview
Multiplatform architecture • Don't just share code, share architectural language
• Kotlin Multiplatform an implementation detail
Wrapping up
Is the tech ready?
None
Judge by yourself
https://keynotedex.wiyarmir.es/
wiyarmir/keynotedex
wiyarmir/kotlin-multiplatform-template
Slides: https://speakerdeck.com/wiyarmir/kotlin-beyond-android-2019 Code: github.com/wiyarmir/keynotedex Templates: github.com/wiyarmir/kotlin-multiplatform-template Contact: twitter.com/@wiyarmir