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

  Рет қаралды 7,316

Philipp Lackner

15 күн бұрын

In this video you'll find a full guide to Dependency Injection With Koin for Compose Multiplatform!
👉 Check out my course Building Industry-Level Multiplatform Apps With KMP here: pl-coding.com/kmp?
💻 Let me be your mentor and become an industry-ready Android developer in 10 weeks:
pl-coding.com/drop-table-mentoring?
⭐ Courses with real-life practices
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:
pl-coding.com/premium-courses?
Get my FREE PDF about 20 things you should never do in Jetpack Compose:
pl-coding.com/jetpack-compose-mistakes?
Get the source code on GitHub:
github.com/philipplackner/CMP-Koin-DI
Regular programming advice on my Instagram page: _philipplackner_
Join my Discord server:
discord.gg/cwQbmUstEu

Пікірлер: 45
@zakariabouchantouf5141
@zakariabouchantouf5141 14 күн бұрын
Jetbrain KMP should contract with you to produce their videos because you are the best at it ❤😍
@malschauen6267
@malschauen6267 14 күн бұрын
Really? If i was new to this (did a lot in CDI) i would be quite lost here.
@zakariabouchantouf5141
@zakariabouchantouf5141 14 күн бұрын
@@malschauen6267 how?
@malschauen6267
@malschauen6267 14 күн бұрын
@@zakariabouchantouf5141 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.
@DaleHawkins
@DaleHawkins 14 күн бұрын
Great video. Super useful! Thanks for the this series.
@osmanmusse9432
@osmanmusse9432 15 күн бұрын
Great videos, you've been doing lately regarding KMP lets go :D
@yaroslavglonin
@yaroslavglonin 15 күн бұрын
very simple example and koin is a service locator pattern😊 Good work!
@mikelantzelo
@mikelantzelo 15 күн бұрын
Plz include desktop for compose multi platform in your videos. Thanks for great stuff !!!
@comicsans1230
@comicsans1230 15 күн бұрын
Yeah, I agree. Futhermore, the desktop in KMP is stable
@DaleHawkins
@DaleHawkins 14 күн бұрын
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 14 күн бұрын
@@mikelantzelo all these videos are made with desktop in mind :)
@comicsans1230
@comicsans1230 14 күн бұрын
@@DaleHawkins agree, my mistake
@RashidSoftfruit
@RashidSoftfruit 15 күн бұрын
very nice tutorial keep going ahead
@osisuper98
@osisuper98 14 күн бұрын
Clean!
@TshegoEagles
@TshegoEagles 12 күн бұрын
You indeed the best
@152jao
@152jao 15 күн бұрын
You're the best
@meshoraouf8929
@meshoraouf8929 15 күн бұрын
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
@tzstudios
@tzstudios 15 күн бұрын
Hi Philipp, can you make a video on how to use swift UI components with compose multiplatform. Like implementing AdMob on iOS and android.
@aiders4352
@aiders4352 7 күн бұрын
Great video. Thoughts on Koin Annotations? Would be great to see a part 2 using it 😀
@andreaslinis1586
@andreaslinis1586 14 күн бұрын
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?
@YaMehdi
@YaMehdi 15 күн бұрын
@PhilippLackner Please arrange the playlist, because it is not in order. ▶
@_runtime
@_runtime 15 күн бұрын
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 14 күн бұрын
@@_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 14 күн бұрын
@@_runtime not sure about saved state handle but normally koin supports thaz
@user-wk2hk8ln5b
@user-wk2hk8ln5b 10 күн бұрын
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
@olalekanraheem4655
@olalekanraheem4655 8 күн бұрын
@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
@JamesBond-mq7pd
@JamesBond-mq7pd 14 күн бұрын
Philip makes KMP not scary
@origin-pe8hy
@origin-pe8hy 9 күн бұрын
In my case androidContext in android init crashes with exception. I don't understand
@user-lm6zz3xj3e
@user-lm6zz3xj3e 4 күн бұрын
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"
@abobus_f1
@abobus_f1 15 күн бұрын
please record video about splash screen in kmp
@osisuper98
@osisuper98 14 күн бұрын
Just build yours using CMP
@DanniiTran
@DanniiTran 15 күн бұрын
Can you just use KoinApplication composable in commonCompose instead of initKoin() in separate platforms?
@PhilippLackner
@PhilippLackner 14 күн бұрын
@@DanniiTran no then you can't add platform specific dependencies like Context
@skarloti
@skarloti 14 күн бұрын
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.
@danial2771
@danial2771 13 күн бұрын
Hey i have the total instructions but not able to execute could you instruct me how to follow the steps in a basic manner
@teddytez9003
@teddytez9003 15 күн бұрын
fyi i believe u misspelled koin instead of kotlin, but rest is helpful
@PhilippLackner
@PhilippLackner 15 күн бұрын
@@teddytez9003 koin is the library we use here 😅
@teddytez9003
@teddytez9003 15 күн бұрын
@@PhilippLackner seems like I made the mistak, sorry
@gerdsfargen6687
@gerdsfargen6687 15 күн бұрын
​@@teddytez9003troll
@mohsenrzna8473
@mohsenrzna8473 15 күн бұрын
"Dependency Injection is not just passing objects to objects"
@PhilippLackner
@PhilippLackner 14 күн бұрын
@@mohsenrzna8473 what is it then? 😄
@rishigupta1347
@rishigupta1347 15 күн бұрын
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??
Дарю Самокат Скейтеру !
00:42
Vlad Samokatchik
Рет қаралды 7 МЛН
Вечный ДВИГАТЕЛЬ!⚙️ #shorts
00:27
Гараж 54
Рет қаралды 14 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:25
CRAZY GREAPA
Рет қаралды 24 МЛН
ТАМАЕВ УНИЧТОЖИЛ CLS ВЕНГАЛБИ! Конфликт с Ахмедом?!
25:37
Собери ПК и Получи 10,000₽
1:00
build monsters
Рет қаралды 2,6 МЛН
Отдых для геймера? 😮‍💨 Hiper Engine B50
1:00
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 3,1 МЛН
Опять съемные крышки в смартфонах? #cmf
0:50
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,7 МЛН