# Understanding Dependency Injection in Android Through Constructor Injection

DevFeed: [Understanding Dependency Injection in Android Through Constructor Injection](<https://devfeed.tech/articles/the-imposter-s-guide-to-dependency-injection-22842.md>)

Original publisher: [Read original article](<http://androidessence.com/the-imposter-guide-to-dependency-injection/>)

Author: Adam McNeilly

Published: 2022-01-31T00:00:00Z

Content type: tutorial

Language: en

Sources: [Android Essence](<https://devfeed.tech/sources/android-essence.md>)

Topics: [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Development](<https://devfeed.tech/topics/development.md>), [Android](<https://devfeed.tech/topics/android.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Firebase](<https://devfeed.tech/topics/firebase.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [guide](<https://devfeed.tech/tags/guide.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

## AI overview

This tutorial explains dependency injection in Android, beginning with tightly coupled Firebase Analytics code and its testing difficulties. It introduces constructor injection as a way to supply dependencies and use a fake implementation in tests.

## Source excerpt

Dependency Injection is one of the hottest topics in Android and software development in general. It's also a topic that can provide a lot of anxiety and create imposter syndrome for developers. In this post, we'll take incremental steps toward understanding DI, why we need it, and how to implement it inside our applications.