Full Guide to Dependency Injection With Koin for Compose Multiplatform - KMP for Beginners

Поділитися
Вставка
  • Опубліковано 27 гру 2024

КОМЕНТАРІ •

  • @BouchentoufZakaria
    @BouchentoufZakaria 6 місяців тому +36

    Jetbrain KMP should contract with you to produce their videos because you are the best at it ❤😍

    • @malschauen6267
      @malschauen6267 6 місяців тому

      Really? If i was new to this (did a lot in CDI) i would be quite lost here.

    • @BouchentoufZakaria
      @BouchentoufZakaria 6 місяців тому

      @@malschauen6267 how?

    • @malschauen6267
      @malschauen6267 6 місяців тому +2

      @@BouchentoufZakaria I meant this regarding the overall difficulty level and the intended audience of the KMP playlist (beginners in KMP). The earlier videos with their examples are a lot easier to understand. This DI video feels like a big jump up. But I wrote my comment as an answer to your comment, which is inappropriate, so I am sorry for that. In general I also think, that PL does indeed produce the best videos regarding KMP and it would be a big win, if Jetbrains would contract him.

  • @lologoodtime8271
    @lologoodtime8271 2 місяці тому +1

    Thanks ! I was having trouble with the documentation but this video was perfect i could start my app

  • @brucehe9517
    @brucehe9517 2 місяці тому +2

    Thanks for the tutorial! Just a suggestion: it would be beneficial for learners if you could show your folder structure, as I found it difficult to follow without knowing where the files were being created.

    • @anyelovinzen514
      @anyelovinzen514 2 місяці тому +1

      Man, you need to watch the video agains, he always show the folder structure, try to watch again, sorry for my bad English. 🙂

  • @yaroslavglonin
    @yaroslavglonin 6 місяців тому

    very simple example and koin is a service locator pattern😊 Good work!

  • @tzstudios
    @tzstudios 6 місяців тому +4

    Hi Philipp, can you make a video on how to use swift UI components with compose multiplatform. Like implementing AdMob on iOS and android.

  • @_runtime
    @_runtime 6 місяців тому +3

    Android team made ViewModel multiplatform too, I guess that's why you were able to put that definition to the common module. Would be nice to see some usage examples. For instance, since navigation and view model are both multiplatform, I expect the navigation to work just fine in compose multiplatform, including injecting navigation arguments to view models. But those injected arguments are read from SavedStateHandle, which feels pretty Android-specific. I wonder if that's also multiplatform, will you be able to add that dependency to your ViewModel class constructor and read out flows of arguments (just like we do on Android)?

    • @PhilippLackner
      @PhilippLackner  6 місяців тому

      @@_runtime I made a video about the KMP ViewModel already but as far as I remember the shared function wasn't available at that time yet which is why I was surprised

    • @PhilippLackner
      @PhilippLackner  6 місяців тому

      @@_runtime not sure about saved state handle but normally koin supports thaz

  • @mikelantzelo
    @mikelantzelo 6 місяців тому +6

    Plz include desktop for compose multi platform in your videos. Thanks for great stuff !!!

    • @comicsans1230
      @comicsans1230 6 місяців тому

      Yeah, I agree. Futhermore, the desktop in KMP is stable

    • @DaleHawkins
      @DaleHawkins 6 місяців тому +1

      This does work for desktop. See his other videos for how to launch it. I only had to add a dependency for coroutines on swing
      in libs.version.toml
      [versions]
      kotlinx-serialization = "1.6.0"
      [libraries]
      jetbrains-kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinxCoroutinesSwing" }
      in composeApp/build.gradle.kts
      kotlin {
      // ...
      desktopMain.dependencies {
      implementation(compose.desktop.currentOs)
      implementation(libs.jetbrains.kotlinx.coroutines.swing)
      }
      // ...
      }
      Then chose the MainKt target, launch a terminal, then run "./gradlew run"

    • @PhilippLackner
      @PhilippLackner  6 місяців тому

      @@mikelantzelo all these videos are made with desktop in mind :)

    • @comicsans1230
      @comicsans1230 6 місяців тому

      @@DaleHawkins agree, my mistake

  • @YaMehdi
    @YaMehdi 6 місяців тому +1

    @PhilippLackner Please arrange the playlist, because it is not in order. ▶

  • @meshoraouf8929
    @meshoraouf8929 6 місяців тому +2

    Plz continue and tell us how to select files or images and open the camera and read or write qrcode and more
    Thank you for your support

    • @ka61er
      @ka61er 2 місяці тому

      All of the features you mentioned already existed on other UA-cam channels more than two or three years ago and are still available today. I still use logic from some channels, perhaps from seven or eight years ago, but it still works for XML and Compose

  • @DaleHawkins
    @DaleHawkins 6 місяців тому

    Great video. Super useful! Thanks for the this series.

  • @osmanmusse9432
    @osmanmusse9432 6 місяців тому

    Great videos, you've been doing lately regarding KMP lets go :D

  • @SasanEbrahimi-m1c
    @SasanEbrahimi-m1c 5 місяців тому

    Can you make video about di scopes please? What if I don‘t want to create everything as ‘single‘ or in which scenario should we use singleton? I couldn’t find any helpful guide on it

  • @muhamadilhamabdulmujib9265
    @muhamadilhamabdulmujib9265 13 днів тому

    Thanks dude.

  • @JamesBond-mq7pd
    @JamesBond-mq7pd 6 місяців тому +1

    Philip makes KMP not scary

  • @andreaslinis1586
    @andreaslinis1586 6 місяців тому

    Hello Philip really helpful your videos. Kotlin multiplatform could also work with interfaces too. I'd prefer this approach because it's more "object oriented" way than expect/actual mechanism. What do you think about this are there any drawbacks on using interfaces instead of expect/actual?

  • @prathivar6721
    @prathivar6721 4 місяці тому

    Hi Phil love ur content but can u focus mainly on KMM , I agree few are common for both CMP & KMM but sometimes few things which are no needed for KMM are included due to CMP

  • @aiders4352
    @aiders4352 5 місяців тому

    Great video. Thoughts on Koin Annotations? Would be great to see a part 2 using it 😀

  • @sureshseeni8214
    @sureshseeni8214 5 місяців тому

    When i using network call using coroutines incetance create issue with ios app.. desktop and Android apps works fine

  • @olalekanraheem4655
    @olalekanraheem4655 5 місяців тому

    @PhilippLackner
    Can i leverage koin and viewModel in a case where I am sharing logic but not UI (maybe am just looking to share a little UI across all platforms, e.g a button)
    Also can I share just viewModels only across all platforms.
    Thanks

  • @morpheus4564
    @morpheus4564 4 місяці тому

    your KMP premium course is included delivery? iOS sign etc with CI/CD?

    • @PhilippLackner
      @PhilippLackner  4 місяці тому +1

      @@morpheus4564 no but there's a separate cicd course :)

  • @SalarRastari
    @SalarRastari 4 місяці тому

    Hi Philipp
    Thank you for your helpful videos, I was trying to use Koin in my multiplatform project then I realized "io.insert-koin:koin-compose-viewmodel" doesn't work on Wasm, and ViewModel cannot be injected.

  • @origin-pe8hy
    @origin-pe8hy 5 місяців тому

    In my case androidContext in android init crashes with exception. I don't understand

  • @bakjoul
    @bakjoul 4 місяці тому

    Hello. I'm trying to run the web version of a test app but i get this error at build : "No matching variant of androidx.lifecycle:lifecycle-viewmodel-compose:2.8.4 was found."

    • @prathivar6721
      @prathivar6721 4 місяці тому

      bro believe me as of now KMM is good to go for the production , CMP a log way to go . so learn compose UI and some important libraries and wait . if u want u can try KMM as it's promising even now, but CMP a long way to go

  • @TshegoEagles
    @TshegoEagles 5 місяців тому

    You indeed the best

  • @reyjohn88
    @reyjohn88 5 місяців тому

    Hello, I am exactly using the same version of libraries u using but I get errors in this line
    singleOf(:DbClient:)
    I imported the same package but it still showing error:
    "None of the following functions can be called with the arguments supplied"

  • @DanniiTran
    @DanniiTran 6 місяців тому

    Can you just use KoinApplication composable in commonCompose instead of initKoin() in separate platforms?

    • @PhilippLackner
      @PhilippLackner  6 місяців тому

      @@DanniiTran no then you can't add platform specific dependencies like Context

  • @RashidSoftfruit
    @RashidSoftfruit 6 місяців тому

    very nice tutorial keep going ahead

  • @ArcaDone
    @ArcaDone 3 місяці тому

    Hi . First of all thanks for the tutorial. I would like to see more video tutorial about compose Multiplatform. In particular can you implement ML Kit for text recognition Android side and Vision iOS side? Thanks

  • @ubersticks
    @ubersticks 2 місяці тому

    Koin with KMP is certainly hard to debug .... Hilt/Dagger was easy in comparison since I am used to that.

  • @152jao
    @152jao 6 місяців тому

    You're the best

  • @osisuper98
    @osisuper98 6 місяців тому

    Clean!

  • @danial2771
    @danial2771 5 місяців тому

    Hey i have the total instructions but not able to execute could you instruct me how to follow the steps in a basic manner

  • @abobus_f1
    @abobus_f1 6 місяців тому

    please record video about splash screen in kmp

    • @osisuper98
      @osisuper98 6 місяців тому

      Just build yours using CMP

  • @skarloti
    @skarloti 6 місяців тому

    I think that the Kotlin language should solve this problem soon, For example with context receivers. When using a DI library, if it does not use a Clean Architecture design pattern, it will be difficult to trace in the code where a particular dependency is injected. The very thing IDE powerless at times. I don't like all these classes that are built with DI. This should be done stably by Kotlin 2.0 in memory without a DI library in my opinion.I may not be right, but only time will tell.

  • @teddytez9003
    @teddytez9003 6 місяців тому

    fyi i believe u misspelled koin instead of kotlin, but rest is helpful

    • @PhilippLackner
      @PhilippLackner  6 місяців тому +1

      @@teddytez9003 koin is the library we use here 😅

    • @teddytez9003
      @teddytez9003 6 місяців тому

      @@PhilippLackner seems like I made the mistak, sorry

    • @gerdsfargen6687
      @gerdsfargen6687 6 місяців тому

      ​@@teddytez9003troll

  • @mohsenrzna8473
    @mohsenrzna8473 6 місяців тому

    "Dependency Injection is not just passing objects to objects"

    • @PhilippLackner
      @PhilippLackner  6 місяців тому

      @@mohsenrzna8473 what is it then? 😄

  • @rishigupta1347
    @rishigupta1347 6 місяців тому

    Hi Phillip, i want to learn kotin jetpack compose and kmp from you and work with you . I have worked with jetpack compose before and have a basic idea on it . With that this summer i interned at Microsoft for 8 weeks ..
    Where can i contact you??