Skip to content

dinkar1708-zz/Dagger2

Repository files navigation

Android Dagger2 Dependency Injection

Dagger2 all in one place – Very simple easy steps to understand the basics of dagger2. Please see the details on - http://dinkarcse.blogspot.in/2018/01/android-dagger2-dependency-injection.html

This post covers the basics of dagger2 a depedency injection for android framework, making coding simple and easy.

What dagger2 -

· Dagger 2 is a compile-time evolution approach to dependency injection. · Dagger is currently in active development, primarily internally at Google, with regular pushes to the open-source community · It is dependency injection framework. · How to handled dependency injection? · It uses DI using annotation. · Dagger2 is based on javax.inject annotations standard. Eg. Internal API classes like

Dependency injection – https://en.wikipedia.org/wiki/Dependency_injection

Why -

· Is is restrictly generated implementation (no reflection) ie. Dagger2 is based on code generation not on Reflection. · Reduces the code coupling – makes code loosely coupled · User needs to use the object without any headache how to create the object of components. · # copied from developer’s android - o Dagger's static, compile-time implementation means that it can be used in Android apps without needless runtime cost or memory usage.

This application contains three modules

  1. app - basic setup of dagger2
  2. dagger2Netmodule - shows how to setup basic network request API
  3. Dagger2 Android MVP -

Dagger2 Android MVP - UI-

device-2018-02-10-113822

device-2018-02-10-113833

Releases

No releases published

Packages

 
 
 

Contributors

Languages