$30 off During Our Annual Pro Sale. View Details »

Code sharing with Kotlin multi-platform

Code sharing with Kotlin multi-platform

One IOS app, one android app and one web app. Three clients, three code bases implementing the same features (almost) and with three times the amount of bugs.
Not that bad. we are all doing it for years. But more and more companies are trying to unify the clients.
The kotlin's team came up with a solution that is for me the scenario with the less trade-offs. Use the tools you love but share what what is common.

Souleymane Sidibe

April 24, 2020
Tweet

More Decks by Souleymane Sidibe

Other Decks in Programming

Transcript

  1. @soulesidibe Code sharing with Kotlin multi-platform Use the tools you

    love but share what is common
  2. Agenda • Kotlin Multiplatform • A demo • Questions

  3. Client Side development

  4. Client Side development Android IOS Web

  5. Client Side development Android IOS Web Java 6/7/8

  6. Client Side development Android IOS Web Java 6/7/8 Kotlin

  7. Client Side development Android IOS Web Java 6/7/8 Kotlin Objectif-C

  8. Client Side development Android IOS Web Java 6/7/8 Kotlin Objectif-C

    Swift
  9. Client Side development Android IOS Web Java 6/7/8 Kotlin Objectif-C

    Swift JavaScript
  10. Client Side development Android IOS Web Java 6/7/8 Kotlin Objectif-C

    Swift JavaScript
  11. Client Side development Android IOS Web

  12. Client Side development Android IOS Web UI

  13. Client Side development Android IOS Web UI BUSINESS LOGIC

  14. Client Side development Android IOS Web UI BUSINESS LOGIC IO

  15. Client Side development Android IOS Web UI BUSINESS LOGIC IO

    Backend
  16. Client Side development Android IOS Web UI BUSINESS LOGIC IO

    Backend
  17. Client Side development Android IOS Web UI BUSINESS LOGIC IO

    Backend
  18. Client Side development Android IOS Web UI BUSINESS LOGIC IO

    Backend
  19. Client Side development Android IOS Web UI BUSINESS LOGIC IO

  20. Client Side development Android IOS Web UI IO UI UI

    IO IO Busines Busines Busines
  21. Client Side development Android IOS Web UI IO UI UI

    IO IO Busines Busines Busines • 1 set of features • 3 teams / plate-forms supported • 3 Codebases/implementations • 3x the amount of issues
  22. Client Side development Android IOS Web UI BUSINESS LOGIC IO

  23. Client Side development Android IOS Web UI BUSINESS LOGIC IO

  24. Client Side development Android IOS Web UI BUSINESS LOGIC IO

  25. Client Side development • Fast to build apps • Hot

    Reload • Easy to learn • Js Ecosystem • New programming language • It’s not native
  26. Kotlin Multiplatform

  27. Android IOS Web UI BUSINESS LOGIC IO Kotlin Multiplatform •

    Modern Programming language by Jetbrains • Concise, Safe, Interoperable • Great tooling • Server side • Android default language • Kotlin Native (Windows, Mac, IOS, Linux, WA) • Web development (react, node js, etc)
  28. Android IOS Web UI BUSINESS LOGIC IO Kotlin Multiplatform •

    Sharing Code Between Platforms
  29. Android IOS Web UI BUSINESS LOGIC IO Kotlin Multiplatform •

    Sharing Code Between Platforms Kotlin Common K otlin/JV M K otlin/JS Kotlin/Native ByteCode JS C ode Native Code
  30. Android IOS Web UI BUSINESS LOGIC IO Kotlin Multiplatform •

    Sharing Code Between Platforms Kotlin Common K otlin/JV M K otlin/JS Kotlin/Native ByteCode JS C ode Native Code
  31. Android IOS Web UI BUSINESS LOGIC IO Kotlin Multiplatform •

    Sharing Code Between Platforms Kotlin Common K otlin/JV M K otlin/JS Kotlin/Native ByteCode JS C ode Native Code UI UI
  32. Android IOS Web UI SPECIFIC CODE (if Needed) Kotlin Multiplatform

    • Sharing Code Between Platforms Kotlin Common K otlin/JV M K otlin/JS Kotlin/Native ByteCode JS C ode Native Code UI UI BUSINESS LOGIC IO
  33. Android IOS Web Native UI Jetpack Compose SPECIFIC CODE (if

    Needed) Kotlin Multiplatform: Sharing Code Between Platforms • Sharing Code Between Platforms Kotlin Common K otlin/JV M K otlin/JS Kotlin/Native ByteCode JS C ode Native Code SWIFT UI, Objectif-C JS BUSINESS LOGIC IO
  34. Android IOS Web Native UI Jetpack Compose SPECIFIC CODE (if

    Needed) Kotlin Multiplatform: Sharing Code Between Platforms • Sharing Code Between Platforms Kotlin Common K otlin/JV M K otlin/JS Kotlin/Native ByteCode JS C ode Native Code SWIFT UI, Objectif-C JS BUSINESS LOGIC IO .aar .jar .framework optimized js
  35. Android IOS Web Native UI Jetpack Compose SPECIFIC CODE (if

    Needed) Kotlin Multiplatform: Sharing Code Between Platforms SWIFT UI, Objectif-C JS BUSINESS LOGIC IO
  36. Android IOS Web Native UI Jetpack Compose SPECIFIC CODE (if

    Needed) Kotlin Multiplatform: Sharing Code Between Platforms SWIFT UI, Objectif-C JS BUSINESS LOGIC IO
  37. Android IOS Web Native UI Jetpack Compose SPECIFIC CODE (if

    Needed) Kotlin Multiplatform: Sharing Code Between Platforms SWIFT UI, Objectif-C JS BUSINESS LOGIC IO
  38. Android IOS Web Native UI Jetpack Compose SPECIFIC CODE (if

    Needed) Kotlin Multiplatform: Sharing Code Between Platforms SWIFT UI, Objectif-C JS BUSINESS LOGIC IO • Gradle build tool
  39. Android IOS Web Native UI Jetpack Compose SPECIFIC CODE (if

    Needed) Kotlin Multiplatform: Sharing Code Between Platforms SWIFT UI, Objectif-C JS BUSINESS LOGIC IO • Gradle build tool
  40. Android IOS Web Native UI Jetpack Compose SPECIFIC CODE (if

    Needed) Kotlin Multiplatform: Sharing Code Between Platforms SWIFT UI, Objectif-C JS BUSINESS LOGIC IO • Gradle build tool
  41. Android IOS Web Native UI Jetpack Compose SPECIFIC CODE (if

    Needed) Kotlin Multiplatform: Sharing Code Between Platforms SWIFT UI, Objectif-C JS BUSINESS LOGIC IO • Gradle build tool
  42. Android IOS Web Native UI Jetpack Compose SPECIFIC CODE (if

    Needed) Kotlin Multiplatform: Sharing Code Between Platforms SWIFT UI, Objectif-C JS BUSINESS LOGIC IO • Gradle build tool
  43. Android IOS Web Native UI Jetpack Compose SPECIFIC CODE (if

    Needed) Kotlin Multiplatform: Sharing Code Between Platforms SWIFT UI, Objectif-C JS BUSINESS LOGIC IO • Gradle build tool StdLib Coroutines Serialization IO Date Doc
  44. CALM DOWN. I WILL NOT LIVE CODING DEMO

  45. Wrap up •Kotlin is a great programming language

  46. Wrap up •Kotlin is a great programming language •Jetbrains is

    a great tooling company
  47. Wrap up •Kotlin is a great programming language •Jetbrains is

    a great tooling company •Business logic writes once and runs everywhere
  48. Wrap up •Kotlin is a great programming language •Jetbrains is

    a great tooling company •Business logic writes once and runs everywhere •Code sharing force you re-think your architecture
  49. Wrap up •Kotlin is a great programming language •Jetbrains is

    a great tooling company •Business logic writes once and runs everywhere •Code sharing force you re-think your architecture •Performance
  50. Wrap up •Still in experimental

  51. Wrap up •Still in experimental •Limited number of multiplatform libs

  52. Wrap up •Still in experimental •Limited number of multiplatform libs

    •Not great for prototyping
  53. Wrap up •Still in experimental •Limited number of multiplatform libs

    •Not great for prototyping •Setup-build-deploy curve is tough for the firsts tries
  54. Wrap up source : KotlinConf 2019 Keynote

  55. Links kobiri.app/kotlinjs

  56. Links kobiri.app/kotlinjs

  57. Links kobiri.app/kmp_ios_and_android

  58. Links kobiri.app/venkat_kotlin

  59. Sources •https://www.jetbrains.com/lp/mobilecrossplatform/ •kobiri.app/kotlinconf2019 •kobiri.app/kotlinconf2018 •https://play.kotlinlang.org/hands-on/overview •https://github.com/soulesidibe/MultiplatformApp

  60. Thank you! That’s it