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

Kotlin Multiplatform!

Divya Jain
August 27, 2021

Kotlin Multiplatform!

Kotlin Multiplatform Projects are quickly becoming a popular new way to reuse code between multiple platforms by focusing on sharing the logical code and still writing platform specific needs natively. A quick presentation around its power, how to architect a simple app using Kotlin Multiplatform and some benefits.
Presented this talk at Droidcon Nigeria.

Divya Jain

August 27, 2021
Tweet

More Decks by Divya Jain

Other Decks in Programming

Transcript

  1. “Single codebase, Shared business logic for Android & IOS, through

    pure Kotlin 3 Common JVM JS Native Note: Cross platform only for shared business logic, UI is still native in Kotlin/Swift etc
  2. Expect “Expected declaration” in the common module for functions, classes,

    enums , properties etc. Expect/Actual mechanism Actual “Actual declaration” in the platform module corresponding to the expected one. 5 expect common Actual IOS native declaration Actual Android native declaration
  3. 9

  4. KMM-Books An app using KMM which displays a list of

    Books with name, brief description & author. 10
  5. 11

  6. 12

  7. 13

  8. 14

  9. Ktor for Networking Open source framework to build connected applications

    (Web, Http services, mobile, browser) Asynchronous multi platform client 16
  10. Clean Architecture with KMM 18 Domain Models DataSource Cache SQL

    Delight Network Ktor Use Cases & user interaction handlers Shared module - kotlin Platform Specific UI Presentation Layer
  11. Benefits of KMM Significant Savings Faster Development time, cause using

    Kotlin for Mobile & web, we are writing the business logic code only once. Fewer Bugs & testable Allows developers to create clean code, shared business logic is unit testable & bugs are less and caught much early on. Almost a Native experience The UI is still built natively, it’s just shared logic. Utilize power of each platform without the overhead. Flexibility & platform consistent user experience. 19
  12. Kotlin Multiplatform holds all the key promises and possibilities similar

    to Kotlin & emerges as a well-equipped solution for cross-platform app development projects. 20