Android Studio 配置 androidAnnotations框架详细步骤
2016-01-18 13:22
537 查看
第一步:打开app的build.gradle文件
第二步:添加下面红色的部分
第三步:AndroidManifest.xml中每个使用androidAnnotations的Activity名字都要添加_
第四步:修改完之后重新build一下项目即可
作者:caobotao
出处: /article/5260185.html
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接,否则保留追究法律责任的权利。
第二步:添加下面红色的部分
apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.cbt.learnandroidannotations" minSdkVersion 14 targetSdkVersion 22 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.github.rey5137:material:1.1.0' compile 'de.greenrobot:eventbus:2.4.0' compile 'net.steamcrafted:load-toast:1.0.6' } buildscript { repositories { mavenCentral() } dependencies { // replace with the current version of the Android plugin classpath 'com.android.tools.build:gradle:1.1.0' // the latest version of the android-apt plugin classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' } } repositories { mavenCentral() mavenLocal() } apply plugin: 'android-apt' def AAVersion = '3.3.1' dependencies { apt "org.androidannotations:androidannotations:$AAVersion" compile "org.androidannotations:androidannotations-api:$AAVersion" } apt { arguments { androidManifestFile variant.outputs[0].processResources.manifestFile } }
第三步:AndroidManifest.xml中每个使用androidAnnotations的Activity名字都要添加_
<activity android:name=".MainActivity_"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activity android:name=".LoginActivity_"/>
第四步:修改完之后重新build一下项目即可
作者:caobotao
出处: /article/5260185.html
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接,否则保留追究法律责任的权利。
相关文章推荐
- Android Design Support Library——Snackbar
- Android平台Camera实时滤镜实现方法探讨(十一)--实时美颜滤镜
- Android自定义标题栏的实现,及屏蔽系统标题栏
- Android中Parcelable接口用法
- Ubuntu 14.04 搭建 Android 开发环境
- Android_declare-styleable_自己定义控件的属性
- android 电话状态的监听(来电和去电)
- 利用Android属性动画实现Banner的原理与实践
- Android正确关闭线程
- android权限大全详解
- AndroidStudio Gradle DSL method not found: “classpath()”错误解决办法
- android项目里的R文件报错考虑思路
- Android开发中集成protobuf协议
- Android ActionBar的基本用法
- Android计算缓存大小并清空缓存
- Android编程实现对文件夹里文件排序的方法
- Android USB通信学习 USB Host设备通信实际应用
- Android Gradle 中的使用maven私有仓库
- android中更改spinner、AutoCompleteTextView切割线的颜色
- Android 自定义弹性ListView控件实例代码(三种方法)