Android Studio 1.5 注解配置
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'
def AAVersion = '3.2'
apt {
arguments {
androidManifestFile variant.outputs[0]?.processResources?.manifestFile
}
}
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
arguments {
androidManifestFile variant.outputs[0]?.processResources?.manifestFile
}
}
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 注解配置的更多相关文章
- Google Android Studio Kotlin 开发环境配置
Google 近日开发者大会宣布Kotlin成为Android开发的第一级语言,即Android官方开发语言,可见Google对Kotlin的重视,本文就介绍一下Android Studio下的Kot ...
- Android studio打包APK混淆配置
要在打包APK时加入混淆需要在Module中的buid.gradle中加入如下信息 buildTypes { release { minifyEnabled true shrinkResources ...
- Android Studio之gradle的配置与介绍
1.gradle的简单介绍 Gradle是可以用于Android开发的新一代的Build System,也是Android Studio默认的build工具.其实Gradle脚本是基于一种JVM语言- ...
- Android Studio 的安装和配置篇(Windows篇)
上一篇介绍完了Android Studio,这一篇就专门来讲讲怎么安装配置的吧. 其实好多人都卡到安装配置这一步,想当初我也是,万恶的XX防火墙,导致下载Android Studio 的gradle异 ...
- Android Studio开发环境变量配置
1,Android Studio官网可以下载 可以选择下载带有SDK版本 2,如果没有配置SDK,AVD虚拟机是没法使用的,真机调试也用不了. 有时会提醒adb is not connected. 和 ...
- Android Studio中JNI -- 1 -- 配置方法
1.配置NDK 1.1 下载NDK Android Studio 1.2 配 android-ndk-r10e,不同版本的Studio需要配置不同的ndk,下载完成后,随便解压放至某个文件目录下 1. ...
- Android Studio下载安装及配置图文教程
原文 http://jingyan.baidu.com/article/9c69d48f56835e13c9024e95.html AndroidStudio下载地址:https://develope ...
- Android Studio 从安装到配置使用
Android Studio是谷歌为android量身定制的IDE,在2013年谷歌大会上提出之后一直持续更新,现在已经是功能十分强劲的android开发工具,作为一个android开发者,还是早点转 ...
- android ndk-build 编译静态库libxx.a 以及Android studio openssl 静态库配置(cmake)
android ndk-build 编译静态库libxx.a 需求场景: 目前有安卓编码好的现在的openssl的两个.a,我们需要调用openssl的函数,并把功能再封装成.a; 这样使用时,在an ...
随机推荐
- 【转发】Python使用openpyxl读写excel文件
Python使用openpyxl读写excel文件 这是一个第三方库,可以处理xlsx格式的Excel文件.pip install openpyxl安装.如果使用Aanconda,应该自带了. 读取E ...
- mybatis 中jdbctype和javatype的对应关系
1:mybatis 中jdbctype和javatype的对应关系 JDBC Type Java Type CHAR String VARCHAR String LONGVARCHAR String ...
- HDU2588:GCD(欧拉函数的应用)
题目链接:传送门 题目需求:Given integers N and M, how many integer X satisfies 1<=X<=N and (X,N)>=M.(2& ...
- cocos代码研究(11)ActionManager类学习笔记
理论部分 ActionManager是一个单例类,管理所有动作. 通常你不需要直接使用这个类.大多情况下,你将使用Node的接口,它提供了更友好的封装 但也有一些情况下,你可能需要使用这个单例. 示例 ...
- 001-springmvc之原理图
1.流程. 2.时序图. 3.方法调用. (0)DispatcherServlet类.提供了HandlerMapping成员关联关系. /** MultipartResolver used by th ...
- 4gcc编译器
gcc编译器(GNU C Compiler) 现在我们所说的 gcc 是 GUN Compiler Collection的缩写,可以支持多种语言编译,比如 C,C++,Java, pascal 等 g ...
- 20145202马超 2016-2017-2 《Java程序设计》第7周学习总结
学号 2016-2017-2 <Java程序设计>第X周学习总结 教材学习内容总结 Arrays:用于操作数组的工具类. 里面都是静态方法. asList:将数组变成list集合. 把数组 ...
- python ConfigParser读取配置文件,及解决报错(去掉BOM)ConfigParser.MissingSectionHeaderError: File contains no section headers的方法
先说一下在读取配置文件时报错的问题--ConfigParser.MissingSectionHeaderError: File contains no section headers 问题描述: 在练 ...
- 获取WebView加载的网页内容并进行动态修改
http://www.jianshu.com/p/3f207a8e32cb [Android]WebView读取本地图片 http://www.cnblogs.com/kimmy/p/4769788. ...
- Linux学习笔记之Linux启动级别
对于绝大多数Linux程序员来说,进入Linux系统后一般看到的是黑乎乎的界面(开发模式),因为系统如果启动选择开发模式,会减少启动时间,优化内存等.但是通常我们刚安装完Linux系统,然后进去以后是 ...