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

Why we should pay attention to Kotlin Multiplat...

Why we should pay attention to Kotlin Multiplatform

KMP enables shared code across different operating systems whilst maintaining native performance and flexibility without taking over your entire codebase. This talk explores why KMP is worth adopting for both small and large scale mobile apps.

Rafsanjani Aziz is a Senior Software Engineer specialising in native Android development with a strong focus on Kotlin Multiplatform. He is currently an engineer at NatWest Group, working on the Coutts Wealth mobile application.

Avatar for Leeds Mobile

Leeds Mobile

April 21, 2025
Tweet

More Decks by Leeds Mobile

Other Decks in Technology

Transcript

  1. Cross Platform Development • The ability to write an app

    once and reuse the same codebase across di ff erent platforms • The desire for cross platform apps began in the early 2000s • Java and the JVM played a key role, enabling apps to run across di ff erent systems
  2. Cross Platform Mobile Development • Developing for both Android and

    iOS by sharing all or some aspects of the codebase between platforms • Some notable cross platform mobile solutions; • React Native (Facebook, 2015) • Flutter (Google, 2017) • Kotlin Multiplatform (Jetbrains, 2023)
  3. React Native - Facebook • Released by Facebook in 2015

    • Requires Javascript/Typescript for development • Renders native components internally • Requires some knowledge in React to begin with • Easy to adopt for existing web developers
  4. Flutter - Google • Released by Google in 2017 •

    Requires Dart for development • Has a very low learning curve and is easy to adopt for beginners
  5. Traditional cross platform architecture • Historically, all cross platform mobile

    frameworks have adopted a similar architecture • They have all prioritised sharing UI components across platforms • Platform speci fi c logic isn’t trivial to achieve and requires writing separate implementations for both iOS and Android via plugins and bridges • Potentially maintaining a single codebase in three di ff erent programming languages
  6. Kotlin Multiplatform • Announced by JetBrains in 2017, stable version

    released in 2023 • All development done in the Kotlin programming language • Compiles to native code on iOS requiring no interpretation layer
  7. Kotlin Multiplatform Architecture • Takes a radically di ff erent

    approach to multi-platform development • Encourages sharing more of the business and data logic as opposed to UI • Easy to integrate Android speci fi c logic because they are both done in Kotlin • iOS speci fi c logic can be written either with Kotlin Native or Swift dependent on complexity • UI is written in native technologies, SwiftUI/UIKit for iOS and Jetpack Compose for Android
  8. Handling platform speci fi c code • Handles platform-speci fi

    c code using the expect-actual mechanism • This works similarly to how you would declare an interface and provide concrete implementations. • You declare an expected symbol, and provide actual platform speci fi c implementations for it.
  9. Why choose Kotlin Multiplatform • It provides a smooth migration

    path • Gradual adoption is possible without rewriting any portion of existing code • Fully compatible with existing native platform-speci fi c code • UI remains platform-speci fi c and fully native • Unlike other cross-platform solutions, native look and feel is preserved because you don’t have to rewrite them in a di ff erent language. • No compromises on user-experience
  10. Why choose Kotlin Multiplatform • You already have an Android

    app and want to support iOS • Reuse existing business logic to prevent duplicated work • Future proof - architecture • Strong type-safety across all platforms reducing bugs • Ready for additional platforms beyond mobile (desktop, web) • Can be easily removed from the project if it doesn’t meet expectations.
  11. The current state of Kotlin Multiplatform • O ffi cial

    support from Google • Most native android libraries getting ported to multiplatform • Growing catalogue of open-source libraries • Increased adoption among major tech companies and startups • First-class libraries for common tasks such as networking and data serialization
  12. The current state of Kotlin Multiplatform • Matured tooling ecosystem

    • First class support in JetBrains IDEs with dedicated project templates • Integrated testing frameworks that work consistently across platforms
  13. Who is using Kotlin Multiplatform • McDonalds - 10M+ users

    • CashApp - 100M+ users • Meetup - 20M+ users • Careem - 50M+ users