Slide 1

Slide 1 text

Architecting a Kotlin Multiplatform Divya Jain

Slide 2

Slide 2 text

Hello! I am Divya Jain Mobile App Developer You can find me at @divyajain2405 2

Slide 3

Slide 3 text

“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

Slide 4

Slide 4 text

KMM Project Structure ⬡ Shared Module ⬡ Android Application ⬡ IOS Application 4

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

commonMain ios android

Slide 7

Slide 7 text

7 KMM Plugin

Slide 8

Slide 8 text

8 New KMP Project Android Studio: v4.2

Slide 9

Slide 9 text

9

Slide 10

Slide 10 text

KMM-Books An app using KMM which displays a list of Books with name, brief description & author. 10

Slide 11

Slide 11 text

11

Slide 12

Slide 12 text

12

Slide 13

Slide 13 text

13

Slide 14

Slide 14 text

14

Slide 15

Slide 15 text

15 https://github.com/djain2405/kotlin-multiplatform-booklist

Slide 16

Slide 16 text

Ktor for Networking Open source framework to build connected applications (Web, Http services, mobile, browser) Asynchronous multi platform client 16

Slide 17

Slide 17 text

17 https://github.com/ktorio/ktor-samples

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

Thank You! @divyajain2405 https://github.com/djain2405 21