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

Ton app en KMP dans la vraie vie : notre méthod...

Ton app en KMP dans la vraie vie : notre méthode en 7 étapes

Talk made at Android Makers by droidcon 2024.

Speakers:
- @bapness
- @enthuan

—————————

Tu es développeur Android et tu aimerais que ton app soit aussi disponible sur iOS sans trop d'efforts ? Ce talk est pour toi !

Tu as sans doute entendu parler de Kotlin Multiplatform, une technologie qui promet de simplifier la mutualisation du code sans devoir apprendre le Dart ☺️.

Mais est-ce que ça va s’appliquer à ton projet ? Par où commencer ? Quels sont les risques et comment les gérer ? Combien ça coûte ? Woooh, ça fait beaucoup de questions !

Pour y répondre, on te propose notre nouveau guide gratuit pour rendre ton projet Android multiplateforme en 7 étapes (la dernière va surement t’étonner).

Cette méthode, on l’a déjà testée et améliorée à plusieurs reprises sur des projets pro ou perso et on vient aujourd’hui la partager avec toi. Et après notre talk, il te faudra redoubler d’efforts pour justifier l'absence de ton application sur iOS !

Baptiste CARLIER

April 25, 2024
Tweet

Other Decks in Programming

Transcript

  1. School app Android only Compose Multiple features Firebase Firestore +

    API calls OTHER PARENTS COMPLAIN ABOUT NO iOS VERSION AVAILABLE !!!
  2. School app Android only Compose Multiple features Firebase Firestore +

    API calls OTHER PARENTS COMPLAIN ABOUT NO iOS VERSION AVAILABLE !!!
  3. WTF is a shared module? shared domain data domain data

    presentation presentation androidApp iOSApp
  4. WTF is a shared module? shared domain data domain data

    presentation presentation androidApp iOSApp
  5. Ultimate method to go KMP • Step 1: Create the

    shared module ✓ BUILD SUCCESSFUL
  6. domain Migrate that code androidApp domain data shared androidMain commonMain

    ! WRONG ! java.util.date ava.net.URI java.io.InputStre tent.Context
  7. • Step 1: Create the shared module • Step 2:

    Migrate the domain layer ✓ BUILD SUCCESSFUL Ultimate method to go KMP
  8. Move your data layer Room SQLDelight Retrofit Ktor SharedPreferences /

    DataStore DataStore File OKIO Timber Napier, Kermit soon? stable
  9. Ultimate method to go KMP • Step 1: Create the

    shared module • Step 2: Migrate the domain layer • Step 3: Use Kotlin-only libraries for data layer ✓ BUILD SUCCESSFUL
  10. Ultimate method to go KMP • Step 1: Create the

    shared module • Step 2: Migrate the domain layer • Step 3: Use Kotlin-only libraries for data layer • Step 4: Migrate resources ✓ BUILD SUCCESSFUL
  11. Dependency injection Koin 8.6k ⭐ Kodein 3.1k ⭐ kotlin-inject 1.1k

    ⭐ DI.kt 139 ⭐ Koject 118 ⭐ PopKorn 152 ⭐
  12. Ultimate method to go KMP • Step 1: Create the

    shared module • Step 2: Migrate the domain layer • Step 3: Use Kotlin-only libraries for data layer • Step 4: Migrate resources • Step 5: Enhance your dependency injection ✓ BUILD SUCCESSFUL
  13. Migrate the domain layer Use Kotlin-only libraries for data layer

    Migrate resources Enhance your dependency injection • Step 1: Create the shared module Choose your own path
  14. Ultimate method to go KMP • Step 1: Create the

    shared module • Step 2: Migrate the domain layer • Step 3: Use Kotlin-only libraries for data layer • Step 4: Migrate resources • Step 5: Enhance your dependency injection • Step 6: Create iOS app module and plug shared module to it 💥 BUILD FAILED
  15. Ultimate method to go KMP • Step 1: Create the

    shared module • Step 2: Migrate the domain layer • Step 3: Use Kotlin-only libraries for data layer • Step 4: Migrate resources • Step 5: Enhance your dependency injection • Step 6: Create iOS app module and plug shared module to it ✓ BUILD SUCCESSFUL
  16. Ultimate method to go KMP • Step 1: Create the

    shared module • Step 2: Migrate the domain layer • Step 3: Use Kotlin-only libraries for data layer • Step 4: Migrate resources • Step 5: Enhance your dependency injection • Step 6: Create iOS app module and plug shared module to it • Step 7: Cry now! You have to write presentation code for iOS views ✓ BUILD SUCCESSFUL
  17. TAKE AWAY Small iteration, small changes = continuous delivery 🫦

    Migrate what your want, how you want 🫵 Sync with iOS team (dev, UI, UX) 🤝 It’s moving fast! 🏎
  18. More Multiplatform at AMxDC24 Kotlin Multiplatform at Stable and Beyond

    Márton Braun Hitchhiker's Guide to Kotlin/Compose Multiplatform samples John O'Reilly Android, Compose, Multiplatform & Server - Inject them all with Koin Arnaud Giuliani Thursday Introducing Kotlin Multiplatform in an existing mobile app Marco Gomiero Building a Joystick Controller using Compose Multiplatform Renaud Mathieu, Filippo Scognamiglio Office hour: KMP Márton Braun, John O’Reilly, Marco Gomiera, Baptiste Carlier, Antoine Robiez Friday