网友通过本文主要向大家介绍了androidannotations,android ui框架,android 网络框架,android 开发框架,android 数据库框架等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
[AndroidAnnotations框架]AndroidAnnotations的配置介绍
一、在AndroidStudio下配置androidannotations
首先,准备好你的project。
AndroidStudio下的androidannotations配置是比较容易的,只需要配置两个build.gradle就可以。
配置build.gradle
( 1 ) 我们先配置preject目录下的build.gradle
在buildscript> dependencies>下添加
classpath'com.neenbedankt.gradle.plugins : android-apt : 1.4'
( 2 ) 然后是配置app目录下的build.gradle
1) 在apply plugin:'com.android.application'
下增加一行
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
2) 定义一个版本的常量,当前最新的版本是3.3.2
def AAVersion = '3.3.2'
3) 添加依赖
dependencies {
apt "org.androidannotations : androidannotations : $AAVersion"
compile "org.androidannotations : androidannotations-api : $AAVersion"
}
4) 添加apt
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
}
}
然后build一下project,就ok啦~
二、在eclipse下配置androidannotations
下载所需jar包。下载地址,当前最新的版本是3.3.2。解压压缩包,拿到androidannotations-api-*.jar
和androidannotations-*.jar
。导入jar包到工程中。androidannotations-api-*.jar
放到工程的libs
目录下,在工程目录下新建一个目录compile-libs
,将androidannotations-*.jar
放到compile-libs
目录下。配置工程。步骤一: Properties>Java Compiler>在Enable project specific settiongs处打勾,然后设置Compiler compliance level: 1.6

步骤二: PrZ喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vcGVydGllcyZndDtKYXZhIENvbXBpbGVyJmd0O0Fubm90YXRpb24gUHJvY2Vzc2luZyZndDvU2kVuYWJsZSBwcm9qZWN0IHNwZWNpZmljIHNldHRpb25nc7SmtPK5tDxiciAvPg0KPGltZyBhbHQ9"" src="http://www.bkjia.com/uploads/allimg/160311/041F95325-1.png" title="\" />
步骤三: Properties>Java Compiler>Annotation Processing>Factory Path>在Enable project specific settiongs处打勾,然后Add JARs->浏览工程目录,选择
compile-libs
目录下的androidannotations-*.jar
,最后确定就可以。
