I am evaluating Dependency Injection (DI) frameworks for an Android app. The top contenders are: Dagger (with Butter Knife) and Android Annotations. I understand that Dagger an
Google does ask specifically not to use dependency injection.
But by reading their request they seem to be referring more to the Guice
and reflection based DI library's. Libraries such as android annotation use no reflection instead employing compile time generated code, while butterknife
and dagger
uses a small amount of reflection optimised for android but are supposedly slightly more powerful than android annotation
. It really depends on the project and how much of a performance hit you are willing to take. In my opinion just using butterknife
is sufficient to speed up code development by itself. If you need slightly more use android annotation
and lastly if you are willing to take a slight performance hit due to reflection the best option without absolutely destroying performance with a powerhouse Guice
based reflection use dagger
+ butterknife
.