Project的build.gradle文件配置如下:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
} allprojects {
repositories {
jcenter()
}
} task clean(type: Delete) {
delete rootProject.buildDir
}

关键语句为:

classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

Module的build.gradle文件配置如下:

apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '3.2'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3" defaultConfig {
applicationId "com.myapplication"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
} }
//配置Android annotations
apt {
arguments {
androidManifestFile variant.outputs[0]?.processResources?.manifestFile
}
} dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion" }

关键语句为:

apply plugin: 'android-apt'
def AAVersion = '3.2'

apt {
arguments {
androidManifestFile variant.outputs[0]?.processResources?.manifestFile
}
}
 apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"

Manifests文件配置如下:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapplication"> <application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity_">
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application> </manifest>

关键语句为:

<activity android:name=".MainActivity_">

Android Studio 1.5 注解配置的更多相关文章

  1. Google Android Studio Kotlin 开发环境配置

    Google 近日开发者大会宣布Kotlin成为Android开发的第一级语言,即Android官方开发语言,可见Google对Kotlin的重视,本文就介绍一下Android Studio下的Kot ...

  2. Android studio打包APK混淆配置

    要在打包APK时加入混淆需要在Module中的buid.gradle中加入如下信息 buildTypes { release { minifyEnabled true shrinkResources ...

  3. Android Studio之gradle的配置与介绍

    1.gradle的简单介绍 Gradle是可以用于Android开发的新一代的Build System,也是Android Studio默认的build工具.其实Gradle脚本是基于一种JVM语言- ...

  4. Android Studio 的安装和配置篇(Windows篇)

    上一篇介绍完了Android Studio,这一篇就专门来讲讲怎么安装配置的吧. 其实好多人都卡到安装配置这一步,想当初我也是,万恶的XX防火墙,导致下载Android Studio 的gradle异 ...

  5. Android Studio开发环境变量配置

    1,Android Studio官网可以下载 可以选择下载带有SDK版本 2,如果没有配置SDK,AVD虚拟机是没法使用的,真机调试也用不了. 有时会提醒adb is not connected. 和 ...

  6. Android Studio中JNI -- 1 -- 配置方法

    1.配置NDK 1.1 下载NDK Android Studio 1.2 配 android-ndk-r10e,不同版本的Studio需要配置不同的ndk,下载完成后,随便解压放至某个文件目录下 1. ...

  7. Android Studio下载安装及配置图文教程

    原文 http://jingyan.baidu.com/article/9c69d48f56835e13c9024e95.html AndroidStudio下载地址:https://develope ...

  8. Android Studio 从安装到配置使用

    Android Studio是谷歌为android量身定制的IDE,在2013年谷歌大会上提出之后一直持续更新,现在已经是功能十分强劲的android开发工具,作为一个android开发者,还是早点转 ...

  9. android ndk-build 编译静态库libxx.a 以及Android studio openssl 静态库配置(cmake)

    android ndk-build 编译静态库libxx.a 需求场景: 目前有安卓编码好的现在的openssl的两个.a,我们需要调用openssl的函数,并把功能再封装成.a; 这样使用时,在an ...

随机推荐

  1. Android(十六 ) android 与蓝牙串口通讯

    1.得到蓝牙适配器 BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); 2.打开蓝牙 if (!mBl ...

  2. 【Python】接口自动化测试-Fidder的使用(未完待续……)

    一.fidder一些一定需要掌握的知识. 1.工具简介 2.清屏操作(1中提到了,这里再着重说明下): 3.get和post请求参数相关: 4.会话框(Fidder左侧区域内容解析): 5.Reque ...

  3. QQ-AR助人教版小学英语“动”起来

    日前,人教数字出版公司与腾讯QQ达成合作,将以小学英语3-6年级8本课本为合作试点,共同推出全国首个可AR识别的课本,在QQ-AR的帮助下,课本也能“动”起来,更加生动立体地展现在孩子眼前,让学习变得 ...

  4. vue学习之一vue初识

    一.vue.js是什么 Vue (读音 /vjuː/,类似于 view) 是一套用于构建用户界面的渐进式框架.与其它大型框架不同的是,Vue 被设计为可以自底向上逐层应用.Vue 的核心库只关注视图层 ...

  5. 经验搜索排名---google已经做过类似的了(我想多了)

    由于编程的原因,我们需要经常的查资料,现在转载的文章比较多,我们经常看到的搜索结果的前十名基本上有7名是转载的.这样看起来很没有效率,后来突然想到,如果把大家的浏览结果搜集起来,然后进行权重排名,这样 ...

  6. mongodb的安装和权限管理

    mongodb4.0已经发布,但是鉴于线上环境更多的是使用旧版本的mongodb,我们这里使用的mongodb3.4版本. 官网下载地址为:https://fastdl.mongodb.org/lin ...

  7. MySQL 学习笔记整理

    1.      创建表 CREATE TABLE item( ID INT(6) NOT NULL AUTO_INCREMENT, Name CHAR(32) NOT NULL, Price DECI ...

  8. linux下递归删除指定后缀名的文件

    以删除当前目录到所有子目录下的后缀名为rej的文件为例: find . -name "*.rej" |xargs rm -f

  9. uboot能ping通本机无法ping通本机上搭建的虚拟机

    注意 转载请注明出处:https://www.cnblogs.com/dakewei 一.背景 1.1 uboot不能被其它主机ping通,这是由于uboot没有对其它主机发送过来的arp包进行响应, ...

  10. CentOS7.2 安装RabbitMQ3.6.10

    CentOS上面使用yum安装比较方便 先记录一些rabbitmq的基本操作命令: $ sudo chkconfig rabbitmq-server on # 添加开机启动RabbitMQ服务 $ s ...