Комментарии:
Soo easy to use koin, hello from russia)
ОтветитьThank you so much!
Ответитьthis is such a nice video. Thanks Philipp.
ОтветитьI like koin more
ОтветитьWhen you say, "most people overcomplicated", it reminded me of the old dagger documentation which gives the thermosiphon example 😃
Nice video btw, thanks!
'....don't wanna talk about the life of a programmer' 😂😂😂
ОтветитьThanks a lot Philipp for your guide, really great work 🙏
Ответитьso which one is good hit or koin?
Ответитьhow to inject constructor?
ОтветитьNice explanation! THX
ОтветитьThe main difference is that Koin is a PURE Kotlin library and Hilt NOT, therefore Koin can be used in KMM/D-KMP projects where Hilt cannot!
ОтветитьPhilipp - I am trying to use mockito to mock an object that is passed as an argument to the constructor of myViewModel(val dice:Dice).
within the Dice class I just have a single method called roll() that just returns a random number between 1..6. It is not
It is not returning 3?
This is how my instrumentation setup:
@Before
fun init(){
stopKoin()
diceMock = mock(Dice::class.java)
`when`(diceMock.roll()).thenReturn(3)
val testModule = module {
single { diceMock }
viewModel{
DiceViewModel(diceMock)
}
}
startKoin{
// loadKoinModules(testModule)
modules(testModule)
}
}
@Test
fun roll_displaysNumber() {
`when`(diceMock.roll()).thenReturn(3)
onView(withId(R.id.button)).perform(click())
onView(withId(R.id.textView)).check(matches(isDisplayed()))
}
Excellent tutorial bro - very relevant..
Ответитьthis is awesome! QQ: what if in the viewmodel constructor we need 2 or more dependency? how we inject that dependency? thanks
ОтветитьWow you make it very understandable. Thank you
ОтветитьI'm looking into Koin after just getting really frustrated with Dagger Hilt and wow this is much easier and more flexible than hilt is. Time to migrate to Koin!
ОтветитьSingle = The life of a programmer😂
ОтветитьWhat if my adapter looks like this RouteAdapter(val clickCallback: (Route) -> Unit
Then we are creating what inside module? :D
and what if my repository looks like this
class Repository(
private val routeApi: RouteApi,
private val RouteCacheDataSource: RouteCacheDataSource
) and my koin need this 2 dependency? ^^ just we have to use Repository(get(), get()) ?: P
Hey! Great video :D Can you do any tutorials on Anvil? It seems the community is really lacking some solid examples of its usage.
ОтветитьWhat about preview? How to organise preview with viewModel and Koin? ay be a good them for video)
ОтветитьCould you do a video on baseline profiles, looks like a great way to increase app start performance
ОтветитьBtw big 🐕 isn't it pronounced the same as "coin" is, like the little metal pieces of currency?
Ответить"Single, but I'm not talking about the life of a programmer"
🤭
...
🤔
🥺🔫
Looks like KOIN might be a little easier to setup than Dagger/Hilt. Not that that's difficult but there is a series of things you need to setup to use it. May check out KOIN for my next project thanks for showing it big 🐕
With you i learn Android and english :D
ОтветитьHello sir can you make a tutorial about mobile banking apps. like Bkash is very advance apps in Bangladesh.
ОтветитьI love to watch your videos 😍
ОтветитьThanks for making this video.
ОтветитьThank you for the video , very helpful
ОтветитьI worry about you, how you provide such great contents for free? Thank you so much sir.
ОтветитьVery cool video
thank you bro wish you all the best 👍👍👍🔥🔥🔥🔥
Clear explanation. Thanks philipp
ОтветитьKoin being an easy to use service locater without any proxies, code generation or reflection can attract many people.
ОтветитьWait, you're telling me it isn't said "Coin"?!?
ОтветитьYou still use koin on your project?
Ответитьwhat color theme is that?
ОтветитьReally helpful, I was unaware of how to handle named injection like Hilt. Thanks
ОтветитьCan you teach how to make website using kotlin or please link any tutorial below
ОтветитьJust the video I was needing. Thank you!
ОтветитьNice...reminds me.
.have you done KTOR?
I need to review your library again
Wow man. Respect.
ОтветитьKoin isn't dependency injection actually. It's a service locator. The end result is pretty much the same, both provide dependency, however they do it differently and hilt does it much faster, because it's done at compile time. In other words Koin has no build time impact, but has a runtime one. The opposite is true for hilt.
ОтветитьI always find DI at runtime kinda dangerous. When you have multiple flow, it is easy to miss one and you will only notice when running it.
Ответить