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 ...
随机推荐
- Hive与ES整合
https://www.elastic.co/guide/en/elasticsearch/hadoop/current/hive.html 注:添加的第三方jar必须位于namenode下,否则依然 ...
- 小米范工具系列之六:小米范 web查找器2.x版本发布
小米范web查找器是一款快速识别端口及服务的小工具. 此工具使用java 1.8以上版本运行. 下载地址:http://pan.baidu.com/s/1c1NDSVe 文件名web finder ...
- SHFileOperation的用法
//删除文件或者文件夹bool DeleteFile(char * lpszPath){SHFILEOPSTRUCT FileOp={0};FileOp.fFlags = FOF_ALLOWUNDO ...
- Jmeter之Constant Timer与constant throughput timer的区别
当放置Constant Timer于两个http请求之间,那么它代表的含义是:在上一个请求发出至完成后, 开始Contant Timer指定的时间,最后再发出第二个请求.它并不是代表两个请求之间的发送 ...
- 78. Subsets(回溯)
Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The sol ...
- Codeforces Round #530 (Div. 2) Solution
A. Snowball 签. #include <bits/stdc++.h> using namespace std; ], d[]; int main() { while (scanf ...
- 按月、按日进行数据统计的Mysql语句
<select id="getCustomerTJByUser" parameterType="map" resultType="map&quo ...
- SSL/TLS协议概览
SSL/TLS协议是什么 计算机网络的OSI七层模型和TCP/IP四层模型想必大家都知道.其中SSL/TLS是一种介与于传输层(比如TCP/IP)和应用层(比如HTTP)的协议.它通过"握手 ...
- ImportError: cannot import name 'izip & TypeError: 'float' object cannot be interpreted as an integer
ImportError: cannot import name 'izip' 参考:https://codereview.stackexchange.com/questions/26271/impor ...
- Android下拉刷新控件--PullToRefresh的简单使用
Android中很多时候都会用到上下拉刷新,这是一个很常用的功能,Android的v4包中也为我们提供了一种原生的下拉刷新控件--SwipeRefreshLayout,可以用它实现一个简洁的刷新效果, ...