Slide 1

Slide 1 text

Payments to grow your world You’ll 💜 Kotlin and not only for Android! - 1

Slide 2

Slide 2 text

- 2 Yassine Benabbas DevRel @worldline @yostane linkedin.com/in/benabbasyassine Ibrahim Gharbi DevRel @worldline @__brah linkedin.com/in/Ibrahim.gharbi

Slide 3

Slide 3 text

What can we do with Kotlin today ? - 3

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 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) ?

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 Librairies tierces Composables Navigation Ressources/i18n ✅ ✅ ✅ Documentation via Jetpack compose Navigation library multiplatform (2024) Painter-ressource, font, string ressources (2024) ViewModel ✅ View model multiplatform available (2024) KMP : Architecture (3/3) Database ✅ SQLDelight, Realm (NoSQL) Room Database (2024) User preferences ✅ Jetpack datastore-preferences, Multiplatform-Settings, Kstore 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 Skia Behind compose multiplatform (https://github.com/JetBrains/skiko)

Slide 12

Slide 12 text

DEMO TIME KMP + compose - 12

Slide 13

Slide 13 text

Kotlin for the backend - 13

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

Ktor server example - 16 Routes

Slide 17

Slide 17 text

Ktor server Demo - 17

Slide 18

Slide 18 text

Kotlin for the Data science - 18

Slide 19

Slide 19 text

Jupyter Notebook • File (ipynb) that contains markdown and executable code • Can be run from webapps (Jupyter lab, Datalore, ...) and IDEs (VSCode, IntelliJ, ...) • Code exécution requires a (kernel) for the target language • Python kernel is available by default and many others are available - 19

Slide 20

Slide 20 text

Kotlin notebook Demo - 20

Slide 21

Slide 21 text

Notable and new language features - 21

Slide 22

Slide 22 text

Native null safety in Kotlin • Compile errors • Syntactic features (elvis operator) - 22 • Not supported by javac (use IDE or tooling) • Non standardized (JDK + library annotations) • No syntactic features • Do not work with generics • Etc.

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

Et plein d’autres propositions 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 27

Slide 27 text

Conclusion - 27

Slide 28

Slide 28 text

- 28 KMP: improvements / expectations Architecture o WASM complete support on compose for web o BDD ❑ EXPOSED or Room ? ❑ SQLDelight: driver instatiate, sq file generation, driver for Webworker o kotlinx.coroutines : more dispatchers Tooling o A simpler build .gradle config ( with fleet & Ampere ?) o iOS ❑ xcodebuild on gradle native support ❑ Swift Package Manager (SPM) ❑ iOS support in IntelliJ ❑ logging logging improvment on iOS

Slide 29

Slide 29 text

Kotlin ecosystem : is it time to onboard it ? ✓ Achieved milestones: KMP + Kotlin 2.0 ✓ Comprehensive ecosystem ✓ For Backend devs: serious alternative to Java ✓ For Android devs: time to open to other platforms and stack - 29

Slide 30

Slide 30 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 31

Slide 31 text

Ressources - 31 https://play.kotlinlang.org/koans https://www.youtube.com/@Kotlin https://kmp.jetbrains.com/ https://awl.li/kmp https://awl.li/kotlin https://github.com/terrakok/kmp-awesome

Slide 32

Slide 32 text

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