# Dagger

A compile-time dependency injection framework for Java, Kotlin, and Android.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## A Simple MVI Architecture Approach Using LiveData

DevFeed: [A Simple MVI Architecture Approach Using LiveData](<https://devfeed.tech/articles/simple-mvi-32343.md>)

Original publisher: [Read original article](<https://dustn.dev/page/presentations/2019-08-14-simple-mvi/>)

Author: dustin@dustn.dev (Dustin Summers)

Published: 2026-09-17T04:13:15.404035Z

Content type: opinion

Language: en

Sources: [Dustin Summers](<https://devfeed.tech/sources/dustin-summers.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>)

Tags: [architecture](<https://devfeed.tech/tags/architecture.md>), [architecture-pattern](<https://devfeed.tech/tags/architecture-pattern.md>), [error](<https://devfeed.tech/tags/error.md>), [livedata](<https://devfeed.tech/tags/livedata.md>), [loading](<https://devfeed.tech/tags/loading.md>), [mvi](<https://devfeed.tech/tags/mvi.md>)

### AI overview

A talk from Android Summit 2019 discusses a simple implementation of the MVI architecture pattern using LiveData and the Loading, Content, Error pattern.

### Source excerpt

This was a talk provided by myself and Dan Lowe at Android Summit, 2019. In this we discuss a simple approach to the MVI (Model, View, Intent) Architecture Pattern using LiveData and the common Loading, Content, Error Pattern. Link to Dan's blog post is here which is what our talk was based around.

## Hilt in Android Auto: From Manual Factories to a Cleaner Screen Provider

DevFeed: [Hilt in Android Auto: From Manual Factories to a Cleaner Screen Provider](<https://devfeed.tech/articles/hilt-in-android-auto-from-manual-factories-to-a-cleaner-screen-provider-22963.md>)

Original publisher: [Read original article](<https://funkymuse.github.io/posts/car-sample-with-hilt/>)

Author: FunkyMuse

Published: 2026-06-05T09:30:00Z

Content type: tutorial

Language: en

Sources: [FunkyMuse](<https://devfeed.tech/sources/funkymuse.md>)

Topics: [dagger-hilt](<https://devfeed.tech/topics/dagger-hilt.md>), [Android Auto](<https://devfeed.tech/topics/android-auto.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [Software Testing](<https://devfeed.tech/topics/software-testing.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-auto](<https://devfeed.tech/tags/android-auto.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [dependency-management](<https://devfeed.tech/tags/dependency-management.md>), [di](<https://devfeed.tech/tags/di.md>), [hilt](<https://devfeed.tech/tags/hilt.md>), [screen](<https://devfeed.tech/tags/screen.md>)

### AI overview

The excerpt proposes using Hilt multibinding to avoid manually passing a factory for every Android Auto screen. A `ScreenProvider` resolves screens from a map of `ScreenFactory` bindings, and a `Navigator` uses that provider to push screens; the session uses the provider for the initial screen. Screens can then use ordinary constructors and the navigator, without `@AssistedInject` factories. Because a `MainScreen` factory needs the navigator while the navigator depends on the screen provider and its factory map, injecting `Provider<Navigator>` delays resolution and breaks the circular dependency. The author presents this as an exploratory approach, not production-ready: `ScreenFactory` uses `Any` casts that could be improved with a custom KSP processor. The excerpt also mentions event channels or callbacks as alternatives for breaking the cycle, and says `Lazy` is possible but offers no significant improvement over `Provider`.

### Source excerpt

If you've ever followed the Android Auto Codelabs, you've seen the "sample" way of building a Car App. It works, it's functional, but as soon as you try to scale it beyond a simple demo, you hit a wall: Dependency Management. Keep in mind this is only one way to wire things, I'm pretty sure many others exist, I'm exploring things on Android Auto and Android Wear lately and how to connect and w...

## Koin Compiler 1.0: DSL and Annotations, Koin now Compile-Safe

DevFeed: [Koin Compiler 1.0: DSL and Annotations, Koin now Compile-Safe](<https://devfeed.tech/articles/koin-compiler-1-0-dsl-and-annotations-koin-now-compile-safe-22972.md>)

Original publisher: [Read original article](<https://blog.insert-koin.io/koin-compiler-1-0-dsl-and-annotations-koin-now-compile-safe-06905a2b04ad?source=rss----925561f2ecdf---4>)

Author: Arnaud Giuliani

Published: 2026-06-03T12:01:01Z

Content type: release

Language: en

Sources: [Koin developers](<https://devfeed.tech/sources/koin-developers-medium.md>)

Topics: [koin](<https://devfeed.tech/topics/koin.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [annotation-processor](<https://devfeed.tech/topics/annotation-processor.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [annotations](<https://devfeed.tech/tags/annotations.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [dependency-graph](<https://devfeed.tech/tags/dependency-graph.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [dsl](<https://devfeed.tech/tags/dsl.md>), [koin](<https://devfeed.tech/tags/koin.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [plugin](<https://devfeed.tech/tags/plugin.md>)

### AI overview

Koin Compiler 1.0 adds a native Kotlin compiler plugin that checks dependency wiring at build time and rewrites compact DSL calls such as `single<MyRepository>()` into constructor factories. It supports both DSL and annotation-based definitions, validates missing dependencies and runtime resolution call sites, and handles nullable, lazy, list, defaulted, qualified, and injected parameters according to Koin's resolution rules. The plugin requires Kotlin 2.3.20+ and Koin 4.2.1+; it needs no KSP or generated files and is described as supporting Kotlin Multiplatform targets. For DSL use, `koin-core` alone suffices; `koin-annotations` is needed for annotated classes or the annotations flow. Existing Koin modules can adopt the new forms incrementally, while KSP users remove generated-code setup. The excerpt also describes compatibility with JSR-330/Jakarta annotations for staged Dagger or Hilt migration. Safety coverage expands from individual modules to configuration groups, the full graph at `startKoin<T>()`, and call sites; externally provided types require whitelisting or `@Provided`.

### Source excerpt

Koin Compiler 1.0: DSL and Annotations, Now Compile-Safe Hello, dear Koin Community 👋 Koin Compiler 1.0 is out. Koin's DSL and annotations now sit on a native Kotlin compiler plugin that verifies your dependency graph at build time: the missing-definition error that used to wait for a get<T>() call no longer makes it past gradlew build: e: [Koin] Missing dependency: UserRepository (required by UserService) No KSP, no generated files, full Kotlin Multiplatform support out of the box. It's the biggest ergonomic shift we've made in Koin's nine-year history. Koin Logo with KotlinConf '26 LogoSetup 👀 If you use a Gradle version catalog (the modern default): [versions] koin = "4.2.1" koin-plugin = "1.0.0" [libraries] koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" } koin-annotations = { module = "io.insert-koin:koin-annotations", version.ref = "koin" } [plugins] koin-compiler = { id = "io.insert-koin.compiler.plugin", version.ref = "koin-plugin" } Or the equivalent inline in build.gradle.kts: plugins { id("io.insert-koin.compiler.plugin") version "1.0.0" } dependencies { implementation("io.insert-koin:koin-core:4.2.1") implementation("io.insert-koin:koin-annotations:4.2.1") } koin-annotations is only needed if you use the annotations on your classes for the constructor, or use the annotations flow. On the DSL flow, the plugin works against koin-core alone. The DSL flow -- Safer DSL ✨ Take two classes: class MyDatabase() class MyRepository(val db: MyDatabase) Wiring them up with Koin has progressively required less typing: // 1. Manual -- the wiring is explicit module { single { MyDatabase() } single { MyRepository(get()) } } // 2. Reflection-free constructor binding module { singleOf(::MyDatabase) singleOf(::MyRepository) } // 3. Compiler-intercepted - same DSL, new mechanism module { single<MyDatabase>() single<MyRepository>() } The third form looks like nothing is happening. That's the point: the compiler plugin sees single<MyDatabase>(), walks the

## Re: Dependency Injection vs. Service Locators

DevFeed: [Re: Dependency Injection vs. Service Locators](<https://devfeed.tech/articles/re-dependency-injection-vs-service-locators-39043.md>)

Original publisher: [Read original article](<https://www.zacsweers.dev/re-dependency-injection-vs-service-locators/>)

Author: Zac Sweers

Published: 2026-02-20T05:10:16Z

Content type: opinion

Language: en

Sources: [Zac Sweers](<https://devfeed.tech/sources/zac-sweers.md>)

Topics: [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [koin](<https://devfeed.tech/topics/koin.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [service](<https://devfeed.tech/topics/service.md>), [multiplatform](<https://devfeed.tech/topics/multiplatform.md>)

Tags: [dagger](<https://devfeed.tech/tags/dagger.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [koin](<https://devfeed.tech/tags/koin.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [metro](<https://devfeed.tech/tags/metro.md>), [service](<https://devfeed.tech/tags/service.md>)

### AI overview

The article compares dependency injection frameworks with service locators, focusing on compile-time validation, testing, isolation, generated performance, and the tradeoff of requiring more explicit code. It discusses Metro, Dagger, Hilt, Anvil, kotlin-inject, Koin, and manual dependency injection.

### Source excerpt

This is a port of a write-up I did in the Kotlin Lang slack here in response to the question "Dagger vs. Hilt vs. Koin vs. Metro vs. <what comes next>. Serious question: Are there any compelling reasons to switch from Koin to Metro in a

## From Dagger to Metro

DevFeed: [From Dagger to Metro](<https://devfeed.tech/articles/from-dagger-to-metro-20445.md>)

Original publisher: [Read original article](<https://vinted.engineering//2026/02/12/from-dagger-to-metro/>)

Author: Andrius Semionovas

Published: 2026-02-12T00:00:00Z

Content type: article

Language: en

Sources: [Vinted](<https://devfeed.tech/sources/vinted.md>)

Topics: [Dagger](<https://devfeed.tech/topics/dagger.md>), [dagger-hilt](<https://devfeed.tech/topics/dagger-hilt.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [anvil](<https://devfeed.tech/tags/anvil.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dagger-android](<https://devfeed.tech/tags/dagger-android.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [di](<https://devfeed.tech/tags/di.md>), [hilt](<https://devfeed.tech/tags/hilt.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [metro](<https://devfeed.tech/tags/metro.md>), [migration](<https://devfeed.tech/tags/migration.md>)

### AI overview

Vinted migrated its Android codebase, spanning a few hundred Gradle modules, from Dagger and Anvil to Metro as Anvil's Kotlin compiler plugin support left the team on Kotlin 1.9/K1 without incremental compilation while Kotlin 2.x and K2 adoption became pressing. The excerpt presents Metro's interoperability with Dagger, Anvil, and kotlin-inject as the key migration advantage: it let the team adopt K2 with less business-code migration than other options, reducing the time and risk of the change. The account describes the migration as bumpy; the excerpt does not provide its implementation steps or full results.

### Source excerpt

Metro - modern and kotlin injection framework created by Zac Sweers. And we, Android developers at Vinted, officially and fully migrated to it! It was quite a bumpy ride for our huge codebase. Our story begins...

## Container Use for Locally Sandboxed, Background Agents in Zed

DevFeed: [Container Use for Locally Sandboxed, Background Agents in Zed](<https://devfeed.tech/articles/container-use-for-locally-sandboxed-background-agents-in-zed-13446.md>)

Original publisher: [Read original article](<https://zed.dev/blog/container-use-background-agents>)

Author: Jeremy Adams

Published: 2025-07-30T00:00:00Z

Content type: tutorial

Language: en

Sources: [Zed Industries](<https://devfeed.tech/sources/zed-industries-blog.md>)

Topics: [container](<https://devfeed.tech/topics/container.md>), [AI-assisted coding](<https://devfeed.tech/topics/ai-assisted-coding.md>), [Git](<https://devfeed.tech/topics/git.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Model Context Protocol](<https://devfeed.tech/topics/model-context-protocol.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>)

Tags: [agents](<https://devfeed.tech/tags/agents.md>), [ai-coding-agents](<https://devfeed.tech/tags/ai-coding-agents.md>), [cli](<https://devfeed.tech/tags/cli.md>), [container](<https://devfeed.tech/tags/container.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [git](<https://devfeed.tech/tags/git.md>), [mcp](<https://devfeed.tech/tags/mcp.md>)

### AI overview

This article explains how to use Zed with Container Use to run background coding agents in isolated containerized environments while maintaining parallel Git worktrees. It describes using MCP, Dagger containers, and CLI commands to manage and inspect agent environments.

### Source excerpt

Run AI agents in parallel without interference using containerized environments and Git Worktrees.

## What Every Android Developer Should Have in Their GitHub?

DevFeed: [What Every Android Developer Should Have in Their GitHub?](<https://devfeed.tech/articles/what-every-android-developer-should-have-in-their-github-25844.md>)

Original publisher: [Read original article](<https://blog.stackademic.com/what-every-android-developer-should-have-in-their-github-de8deab051b9?source=rss-8aced922ece------2>)

Author: Ban Markovic

Published: 2024-02-05T11:00:04Z

Content type: article

Language: en

Sources: [Ban Markovic](<https://devfeed.tech/sources/stories-by-ban-markovic-on-medium.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [GitHub](<https://devfeed.tech/topics/github.md>), [MVVM](<https://devfeed.tech/topics/mvvm.md>), [dagger-hilt](<https://devfeed.tech/topics/dagger-hilt.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [RxJava](<https://devfeed.tech/topics/rxjava.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [androiddev](<https://devfeed.tech/tags/androiddev.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [asynchronous-communication](<https://devfeed.tech/tags/asynchronous-communication.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [fetching](<https://devfeed.tech/tags/fetching.md>), [github](<https://devfeed.tech/tags/github.md>), [hilt](<https://devfeed.tech/tags/hilt.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [koin](<https://devfeed.tech/tags/koin.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [livedata](<https://devfeed.tech/tags/livedata.md>), [mvi](<https://devfeed.tech/tags/mvi.md>), [mvvm](<https://devfeed.tech/tags/mvvm.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [portfolio](<https://devfeed.tech/tags/portfolio.md>), [rest-api](<https://devfeed.tech/tags/rest-api.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

The article recommends a compact Android GitHub showcase with two screens: fetch a list from a REST API, display it, and let users open an item's details. It advises demonstrating either MVI or MVVM, organizing files by feature or type, handling asynchronous work with a library such as Kotlin Coroutines, LiveData, or RxJava, and using dependency injection with Hilt, Dagger, or Koin. It also recommends unit tests for ViewModel, UseCase, and Repository classes. The article presents these as ways to show core Android development skills to potential employers; it does not compare the listed architecture or library options.

### Source excerpt

In the competitive world of Android development, having a strong GitHub portfolio is crucial for showcasing your skills to potential employers. One effective way to demonstrate your expertise is by creating a concise yet comprehensive project that highlights key aspects of Android development. In this article, we'll explore the essential components that every Android developer should have in their GitHub, focusing on a project that encapsulates fundamental skills. The Project Overview A successful showcase project should include two screens and cover the following key functionalities: Fetching and Displaying Data - Utilize a REST API to fetch a list of items. - Display this list on the first screen of the app. Navigation and Detailed Information - Enable users to navigate to a second screen by clicking on a specific item. - On the second screen, display more detailed information about the selected item. Key Considerations for the Showcase ProjectArchitecture -- MVI or MVVM Clearly implement and showcase your understanding of the chosen architecture (MVI or MVVM). Organize code files in a logical and easily understandable structure. File Organization Demonstrate a well-organized project structure, separating concerns and making codebase easily maintainable (feature-based or type-based folders structure). Asynchronous Communication Showcase your proficiency in handling asynchronous tasks by using an appropriate library (e.g., Kotlin Coroutines, LiveData, RxJava). Unit Tests Impress potential employers by including unit tests to validate the functionality of critical components (cover your ViewModel, UseCase, Repository classes with unit tests). Dependency Injection (DI): Implement and demonstrate your use of dependency injection for managing component dependencies (Hilt, Dagger, Koin). Why This Project Matters This concise project effectively showcases your abilities in: Displaying a list of items Fetching data from the internet Implementing navigation between screens

## DIY: your own Dependency Injection library!

DevFeed: [DIY: your own Dependency Injection library!](<https://devfeed.tech/articles/diy-your-own-dependency-injection-library-25622.md>)

Original publisher: [Read original article](<https://blog.p-y.wtf/diy-your-own-dependency-injection-library>)

Author: Pierre-Yves Ricau

Published: 2024-01-18T20:08:04Z

Content type: tutorial

Language: en

Sources: [Py's blog](<https://devfeed.tech/sources/py-s-blog.md>)

Topics: [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [Library](<https://devfeed.tech/topics/library.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [build](<https://devfeed.tech/tags/build.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [dag](<https://devfeed.tech/tags/dag.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dagger-2](<https://devfeed.tech/tags/dagger-2.md>), [dagger-hilt](<https://devfeed.tech/tags/dagger-hilt.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [dependency-graph](<https://devfeed.tech/tags/dependency-graph.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [di](<https://devfeed.tech/tags/di.md>), [diy](<https://devfeed.tech/tags/diy.md>), [extension-function](<https://devfeed.tech/tags/extension-function.md>), [factory](<https://devfeed.tech/tags/factory.md>), [implement](<https://devfeed.tech/tags/implement.md>), [internals](<https://devfeed.tech/tags/internals.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [library](<https://devfeed.tech/tags/library.md>), [map](<https://devfeed.tech/tags/map.md>), [module](<https://devfeed.tech/tags/module.md>)

### AI overview

The article builds intuition for dependency injection by progressing from manual construction to simplified versions of Google Guice, Dagger 1, and Dagger 2. Manual injection creates dependencies in order at a dedicated configuration point, but becomes difficult as collaborators grow. The excerpt defines an ObjectGraph as the entry point that supplies requested instances, a Factory as the creator of a type using dependencies from the graph, and a Module as the provider of factories for particular types. The article frames a dependency graph as a DAG and provides Kotlin examples; the supplied text ends while introducing Module, so later implementation details are not available here.

### Source excerpt

Dependency Injection libraries are powerful tools, but they're often also intimidating & confusing. When that happens to me, I find that understanding how a tool works helps me get over the initial scare of the dark magic internals. In this article, ...

## Dependency Injection in Legacy Code

DevFeed: [Dependency Injection in Legacy Code](<https://devfeed.tech/articles/dependency-injection-in-legacy-code-24906.md>)

Original publisher: [Read original article](<https://blog.blundellapps.co.uk/dependency-injection-in-legacy-code/>)

Author: blundell

Published: 2023-10-19T12:26:59Z

Content type: tutorial

Language: en

Sources: [Blundell](<https://devfeed.tech/sources/blundell.md>)

Topics: [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [dagger-hilt](<https://devfeed.tech/topics/dagger-hilt.md>), [Android](<https://devfeed.tech/topics/android.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [legacy systems](<https://devfeed.tech/topics/legacy-systems.md>), [software-development](<https://devfeed.tech/topics/software-development.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dagger-hilt](<https://devfeed.tech/tags/dagger-hilt.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [di](<https://devfeed.tech/tags/di.md>), [hilt](<https://devfeed.tech/tags/hilt.md>), [intermediate](<https://devfeed.tech/tags/intermediate.md>), [legacy-code](<https://devfeed.tech/tags/legacy-code.md>), [reference](<https://devfeed.tech/tags/reference.md>)

### AI overview

For Android legacy singletons or other classes outside the architecture managed by Hilt, the excerpt describes using a Hilt EntryPoint to retrieve dependencies from the existing Dagger graph. Define an interface annotated as an entry point, add a function for each required binding (including qualifiers), and install it in the appropriate component. The legacy code can then use the entry point through a Context reference. The approach assumes the required Dagger modules and bindings already exist; the excerpt says it does not work if the class cannot obtain a Context.

### Source excerpt

This post explains how you can inject dependencies into Android legacy singletons, or any classes that aren't conforming to your current Android architecture, using Dagger & Hilt. I'll cut straight to the chase, if you have a reference to Context, (which you usually always do in spaghetti legacy code) then you can use your normal [...] The post Dependency Injection in Legacy Code first appeared on Blundell.

## Why Dagger's Provider Interface Is Simple and Flexible

DevFeed: [Why Dagger's Provider Interface Is Simple and Flexible](<https://devfeed.tech/articles/simple-apis-are-elegant-apis-30604.md>)

Original publisher: [Read original article](<https://ryanharter.com/blog/2023/08/simple-apis-are-elegant-apis/>)

Published: 2023-08-10T02:55:50Z

Content type: opinion

Language: en

Sources: [Blogs on Ryan Harter](<https://devfeed.tech/sources/blogs-on-ryan-harter.md>)

Topics: [Dagger](<https://devfeed.tech/topics/dagger.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [apis](<https://devfeed.tech/tags/apis.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [interface](<https://devfeed.tech/tags/interface.md>), [jvm](<https://devfeed.tech/tags/jvm.md>)

### AI overview

The article examines how Dagger's javax.inject.Provider interface supports generated dependency providers and flexible object-creation strategies. It discusses shared instances, lazy and eager instantiation, and lifecycle scoping.

### Source excerpt

I recently gave a presentation about how Dagger works under the hood, and I was once again struck by the elegance of the javax.inject.Provider interface. The interface is so simple it almost seems useless, but it's also incredibly flexible, and forms the basis of much of the code generated by Dagger. Like many dependency injection frameworks for JVM languages, Dagger uses and builds on the standard set of annotations for injectable classes defined in JSR-330 and provided in the javax.inject package.

## On the Road to CDI Compatibility

DevFeed: [On the Road to CDI Compatibility](<https://devfeed.tech/articles/on-the-road-to-cdi-compatibility-43643.md>)

Original publisher: [Read original article](<https://quarkus.io/blog/on-the-road-to-cdi-compatibility/>)

Author: Ladislav Thon

Published: 2023-07-12T00:00:00Z

Content type: article

Language: en

Sources: [Quarkus - Supersonic Subatomic Java](<https://devfeed.tech/sources/quarkus-supersonic-subatomic-java.md>)

Topics: [Quarkus](<https://devfeed.tech/topics/quarkus.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [Framework](<https://devfeed.tech/topics/framework.md>)

Tags: [build](<https://devfeed.tech/tags/build.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [framework](<https://devfeed.tech/tags/framework.md>)

### AI overview

The article explains Quarkus's ArC dependency injection container and its build-time architecture. It contrasts ArC with runtime-oriented CDI implementations such as Weld and Guice, and with Dagger's build-time dependency wiring, while discussing CDI Portable Extensions as a compatibility challenge.

### Source excerpt

Ever since the very first days of Quarkus, the days that are now covered by the blissful fog of oblivion and the survivors only talk about them after a few pints of beer, dependency injection container was an integral part of the envisioned framework. And not just any dependency injection container -- a CDI implementation, of all things. At the very beginning, the CDI implementation used was Weld. Very soon, the Masterminds and Deep Thoughts behind the CDI work in what eventually became Quarkus, Martin Kouba and Stuart Douglas, realized that Weld cannot possibly unlock the full potential that a build-time oriented framework conceals. Thus, ArC was born. When I first heard of ArC, I thought, surely that means A reduced CDI, especially with that capitalization! Alas, I was deeply mistaken. It is a reference to an activity that I could never possibly indulge in out of the simple concern for my health and safety: arc welding. (That indeed is a backreference to Weld. There are some clever people here!) Arc Welding ArC started with one important architectural constraint that was significantly different to all other existing CDI implementations at that time: it ought to perform the heavy lifting during application build. Among others, this includes the entire bean discovery process. If you are familiar with AtInject and its various implementations, this concept doesn't come as a surprise. For example, Guice is a popular dependency injection container that does all the work at application runtime, while Dagger is a popular alternative that precomputes dependency wiring at build time. With CDI, the situation is not that simple. CDI 2.0, the latest version at that time, includes features that ultimately preclude running bean discovery at build time; most notably, the Portable Extensions API. To be able to execute portable extensions, you need to have a running CDI container (to deliver events or use the BeanManager API), you need to be able to reflect on application classes (t

## Slim down your Android components with LifecycleObserver

DevFeed: [Slim down your Android components with LifecycleObserver](<https://devfeed.tech/articles/slim-down-your-android-components-with-lifecycleobserver-22657.md>)

Original publisher: [Read original article](<https://www.valueof.io/blog/default-lifecycle-observer>)

Author: james shvarts

Published: 2022-11-17T21:11:40Z

Content type: tutorial

Language: en

Sources: [Android Blog - Mobile Dev Notes](<https://devfeed.tech/sources/android-blog-mobile-dev-notes.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [dagger-hilt](<https://devfeed.tech/topics/dagger-hilt.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [software-development](<https://devfeed.tech/topics/software-development.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [custom](<https://devfeed.tech/tags/custom.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dagger-hilt](<https://devfeed.tech/tags/dagger-hilt.md>), [hilt](<https://devfeed.tech/tags/hilt.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [lifecycle](<https://devfeed.tech/tags/lifecycle.md>)

### AI overview

A custom LifecycleObserver can move lifecycle callbacks out of oversized Android components. Implement the observer interface and override only the callbacks you need, then register it with an Activity or Fragment lifecycle; observe a Fragment's view lifecycle through its viewLifecycleOwner, which is unavailable in onCreate. Observers need not be explicitly removed, and multiple observers can organize or share lifecycle work. The excerpt also describes observing the Application/process lifecycle and says the observer can be injected with Dagger or Hilt, but its scoping discussion is truncated, so it does not establish how to configure or reuse scoped instances.

### Source excerpt

Learn to create custom LifecycleObserver components and inject them with Dagger/Hilt

## Basic Auth with OkHttp and Retrofit

DevFeed: [Basic Auth with OkHttp and Retrofit](<https://devfeed.tech/articles/basic-auth-with-okhttp-and-retrofit-22649.md>)

Original publisher: [Read original article](<https://www.valueof.io/blog/basic-auth-okhttp-retrofit-dagger>)

Author: James Shvarts

Published: 2022-11-05T22:25:12Z

Content type: tutorial

Language: en

Sources: [Android Blog - Mobile Dev Notes](<https://devfeed.tech/sources/android-blog-mobile-dev-notes.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [client library](<https://devfeed.tech/topics/client-library.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [annotations](<https://devfeed.tech/tags/annotations.md>), [api](<https://devfeed.tech/tags/api.md>), [auth](<https://devfeed.tech/tags/auth.md>), [authentication](<https://devfeed.tech/tags/authentication.md>), [basic](<https://devfeed.tech/tags/basic.md>), [configure](<https://devfeed.tech/tags/configure.md>), [custom](<https://devfeed.tech/tags/custom.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dagger-hilt](<https://devfeed.tech/tags/dagger-hilt.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [header](<https://devfeed.tech/tags/header.md>), [hilt](<https://devfeed.tech/tags/hilt.md>), [http](<https://devfeed.tech/tags/http.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-android](<https://devfeed.tech/tags/kotlin-android.md>), [okhttp](<https://devfeed.tech/tags/okhttp.md>), [project](<https://devfeed.tech/tags/project.md>), [retrofit](<https://devfeed.tech/tags/retrofit.md>)

### AI overview

The post outlines a Kotlin Android example that uses OkHttp and Retrofit for an HTTP GET request to an endpoint requiring Basic Authentication. It describes routing outgoing requests through a custom component that sets the authentication header, then wiring the repository interface and implementation through Dagger/Hilt for use in a ViewModel. Moshi is listed for JSON handling, with its annotations tied to the API contract. The excerpt does not include the code or specify the exact header construction.

### Source excerpt

Basic Auth example using OkHttp, Retrofit, Dagger in a Kotlin project

## Things you can do in Android Studio

DevFeed: [Things you can do in Android Studio](<https://devfeed.tech/articles/things-you-can-do-in-android-studio-25669.md>)

Original publisher: [Read original article](<https://adambennett.dev/2022/06/things-you-can-do-in-android-studio/>)

Published: 2022-06-18T08:38:44Z

Content type: tutorial

Language: en

Sources: [Posts on Adam Bennett](<https://devfeed.tech/sources/posts-on-adam-bennett.md>)

Topics: [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [blog](<https://devfeed.tech/tags/blog.md>), [career](<https://devfeed.tech/tags/career.md>), [code](<https://devfeed.tech/tags/code.md>), [compose](<https://devfeed.tech/tags/compose.md>), [copy](<https://devfeed.tech/tags/copy.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [development](<https://devfeed.tech/tags/development.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [finance](<https://devfeed.tech/tags/finance.md>), [function](<https://devfeed.tech/tags/function.md>), [functional](<https://devfeed.tech/tags/functional.md>), [growth](<https://devfeed.tech/tags/growth.md>), [intellij](<https://devfeed.tech/tags/intellij.md>), [java](<https://devfeed.tech/tags/java.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [money](<https://devfeed.tech/tags/money.md>), [opinions](<https://devfeed.tech/tags/opinions.md>), [productivity](<https://devfeed.tech/tags/productivity.md>), [scopes](<https://devfeed.tech/tags/scopes.md>), [software](<https://devfeed.tech/tags/software.md>), [startups](<https://devfeed.tech/tags/startups.md>), [thoughts](<https://devfeed.tech/tags/thoughts.md>), [tooling](<https://devfeed.tech/tags/tooling.md>), [training](<https://devfeed.tech/tags/training.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

### AI overview

A practical list of Android Studio and IntelliJ productivity features, including excluding generated files with Scopes, using scratch files to test ideas, editing multiple lines simultaneously, and accessing clipboard history.

### Source excerpt

Based on a recent discussion on Twitter: a list of things that you can do in Android Studio which can make your life much easier. Hide files you don't care about If you work in a project with lots of generated code (e.g.: you use Dagger), you can exclude generated files from searches using Scopes:

## Dagger/Hilt vs. Koin for Jetpack Compose Apps

DevFeed: [Dagger/Hilt vs. Koin for Jetpack Compose Apps](<https://devfeed.tech/articles/dagger-hilt-vs-koin-for-jetpack-compose-apps-25520.md>)

Original publisher: [Read original article](<https://patrykkosieradzki.com/dagger-hilt-vs-koin-dependency-injection-for-jetpack-compose-apps>)

Published: 2022-03-13T00:00:00Z

Content type: comparison

Language: en

Sources: [Patryk Kosieradzki](<https://devfeed.tech/sources/patryk-kosieradzki.md>)

Topics: [Dagger](<https://devfeed.tech/topics/dagger.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [Android](<https://devfeed.tech/topics/android.md>), [interoperability](<https://devfeed.tech/topics/interoperability.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dagger-hilt](<https://devfeed.tech/tags/dagger-hilt.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [koin](<https://devfeed.tech/tags/koin.md>)

### AI overview

A comparison of Dagger/Hilt and Koin for dependency injection in Jetpack Compose Android applications. It discusses code generation, build and runtime considerations, Google's recommendation of Hilt, and two Compose integration approaches: pure Compose with navigation-compose or Fragments with ComposeView.

### Source excerpt

A detailed comparison of using Hilt versus Koin for dependency injection in Jetpack Compose applications.

## Integration verbosity and good layering

DevFeed: [Integration verbosity and good layering](<https://devfeed.tech/articles/integration-verbosity-and-good-layering-20941.md>)

Original publisher: [Read original article](<https://jakewharton.com/integration-verbosity-and-good-layering/>)

Published: 2021-04-07T00:00:00Z

Content type: article

Language: en

Sources: [Jake Wharton](<https://devfeed.tech/sources/jake-wharton.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [XML](<https://devfeed.tech/topics/xml.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [SQLite](<https://devfeed.tech/topics/sqlite.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>)

Tags: [abstraction](<https://devfeed.tech/tags/abstraction.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [design](<https://devfeed.tech/tags/design.md>), [env-file-security](<https://devfeed.tech/tags/env-file-security.md>), [integrations](<https://devfeed.tech/tags/integrations.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [net-conf](<https://devfeed.tech/tags/net-conf.md>)

### AI overview

The article argues that integration verbosity can be a consequence of good layering. General-purpose libraries such as view binding, Dagger, SQLDelight, and RecyclerView must leave higher-level integration and configuration decisions to their callers, enabling more flexible libraries and platforms.

### Source excerpt

One of my favorite non-features from building view binding is that it lacks integration with activities or fragments. If you use view binding with activities or fragments, however, this fact might be to your disdain. Every activity using view binding is forced to do something along the lines of: override fun onCreate(savedInstanceState: Bundle) { super.onCreate(savedInstanceState) val binding = ProfileViewBinding.inflate(layoutInflater) setContentView(binding.root) // Do stuff with 'binding' } This is textbook verbosity, and some would argue boilerplate. It only gets worse with fragments (due to their poor design and to no specific fault of view binding which works the same as any View reference). View binding exists at a different layer of abstraction than is appropriate for integration with higher-level components like activities or fragments. It serves as a type-safe representation of a schema declared in an XML file and that's it. It has no more knowledge of activities and fragments than the associated R.layout.profile_view integer does. Higher-level libraries like androidx.activity and androidx.fragment have integrations with those R.layout integers. If you're upset that view binding has no turn-key solution for activities and fragments then this is the tree you should be barking up. View binding wasn't built with verbosity in mind. Hell, it's not even that verbose. It ended up this way because it's the design the layer of abstraction it operates at demands. The same pattern occurs in some of my other favorite libraries. Dagger offers you nothing and requires that you build up the dependency injectors, their hierarchy, and their lifecycle entirely yourself. SQLDelight makes you specify database info in the build configuration and a database driver in the runtime API. RecylerView requires at minimum an adapter subtype and to choose and configure a layout manager. The layer at which these tools operate is sufficiently general such that their good design requires

## IntoSet: Dagger Multibindings and Architecture

DevFeed: [IntoSet: Dagger Multibindings and Architecture](<https://devfeed.tech/articles/intoset-dagger-multibindings-and-architecture-25665.md>)

Original publisher: [Read original article](<https://adambennett.dev/2021/03/intoset-dagger-multibindings-and-architecture/>)

Published: 2021-03-05T09:30:09Z

Content type: tutorial

Language: en

Sources: [Posts on Adam Bennett](<https://devfeed.tech/sources/posts-on-adam-bennett.md>)

Topics: [Dagger](<https://devfeed.tech/topics/dagger.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [android](<https://devfeed.tech/tags/android.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [blog](<https://devfeed.tech/tags/blog.md>), [career](<https://devfeed.tech/tags/career.md>), [components](<https://devfeed.tech/tags/components.md>), [compose](<https://devfeed.tech/tags/compose.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [development](<https://devfeed.tech/tags/development.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [finance](<https://devfeed.tech/tags/finance.md>), [functional](<https://devfeed.tech/tags/functional.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [growth](<https://devfeed.tech/tags/growth.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [java](<https://devfeed.tech/tags/java.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [money](<https://devfeed.tech/tags/money.md>), [opinions](<https://devfeed.tech/tags/opinions.md>), [software](<https://devfeed.tech/tags/software.md>), [startups](<https://devfeed.tech/tags/startups.md>), [thoughts](<https://devfeed.tech/tags/thoughts.md>), [training](<https://devfeed.tech/tags/training.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

### AI overview

This tutorial explains how Dagger multibindings with sets can inject collections and register components across Gradle modules. It presents uses including decoupling runtime initialization, isolating third-party SDKs behind facades, reducing dependencies, and registering Moshi adapters.

### Source excerpt

Featured in Kotlin Weekly #240 Dagger is typically my DI framework of choice for large projects (insert controversy here) and while most people are familiar with the basic concepts, some aspects immediately cause internal panic when mentioned. Multibindings is one of them, which is a shame because it's a highly useful pattern which can solve real problems.

## JvmSuppressWildcards: The secret sauce to your sandwich-style generics

DevFeed: [JvmSuppressWildcards: The secret sauce to your sandwich-style generics](<https://devfeed.tech/articles/jvmsuppresswildcards-the-secret-sauce-to-your-sandwich-style-generics-25906.md>)

Original publisher: [Read original article](<https://chao2zhang.medium.com/jvmsuppresswildcards-the-secret-sauce-to-your-sandwich-style-generics-b0093aa5979d?source=rss-d19045640fe------2>)

Author: Chao Zhang

Published: 2021-02-23T16:01:15Z

Content type: article

Language: en

Sources: [Chao Zhang](<https://devfeed.tech/sources/stories-by-chao-zhang-on-medium.md>)

Topics: [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [Use-Site Variance](<https://devfeed.tech/topics/use-site-variance.md>), [annotation-processor](<https://devfeed.tech/topics/annotation-processor.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [compilation-error](<https://devfeed.tech/tags/compilation-error.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [declaration-site-variance](<https://devfeed.tech/tags/declaration-site-variance.md>), [generics](<https://devfeed.tech/tags/generics.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [processing](<https://devfeed.tech/tags/processing.md>), [recyclerview](<https://devfeed.tech/tags/recyclerview.md>)

### AI overview

In mixed Java/Kotlin dependency chains, Kotlin's generic variance can produce Java wildcards that break overrides or Dagger binding resolution. In the RecyclerView example, changing nullability or the Java parameter to `List<? extends Object>` or `List<?>` does not fix the clash; annotating the Kotlin element type with `@JvmSuppressWildcards` makes `List<Any>` translate to Java `List<Object>`. For Dagger multibinding, annotating the Kotlin map type similarly corrects the generated Java type and resolves the reported missing binding. The excerpt presents `@JvmSuppressWildcards` as a way to suppress generated wildcards for Java compatibility.

### Source excerpt

Photo: amirali mirhashemian from Unsplash If generic types are exposed in Kotlin API, consider @JvmSuppressWildcards so that your Java consumer can compile successfully. Kotlin generics are different from (in my opinion, smarter than) Java generics. Kotlin generics has declaration-site variance and type projections, which are officially documented here. Generics is a gigantic topic itself. My usual practice is to leverage IDE warnings and compiler error messages to fix my code since they usually contain the necessary information to show you where you did wrong. However, as we are Kotlinizing our codebase from Java to Kotlin, it is possible to have a sandwich-style code dependency that mixes Java code and Kotlin code. In such cases, when dealing with generics, your compiler and IDE may not be smart enough to help you fix those issues. What is sandwich-style code dependency?🥪 Sandwich-style Kotlin conversion At a certain time during your Java to Kotlin conversion, there could be some Java code depending on Kotlin code, which in turn depends on Java code. A typical example on Android is that your app code in Java depending on your library in Kotlin, which depends on Android SDK in Java. Even if your app code is written purely in Kotlin, the sandwich might still exist: The Java-based annotation processing Dagger, depends on your app code in Kotlin, which depends on Android SDK in Java. Now let's look at how the secret sauce @JvmSuppressWildcards can help us by making our generic sandwich tasty. Sandwich: List<Object> in RecyclerView methodshttps://medium.com/media/87fd0c63db2b9c82af2b241bf61cef31/href With the code above, the following compilation error is observed: MyChildAdapter.java:13: error: name clash: onBindViewHolder(MyViewHolder,int,List<Object>) in MyChildAdapter overrides a method whose erasure is the same as another method, yet neither overrides the other The error message leads us to think that we need to change our type here: Change the Kotlin generic para

## Dagger Tips: Guide to using Dagger-Android effectively

DevFeed: [Dagger Tips: Guide to using Dagger-Android effectively](<https://devfeed.tech/articles/dagger-tips-guide-to-using-dagger-android-effectively-25929.md>)

Original publisher: [Read original article](<https://itnext.io/dagger-tips-guide-to-using-dagger-android-effectively-c3e5b2883b38?source=rss-7a8d96da8cb6------2>)

Author: Gabor Varadi

Published: 2021-02-13T05:05:50Z

Content type: article

Language: en

Sources: [Gabor Varadi](<https://devfeed.tech/sources/stories-by-gabor-varadi-on-medium.md>)

Topics: [Dagger](<https://devfeed.tech/topics/dagger.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [dagger-hilt](<https://devfeed.tech/topics/dagger-hilt.md>), [software-architecture](<https://devfeed.tech/topics/software-architecture.md>), [software-development](<https://devfeed.tech/topics/software-development.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dagger-2](<https://devfeed.tech/tags/dagger-2.md>), [dagger-android](<https://devfeed.tech/tags/dagger-android.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [fragment](<https://devfeed.tech/tags/fragment.md>), [hilt](<https://devfeed.tech/tags/hilt.md>), [modularization](<https://devfeed.tech/tags/modularization.md>), [module](<https://devfeed.tech/tags/module.md>), [scalability](<https://devfeed.tech/tags/scalability.md>), [type-safe](<https://devfeed.tech/tags/type-safe.md>), [viewmodel](<https://devfeed.tech/tags/viewmodel.md>), [worker](<https://devfeed.tech/tags/worker.md>)

### AI overview

Dagger-Android uses map multibinding to dispatch field injection when feature modules cannot call inject on an application component directly. With AndroidInjectionModule and @ContributesAndroidInjector, Dagger generates injector factories; DispatchingAndroidInjector looks up a factory by the target class, creates an injector, and injects the instance. For maintainability, the excerpt recommends defining a module per screen, aggregating screen modules within each feature module, then including feature aggregates in the app component, instead of collecting all screens in global activity, fragment, and ViewModel modules. Dagger-Android is superseded by Hilt, which handles common Android types through @AndroidEntryPoint, @HiltViewModel, and @HiltWorker; the article frames Dagger-Android's dynamic injection as mainly useful for legacy or modularized cases. The text is an excerpt, so it may not cover the article in full.

### Source excerpt

Something people could ask me as they're reading this title: "Hold on a second, isn't Dagger-Android no longer in active development? Isn't it made obsolete with the introduction of Hilt?" Technically, yes. Dagger-Android is superseded by Hilt. So there is a good chance that if you are already using Hilt, then for the most common cases (injecting Activity, Fragment, ViewModel, Worker), you don't need to think about Dagger-Android whatsoever. However, as I still see @ContributesAndroidInjector popping up every now and then, I feel that it's best if I write an article on how it works, what it intended to solve, how to use it, and how NOT to use it (for better scalability). What was Dagger-Android? Dagger-Android was a way to field-inject classes (not necessarily just Android classes since Dagger 2.20+) without having to define a fun inject(target: MyConcreteClassTarget) injector method on the component -- as we don't know the class itself. When do you want to avoid creating fun inject(t: T) in a component? After all, this is what normally allows field injection to be type-safe. The answer is, when you can't. If you use a modularization pattern where :app contains the ApplicationComponent(or SingletonComponent), then while ApplicationComponent can see any Activity or Fragment within the app, the submodules don't see :app and therefore don't see ApplicationComponent. Therefore, they can't call component.inject(this)! On the other hand, if you were to define an Application.ActivityLifecycleCallbacks to do it automatically, that wouldn't work with the standard approach -- as you see only the superclass, but not the concrete class! So if one wants to use field injection with our provided restrictions, there are two options: Expose an interface from the child module that defines the injection targets, and implement that on the ApplicationComponent -- then make it possible to access it (for example, using the ApplicationContext for lookup) and cast it to the interface to be abl

## Introducing Anvil

DevFeed: [Introducing Anvil](<https://devfeed.tech/articles/introducing-anvil-15698.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/introducing-anvil>)

Author: Ralf Wondratschek

Published: 2020-06-23T19:00:00Z

Content type: release

Language: en

Sources: [Square Corner](<https://devfeed.tech/sources/square-corner-blog-medium.md>)

Topics: [Dagger](<https://devfeed.tech/topics/dagger.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [dagger-hilt](<https://devfeed.tech/topics/dagger-hilt.md>), [gradle-plugin](<https://devfeed.tech/topics/gradle-plugin.md>), [Dependency management](<https://devfeed.tech/topics/dependency-management.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [anvil](<https://devfeed.tech/tags/anvil.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [component](<https://devfeed.tech/tags/component.md>), [components](<https://devfeed.tech/tags/components.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dagger-2](<https://devfeed.tech/tags/dagger-2.md>), [dependency-graph](<https://devfeed.tech/tags/dependency-graph.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [developer-productivity](<https://devfeed.tech/tags/developer-productivity.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [framework](<https://devfeed.tech/tags/framework.md>), [github](<https://devfeed.tech/tags/github.md>), [google](<https://devfeed.tech/tags/google.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [hilt](<https://devfeed.tech/tags/hilt.md>), [ide](<https://devfeed.tech/tags/ide.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-compiler](<https://devfeed.tech/tags/kotlin-compiler.md>), [plugin](<https://devfeed.tech/tags/plugin.md>), [productivity](<https://devfeed.tech/tags/productivity.md>)

### AI overview

Anvil is a Kotlin compiler plugin that reduces Dagger setup work by automatically adding annotated Dagger modules and component interfaces to the components for their declared scopes. Developers mark modules with `@ContributesTo` and components with `@MergeComponent`, avoiding manual component wiring and IDE syncs; the benefit grows when modules are shared across applications. The article also cites explicit module scopes, closer alignment between Dagger dependencies and Gradle modules, and easier decomposition of large composite modules. It says Hilt offers a similar `@InstallIn` feature, so Anvil is unnecessary for Hilt users; the authors report choosing Anvil because Hilt includes features they do not need and restrictions they cannot accept.

### Source excerpt

Make dependency injection with Dagger 2 easier

## Kotlin Mumbai: Dagger and Jetpack Navigation

DevFeed: [Kotlin Mumbai: Dagger and Jetpack Navigation](<https://devfeed.tech/articles/kotlin-mumbai-dagger-and-jetpack-navigation-28387.md>)

Original publisher: [Read original article](<https://siddroid.com/post/post-march-kotlin-mumbai-2020/>)

Author: Siddhesh Patil

Published: 2020-04-05T10:03:09Z

Content type: article

Language: en

Sources: [Sid Patil - Android Engineer and Kotlin Advocate](<https://devfeed.tech/sources/sid-patil-android-engineer-and-kotlin-advocate.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [navigation](<https://devfeed.tech/topics/navigation.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [akshay-sawant](<https://devfeed.tech/tags/akshay-sawant.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [best-android-developer-groups-in-india](<https://devfeed.tech/tags/best-android-developer-groups-in-india.md>), [coronavirus](<https://devfeed.tech/tags/coronavirus.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dagger-2-for-android](<https://devfeed.tech/tags/dagger-2-for-android.md>), [developer-communities-in-mumbai](<https://devfeed.tech/tags/developer-communities-in-mumbai.md>), [jetpack-navigation](<https://devfeed.tech/tags/jetpack-navigation.md>), [jetpack-navigation-components](<https://devfeed.tech/tags/jetpack-navigation-components.md>), [kedarnath-naik](<https://devfeed.tech/tags/kedarnath-naik.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-user-group-mumbai](<https://devfeed.tech/tags/kotlin-user-group-mumbai.md>), [kug](<https://devfeed.tech/tags/kug.md>), [meetup](<https://devfeed.tech/tags/meetup.md>)

### AI overview

A report on moving the March 2020 Kotlin Mumbai meetup online during coronavirus lockdowns. The event covered Dagger 2 dependency injection and the Jetpack Navigation component, using tools including OBS, YouTube livestreaming, Google Meet, and Telegram.

### Source excerpt

With the current situation and lockdowns due to coronavirus, we had to roll up our sleeves and prepare for a fully online meetup.

## 🔪 Introduction to Dagger DI 💉 by a Life way!

DevFeed: [🔪 Introduction to Dagger DI 💉 by a Life way!](<https://devfeed.tech/articles/introduction-to-dagger-di-by-a-life-way-25731.md>)

Original publisher: [Read original article](<https://blog.shreyaspatil.dev/introduction-to-dagger-di-by-a-life-way-d34f62540329/>)

Author: Shreyas Patil

Published: 2020-03-15T07:54:11Z

Content type: article

Language: en

Sources: [Shreyas Patil's Blog](<https://devfeed.tech/sources/shreyas-patil-s-blog.md>)

Topics: [Dagger](<https://devfeed.tech/topics/dagger.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>)

Tags: [dagger](<https://devfeed.tech/tags/dagger.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [di](<https://devfeed.tech/tags/di.md>), [others](<https://devfeed.tech/tags/others.md>)

### AI overview

The excerpt describes Dagger as a static, compile-time dependency injection framework for Java and Android. It explains DI as creating dependencies outside the class that needs them and supplying them to that class. In its example, a Life object depends on Needs, which depends on Food, Clothes, and Shelter; those depend on Money, which depends on Job and Education. The text says constructor annotations tell Dagger which constructors to use and that Dagger obtains parameter values to create instances. It also mentions annotating Money to keep a single instance, then begins setting up a Life component; the excerpt ends before that setup is shown.

### Source excerpt

Demystifying Dependency Injection with Dagger. Learn DI concepts through real-life analogies and simplify your Android app architecture.

## Easy Android Scopes

DevFeed: [Easy Android Scopes](<https://devfeed.tech/articles/easy-android-scopes-30595.md>)

Original publisher: [Read original article](<https://ryanharter.com/blog/2020/03/easy-android-scopes/>)

Published: 2020-03-13T16:09:47Z

Content type: tutorial

Language: en

Sources: [Blogs on Ryan Harter](<https://devfeed.tech/sources/blogs-on-ryan-harter.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [multiplatform](<https://devfeed.tech/topics/multiplatform.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-framework](<https://devfeed.tech/tags/android-framework.md>), [cache](<https://devfeed.tech/tags/cache.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [deprecated](<https://devfeed.tech/tags/deprecated.md>), [fragments](<https://devfeed.tech/tags/fragments.md>), [lifecycle](<https://devfeed.tech/tags/lifecycle.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>)

### AI overview

This tutorial examines how to scope Android objects across lifecycle changes, especially when Activities and Fragments are recreated during configuration changes. It discusses retaining presenters and extending lifecycle-bound retention to objects such as Dagger Components, while noting the limitations of the deprecated onRetainNonConfigurationInstance approach.

### Source excerpt

A common challenge when writing Android apps is properly scoping objects: if they outlive the lifecycle in which they're needed then we are wasting memory and they can be leaked, but if we recreate objects too soon then we could be duplicating work when we don't need to. The most common place that this manifests in is Activities and Fragments, since they're destroyed and replaced by a new instance during events like configuration changes, which can be unintuitive, at first.

## Speeding Up Builds with Dagger Reflect

DevFeed: [Speeding Up Builds with Dagger Reflect](<https://devfeed.tech/articles/speeding-up-builds-with-dagger-reflect-2019.md>)

Original publisher: [Read original article](<https://developers.soundcloud.com/blog//dagger-reflect>)

Published: 2020-01-30T00:00:00Z

Content type: tutorial

Language: en

Sources: [SoundCloud Backstage](<https://devfeed.tech/sources/soundcloud-backstage-blog.md>)

Topics: [Dagger](<https://devfeed.tech/topics/dagger.md>), [build performance](<https://devfeed.tech/topics/build-performance.md>), [Android](<https://devfeed.tech/topics/android.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Dependency Inversion](<https://devfeed.tech/topics/dependency-inversion.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [migration](<https://devfeed.tech/topics/migration.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [dependency-inversion](<https://devfeed.tech/tags/dependency-inversion.md>), [developers](<https://devfeed.tech/tags/developers.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [make](<https://devfeed.tech/tags/make.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [performance](<https://devfeed.tech/tags/performance.md>), [productivity](<https://devfeed.tech/tags/productivity.md>)

### AI overview

This article explains how SoundCloud experimented with Dagger Reflect to reduce Android build times caused by Dagger annotation processing. It contrasts Dagger's compile-time code generation with reflection-based dependency injection, describes the build-time and startup-time tradeoff, and explains why Dagger Reflect was chosen over migrating the codebase to a runtime-based framework.

### Source excerpt

A large portion of an Android app's build time can consist of Dagger annotation processing, and most developers agree that productivity is...

[Next page](<https://devfeed.tech/topics/dagger.md?cursor=WyIyMDIwLTAxLTMwVDAwOjAwOjAwKzAwOjAwIiwgImQxYzg0ZWNlLTI0NWItNDY1Ny04YjM2LTVjMjYyNDk1YWU4ZSJd>)