Notes - wk11 Gradle, NDK, and other

previously: <-use of LBS

  1. Gradle

Gradle 是一个基于Apache Ant和Apache Maven概念的项目自动化构建工具。当前支持语言限于Java, Groovy, Scala.

Coding:
-编译源代码
-运行单元测试和集成测试
-执行静态代码分析
-创建发布版本
-部署目标环境
-部署传递过程
-执行冒烟测试和自动化测试

shell-command line - gradle setting

gradle-gradle-wrapper.properties下面有一个gradle下载链接地址,在我们运行程序的时候如果确实gradle或者gradle对应链接下载不了,可能会卡死
可以在settings-preference里-gardle设置use local gradle distribution, 引用gradle官网链接地址

setting.gradle: 包含的模块, shift+F6 refract
file - new module libraryName
build.gradle: //top level build file where you can add configuration options common to all sub-projects/modules;
jcenter
task clean(type: Delete) {
delete rootProject.buildDir //can also write in Java here
}

Gradle command lines:
gradle: help, version, build, clean, tasks, tasks-all
build-outputs-apk
gradle stop: ctrl + c
rm -rf ~/.gradle
gradle clean && gradle build
gradle assembleDebug/aD
gradle运行支持缩写,测试,Lint,合并规则
aar自带manifest

settings-preferences-gradle-offline work
dex 65535
按字母顺序排列
Docs:
Gradle User:
https://docs.gradle.org/current/userguide/userguide.html
Google gradle plugin user guide

  1. NDK (native development kit)/JNI (Java native interface Java原生接口)

使用NDK的优势:1. 保护代码:APK的JAVA层容易被反编译,C/C++库返回难度较大;2. 方便使用现存开源库; 3. 提高程序的执行效率;4. 便于移植
劣势:1. 开发麻烦;2. 调试不方便; 3. 难度相对较高
ATTN: 使用NDK大部分情况下是需要将一些已有的C函数库移植到Android平台的所选择的快捷方法,而不是作为提高代码效率的手段

How to
1. use AS to creae a native project
2. to build and trace native code
3. use experimental gradle plugin for native project

使用编译好的”.so”动态库//copy and quote
使用C/C++源代码开发

下载NDK,配置 (http://developer.android.com/intl/zh-cn/ndk/index.html
也可以直接project structure 下面NDK直接download

References:
http://blog.csdn.net/zt1990088/article/details/51348287

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值