Dependency Injection in Android with Dagger 2
Dependency Injection in Android with Dagger 2 Dagger’s Power Dagger 2 is the upgraded version of the original Square’s Dagger, designed for dependency injection(DI) technology for java. DI’s sensational ability is to decouple the dependency relationship between objects, clear the code, and also let developer focus to the functional classes. In the complex framework & architecture, DI becomes the standard component, like Spring. Similarly, If you wanna write agile and maintainable code in a large and long-term run Android project, Dagger should be an not so bad option. How to install codepath/android_guides Many Android apps rely on instantiating objects that often require other dependencies. For instance, a Twitter API… github.com The first step always to install Dagger 2, unfortunately, the official document did not give any details in Android’s Gradle build environment. Yeah, Dagger is not just for Android, but for any Java Project. The good news is above...