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. Python开发【笔记】:接口

    接口 什么是接口 ? 接口只是定义了一些方法,而没有去实现,多用于程序设计时,只是设计需要有什么样的功能,但是并没有实现任何功能,这些功能需要被另一个类(B)继承后,由 类B去实现其中的某个功能或全部 ...

  2. mybatis三剑客之mybatis-pagehelper分页插件

    这是pom.xml里的依赖: 后续再讲具体的使用

  3. boost pool 和 object_pool

    内存池(Memory Pool)是一种内存分配方式.        通常我们习惯直接使用new.malloc等API申请分配内存,这样做的缺点在于:由于所申请内存块的大小不定,当频繁使用时会造成大量的 ...

  4. 分布式存储之MogileFS基于Nginx实现负载均衡(Nginx+MogileFS)

    MogileFS分布式文件系统特点: 1.具有raid的性能 2.不存在单点故障 3.简单的命名空间: 每个文件对应一个key:用于domain定义名称空间 4.不共享任何数据 5.传输中立,无特殊协 ...

  5. Preview all adidas NMD Singapore colorways just below

    A week ago, we've got a glimpse into adidas NMD Singapore for the future using their Tubular line. O ...

  6. kafka环境安装

    源码包下载: http://archive.apache.org/dist/kafka/1.0.0/ 集群环境: master 192.168.1.99 slave1 192.168.1.100 sl ...

  7. shell指令操作memcached

    shell指令操作memcached,可以用来直接测试memcached. 初始值为1000 #set test-value =1000printf "set test-value 0 0 ...

  8. Win10下安装Go开发环境

    关于Go语言有多么值得学习,这里就不做介绍了,既然看了这篇文章,想必是对有学习意向. 这里是在Windows下安装Go环境,去中文社区的下载栏目,https://studygolang.com/dl ...

  9. 2018-2019-1 20189215 《Linux内核原理与分析》第四周作业

    <庖丁解牛>第三章书本知识总结 计算机的三大法宝 存储程序计算机 函数调用堆栈 中断 操作系统的两把宝剑 中断上下文的切换--保存现场和恢复现场 进程上下文的切换 Linux内核源码的目录 ...

  10. ENC28J60

    8 KB发送接收数据包双端口 SRAM