Upgrade to Pro — share decks privately, control downloads, hide ads and more …

You’ll 💜 Kotlin and not only for Android!

You’ll 💜 Kotlin and not only for Android!

Are you not passionate about server-side development?

For many Android developers, it is challenging to delve into backend or web technologies (too much object-oriented, verbose and/or outdated languages, dynamic typing, etc.). With the evolution of Kotlin, now everything is possible.

The idea of this conference is to show you Kotlin's advances in frontend development through Compose multiplatform (mobile, desktop, and web) and full stack development with KMP.
We will also discuss the perspectives and exciting future of the ecosystem.

yostane

July 07, 2024
Tweet

More Decks by yostane

Other Decks in Programming

Transcript

  1. 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
  2. - 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) ?
  3. 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
  4. 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
  5. - 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)
  6. 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
  7. 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.
  8. 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
  9. - 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
  10. 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