Android Studio 1.5 配置AndroidAnnotations
2016-04-09 14:51
447 查看
在项目中添加Android Annotions注解(基于Gradle)
1. 在build.gradle(project下)中添加对apt的依赖
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
2.在build.gradle(当前模块中)应用apt依赖,并定义AA版本
//在当前module中使用apt插件 apply plugin: 'com.neenbedankt.android-apt' //定义变量(AA版本) def AAVersion = '3.3.2'
3.定义对androidannotations.jar的依赖, 并交给apt插件
//定义对androidannotations.jar的依赖, 并交给apt插件 apt "org.androidannotations:androidannotations:$AAVersion" //定义对android-api.jar的依赖, 将编译打包到apk中 compile "org.androidannotations:androidannotations-api:$AAVersion" apt { arguments { androidManifestFile variant .outputs[0].processResources.manifestFile } }
注意:
请保持网络畅通
androidannotions地址: https://github.com/excilys/androidannotations
相关文章推荐
- Android中 Paint 字体、粗细等属性的一些设置
- Android:TextInputLayout的简单使用
- 直接拿来用!最火的Android开源项目
- Android ViewStub的应用
- Android的文件系统结构 .
- android源码解析之(八)-->Zygote进程启动流程
- Android课程---qq登陆页面(练习)
- Android枚举类型(enum)替换方案
- 使用viewpager或者fragmentActivity等一些v4包下的类,当我们按F3时无法查看到源码,这个时候就需要我们关联该源码,该源码的关联与android源码的关联不一样。
- # AndroidStudio 常用工具和使用技巧(持续更新)
- Android中处理崩溃异常和记录日志
- Android夜间模式官方最佳实践
- Android工具
- Android 的SQLite
- 关于androidManifest.xml的概叙以及intent-filter的详细分析
- Android Studio开发JNIproject
- 【Android】如何实现ButterKnife
- Android APK瘦身之Android Studio Lint (代码审查)
- 【Android】如何快速构建Android Demo
- Android PopupWindow简单解析