Slide 1

Slide 1 text

Payments to grow your world You will Becoming a fullstack developer with your Android skills DroidKaigi 2024 - 1

Slide 2

Slide 2 text

- 2 Yassine Benabbas DevRel, Teacher Lille Android User Group @yostane in/benabbasyassine Ibrahim Gharbi DevRel, Teacher @__brah in/Ibrahim.gharbi Lille / France

Slide 3

Slide 3 text

What can we develop with Kotlin? - 3 Mobile Web Desktop Backend Data science ? …

Slide 4

Slide 4 text

Already 13th years and a promising future ! Ecosystem milestones Language & Web/Desktop support - Kotlin: JVM + JS targets - Kotlin in Android Studio - KMP beta1 Mobile & Backend in the ecosystem - Coroutines - Ktor client / server 1.0 - Kotlin 1st class on Android - Jetpack compose for Android - Apple platforms interop iOS & Kotlin multiplatform - Jetpack Compose 1.0 - Compose multiplatform 1.0 (Android/Desktop) - Compose multiplatform iOS - Kotlin DSL by Default for New Gradle Builds - K2 - KMP Wizard 2011 2017 2018 2020 2021 2024

Slide 5

Slide 5 text

Kotlin Multiplatform (KMP) - 5

Slide 6

Slide 6 text

- 6 Swift UI Shared UI with Compose Multiplatform UIKit widgets Android views Swing/AWT views WebUI Common library with Kotlin Multiplatform iOS specific Logic Android specific Logic Desktop specific Logic Web specific Logic iOS APIs Android APIs Desktop JVM/APIs WEB APIs ? Kotlin Multiplatform (KMP) ? Stable Stable Alpha Beta

Slide 7

Slide 7 text

KMP : Architecture (1/3) - 7

Slide 8

Slide 8 text

Keywords: Expect / Actual KMP : Architecture : specific platform code (2/3) specific code (UIKit) specific code (Android SDK) actual fun getPlatform(): String { "Android ${android.os.Build.VERSION.SDK_INT}" } actual fun getPlatform(): String { "iOS ${UIDevice.currentDevice.systemVersion}" } expect fun getPlatform(): String

Slide 9

Slide 9 text

Composants Status Official or 3rd party libraries Composables Navigation Ressources/i18n Helped with Jetpack compose docs Navigation library multiplatform (2024) Painter-ressource, font, string ressources (2024) ViewModel View model multiplatform (2024) KMP : Architecture (3/3) Database SQLDelight, Realm, Room Database (2024) User preferences KStore, Jetpack datastore-preferences, Multiplatform-Settings Network Jetbrain Ktor Client And also o Injection : Koin o Concurrent prg : kotlinx.coroutines o Business logic components (BLoC) : Decompose

Slide 10

Slide 10 text

Kotlin for Frontend (compose) - 10

Slide 11

Slide 11 text

- 11 Title 8:30 @composable MyComposableView(){ Box( contentAlignment = Alignment.Center, modifier = Modifier.fillMaxWidth().fillMaxHeight() ) { Card( shape = RoundedCornerShape(8.dp), modifier = Modifier.padding(10.dp), ) { Column(horizontalAlignment = Alignment.CenterHorizontally) { Text( text = "Quiz", fontSize = 30.sp, modifier = Modifier.padding(all = 10.dp) ) Text(modifier = Modifier.padding(all = 10.dp), text = "A simple Quiz to discovers KMP, KMM and compose.") Button( modifier = Modifier.padding(all = 10.dp), onClick = { } ) { Text("Start the Quiz")} }} } Start the Quiz Quizz A simple Quizz to discovers KMP, KMM and compose Declarative UI with Compose multiplatform Jetpack compose Skia and Skiko Behind compose multiplatform (https://github.com/JetBrains/skiko)

Slide 12

Slide 12 text

- 12 wrl.li/quizapp

Slide 13

Slide 13 text

- 13 DEMO TIME KMP + compose

Slide 14

Slide 14 text

- 14 https://wrl.li/kmpdemo

Slide 15

Slide 15 text

- 15 KMP: WishList Architecture o WASM stable support on compose for web o BDD multiplatform support ❑ Better SQLDelight driver instantiation, WASM support ❑ Room for Web, EXPOSED support o kotlinx.coroutines : better dispatchers multiplatform support Tooling o Concise build.gradle config with Ampere o Fleet improvements ( Run config, cache, previews ) o iOS ❑ xcodebuild gradle native plugin ❑ iOS support in IntelliJ ❑ Logging improvement on iOS

Slide 16

Slide 16 text

Kotlin for the backend - 16

Slide 17

Slide 17 text

Many choices JVM Pure Kotlin Kotlin/JS - WASM - 17

Slide 18

Slide 18 text

Case study https://kotlinlang.org/lp/server-side/case-studies - 18

Slide 19

Slide 19 text

- 19

Slide 20

Slide 20 text

- 20

Slide 21

Slide 21 text

Ktor server By JetBrains • State of art server framework • Free and open source • Powerful DSLs • Plugin support - 21

Slide 22

Slide 22 text

- 22 https://wrl.li/ktorserverdemo

Slide 23

Slide 23 text

Kotlin for the Data science - 23

Slide 24

Slide 24 text

Jupyter Notebook • markdown + executable code + its output => a single « .ipynb » file • Can be executed from webapps (Jupyter lab, Datalore, ...) and IDEs (VSCode, IntelliJ, ...) • Can be rendered by many tools such as GitHub • Kernels provide language support (there is a Kotlin Kernel ) - 24

Slide 25

Slide 25 text

Getting started with data analysis - 25 Kandy plotting library Dataframe: data manipulation

Slide 26

Slide 26 text

- 26

Slide 27

Slide 27 text

- 27

Slide 28

Slide 28 text

- 29 https://wrl.li/kandystats

Slide 29

Slide 29 text

- 30 https://wrl.li/kandystats

Slide 30

Slide 30 text

- 31 https://wrl.li/kotlindatasciencedemo

Slide 31

Slide 31 text

Notable and new language features - 32

Slide 32

Slide 32 text

Explicit Backing fields (Since Kotlin 2) github.com/Kotlin/KEEP/issues/278 - 33

Slide 33

Slide 33 text

github.com/Kotlin/KEEP/issues/278 - 34 Explicit Backing fields (Since Kotlin 2)

Slide 34

Slide 34 text

youtrack.jetbrains.com/issue/KT-43871 - 35 Collection litterals (in discussion)

Slide 35

Slide 35 text

Annd many more amazing features Explicit backing field Array Literals guards Infinite loop github.com/Kotlin/KEEP x.com/kotlin Multi-field value classes Context parameters Kotlin statics and static extensions HexFormat

Slide 36

Slide 36 text

Conclusion - 37

Slide 37

Slide 37 text

Fullstack Kotlin: is it time to onboard? - 38 ✓ Achieved milestones: KMP + Kotlin 2.0 ✓Comprehensive ecosystem ✓Mature backend frameworks ✓Android devs will be delighted to be open to other platforms ( web, back, data science)

Slide 38

Slide 38 text

Case studies | Kotlin Multiplatform Development Documentation https://www.jetbrains.com/help/kotlin-multiplatform-dev/case-studies.html https://blog.worldline.tech/2022/01/26/kotlin_multiplatform.html Joanvi Orenga Sergio Casero Hernández

Slide 39

Slide 39 text

- 40 Mobile Web Desktop Backend Data science Kotlin training KMP training

Slide 40

Slide 40 text

Contacts: Thanks for your attention! Any questions ? @__brah @yostane - 41