您的位置:首页 > 其它

Notes - wk11 Gradle, NDK, and other

2016-05-13 11:42 190 查看
previously: <-use of LBS

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

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:

/article/8947684.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: