I have heard there two major dependency injection libraries
used in android one is roboguice
and the other one is ButterKnife
the main difference between them is roboguice is run time and buttter knife is compile time
,so i am confused which has better performance on application wheather its run time or compile
,if any idea throws your thoughts here.
Difference between roboGuice and butter knife dependency injection
951 views Asked by Abhijit Chakra AtThere are 3 answers
Butterknife does not seem to me a dependency injection library. Rather than I can call it a view library which makes binding easier, reduces findViewById(...)
statements. There is an article comparing these two libraries http://java.dzone.com/articles/dependency-injection-roboguice
I've been using Roboguice for 3 months and I think it's a really close approximation of what Spring framework does (using injection). Roboguice is really powerful and lets you inject views, Interfaces and classes (even with the app/activity context if you need it).
Even, If you are worried about Roboguice performance, they've launched Roboblender which helps to improve significantly Roboguice performance.
You may find Roboguice documentation in the following Github link
Butter Knife will always be faster because it's based on code generation rather than reflection.
However, you can't call what it does dependency injection. It's just view lookup. It could potentially be called view binding as well. The fact that it refers to itself as "view injection" (note the quotes) is a tongue-in-cheek joke.