AndroidAnnotations
uses compilation of processing annotation time. It creates a subclass with an underscore attached to the original name ( MyActivity_ generated from MyActivity ). Therefore, for it to work, you should always use the generated class for references instead of the original class.
It has a very rich feature set, see the list of available annotations .
Butterknife
also uses compilation of time annotation processing, but generates search classes that are used by the central class ( ButterKnife ). This means that you can use your original class for links, but you need to call the injection manually. Copy from ButterKnife introduction:
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.simple_activity); ButterKnife.inject(this);
The set of functions is not so rich, ButterKnife supports viewing injections (the equivalent of AndroidAnnotations will be @ViewById and @ViewsById ) and some event binding (for a complete list, see the namespace directory here , just recount the OnXXX event OnXXX ).
Dagger
this is a DI implementation for Android similar to Guice. It also uses compile-time annotation processing and generates graphs of the objects you use for manual injection. You distinguish between the graph of the application object and the graphs of cloud objects for injection, for example. in activity. Here you see an example Application.onCreate :
@Override public void onCreate() { super.onCreate(); objectGraph = ObjectGraph.create(getModules().toArray()); objectGraph.inject(this);
It seemed to me that starting with a dagger is more difficult, but it can only be my experience. However, see some videos for a better start: 1 , 2
In terms of feature set, I would say that Dagger implements functionality that can be compared with the functionality of AndroidAnnotation @EBean and @Bean .
Summary
If you are comparing ease of use, testing support, and performance, I cannot find much difference between using AndroidAnnotation and ButterKnife + Dagger. Differences in the programming model (use classes with _ instead of using the source and call the injection manually) and in the set of functions.
AndroidAnnotation gives you a complete list of features, but links you to specific libraries. For example, if you use its rest api, you should use Spring Android. You also have annotations for features like OrmLite ( @OrmLiteDao ), regardless of whether you use OrmLite or not.
In the end, it is a matter of taste, at least in my opinion.