项目地址:https://github.com/excilys/androidannotations
文档介绍:https://github.com/excilys/androidannotations/wiki
官网网址:http://androidannotations.org/
特点:(1) 依赖注入:包括 view,extras,系统服务,资源等等
(2) 简单的线程模型,通过 annotation 表示方法运行在 ui 线程还是后台线程
(3) 事件绑定:通过 annotation 表示 view 的响应事件,不用在写内部类
(4) REST 客户端:定义客户端接口,自动生成 REST 请求的实现
(5) 没有你想象的复杂:AndroidAnnotations 只是在在编译时生成相应子类
(6) 不影响应用性能:仅 50kb,在编译时完成,不会对运行时有性能影响。
其他:与 roboguice 的比较:roboguice 通过运行时读取 annotations 进行反射,所以可能影响应用性能,而 AndroidAnnotations 在编译时生成子类,所以对性能没有影响。
AndroidAnnotations配置
https://github.com/androidannotations/androidannotations/wiki/Building-Project-Gradle
Demo:https://github.com/suyimin/androidannotations