Slide 1

Slide 1 text

Rafsanjani Aziz Senior Software Engineer, Natwest Group Why we should pay attention to Kotlin Multiplatform

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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)

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

Flutter - Google • Released by Google in 2017 • Requires Dart for development • Has a very low learning curve and is easy to adopt for beginners

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

Common cross platform mobile architecture

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

Kotlin Multiplatform Architecture

Slide 11

Slide 11 text

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.

Slide 12

Slide 12 text

Handling platform speci fi c code

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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.

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

Who is using Kotlin Multiplatform • McDonalds - 10M+ users • CashApp - 100M+ users • Meetup - 20M+ users • Careem - 50M+ users

Slide 18

Slide 18 text

Thank you