1min chapter

Fragmented - Android Developer Podcast cover image

246 - Dependency Injection: Kotlin Inject with Fred Porciúncula

Fragmented - Android Developer Podcast

CHAPTER

How to Use Dagger to Inject Dependencies Into Your Graph

Kotlin-ject does not use constructor injection. Instead, you have to do the regular way of getting a dependency from the graph. You get your component and then you call a method or a var from your component that exposes the type we want. So it also needs to be a var. There's so many ugly things involved there that actually, when I used Dagger a long time ago, I would always avoid dealing with this.

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode