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

Introduction to Kotlin Multiplatform: Write Onc...

Love
July 27, 2024

Introduction to Kotlin Multiplatform: Write Once, Run Everywhere

In this talk, you will dive into the exciting world of Kotlin Multiplatform (KMP). KMP empowers you to develop code that seamlessly runs across various platforms, saving time and resources.

Love

July 27, 2024
Tweet

More Decks by Love

Other Decks in Programming

Transcript

  1. • The Multiplatform Challenge • What is Kotlin Multiplatform? •

    Advantages of Kotlin Multiplatform • Limitations of Kotlin Multiplatform • Get Started • Resources Agenda
  2. Subtitle Text • iOS, • Android, • macOS, • Windows,

    • Linux, and others. Multiplatform applications will work on:
  3. Before Kotlin Multiplatform Data (repository/HTTP client) iOS Domain (use cases/entities)

    Presentation (viewmodels/controllers) UI (views) Data (repository/HTTP client) Android Domain (use cases/entities) Presentation (viewmodels/controllers) UI (views) Data (repository/HTTP client) Desktop Domain (use cases/entities) Presentation (viewmodels/controllers) UI (views)
  4. With Kotlin Multiplatform: Share Business Logic iOS Presentation (viewmodels/controllers) UI

    (views) Android Presentation (viewmodels/controllers) UI (views) Desktop Presentation (viewmodels/controllers) UI (views) Data (repository/HTTP client) Domain (use cases/entities) Shared Module
  5. Share Business Logic and UI iOS Platform Specific code Android

    Platform Specific code Desktop Platform Specific code Data (repository/HTTP client) Domain (use cases/entities) Shared Module Presentation (viewmodels/controllers) UI (views)
  6. Compose Multiplatform is a UI declarative framework that makes it

    possible to build UI once and share it across multiple platforms with Kotlin.
  7. • Kotlin compiles directly to machine code for each target

    platform (Android, iOS, etc.). • Direct access to native APIs on each platform. Advantages
  8. • Reduce time spent writing and maintaining the same code

    for different platforms. • Retain the flexibility and benefits of native programming. Advantages
  9. 1. Setup your environment JDK 1. Android Studio version 2.2

    and higher comes with the latest OpenJDK. 2. To check, run java -version on your terminal
  10. 1. Check your environment 1. Install KDoctor. Mac Users only

    2. After the installation is completed, call KDoctor in the console:
  11. 2. Create the project with wizard 5. Click the Download

    button and unpack the resulting archive.
  12. • Create a Kotlin Multiplatform app — tutorial • Create

    your first cross-platform app • Introduction to Kotlin Multiplatform • Kotlin Multiplatform Tutorial for Beginners - Your First KMP App Resources