【学习Android NDK开发】搭建Android NDK开发环境(Ubuntu 12.04 LTS 32-bit)
来源:互联网 发布:linux清理磁盘空间 编辑:程序博客网 时间:2024/05/20 22:04
1、安装make build工具
执行以下命令:
sudo apt-get install build-essential
2、下载NDK
官网下载页:http://developer.android.com/tools/sdk/ndk/index.html
选择Linux 32/64-bit (x86)版本,下载
下载成功后,解压到/usr/lib/目录下
3、配置Eclipse插件
a) 搭建SDK开发环境,参考:【学习Android NDK开发】搭建Android SDK开发环境(Ubuntu 12.04 LTS 32-bit)
打开Eclipse,设置NDK路径,Window -> Preferences -> Android -> NDK
b) 右键点击项目,Android Tools -> Add Native Support
前提:Eclipse成功安装ADT
4、调试
a) 更新C/C++ Build配置
右键点击项目,Properties -> C/C++ Build -> Builder Settings
Builder Command,由"ndk-build"添加参数“NDK_DEBUG=1”
In NDK r5, ndk-build has been modified to make it easier to switch betweenrelease and debug builds. This is done by using the NDK_DEBUG variable.For example: $NDK/ndk-build NDK_DEBUG=1 => forces the generation of debug binaries $NDK/ndk-build NDK_DEBUG=0 => forces the generation of release binariesIf you don't specify NDK_DEBUG, ndk-build will keep its default behaviour,which is to inspect the AndroidManifest.xml, if any, and see if its<application> element has android:debuggable="true".IMPORTANT: If you use the build tools of SDK r8 (or higher), you won't need to touch your AndroidManifest.xml file at all! That's because if you build a debug package (e.g. with "ant debug" or the corresponding option of the ADT plugin), the tool will automatically pick the native debug files generated with NDK_DEBUG=1.Also, as a convenience, the release and debug object files generated by theNDK are now stored in different directories (e.g. obj/local/<abi>/objs andobj/local/<abi>/objs-debug). This avoids having to recompile all your sourceswhen you switch between these two modes (even when you only modified one ortwo source files).
b) 右击项目,Debug As -> 3 Android Native Application
0 0
- 【学习Android NDK开发】搭建Android NDK开发环境(Ubuntu 12.04 LTS 32-bit)
- 【学习Android NDK开发】搭建Android NDK开发环境(Ubuntu 12.04 LTS 32-bit)
- 在 Ubuntu 12.04 LTS 安装 Android SDK&NDK 开发环境
- Ubuntu下搭建Android NDK开发环境
- Ubuntu下搭建android NDK开发环境
- Ubuntu 下 Android NDK 开发环境搭建
- Android NDK 学习(1) 搭建开发环境
- 【NDK开发】android-ndk r10环境搭建
- 【NDK开发】android-ndk r10环境搭建
- 【NDK开发】android-ndk r10环境搭建
- Android JNI和NDK学习(01)--搭建NDK开发环境
- Ubuntu 12.04 下搭建Android NDK r8 开发环境
- Android NDK 开发环境搭建
- Android NDK 开发环境搭建
- Android ndk 开发环境搭建
- Android ndk 开发环境搭建
- Android NDK 开发环境搭建
- 搭建Android NDK开发环境
- Span的四个常用flag的用法
- Oracle Pipelined Table Functions简介
- 进程间通信 - 剪贴板实现
- LeetCode--Sqrt(x)
- HTTP 错误码
- 【学习Android NDK开发】搭建Android NDK开发环境(Ubuntu 12.04 LTS 32-bit)
- 解决Android与服务器交互大容量数据问题
- 美国站群服务器 站群服务器 【253ip 30兆带宽 千元价格 IPMI】SEO推广 最佳选择
- 玩转O2O的三大基础策略
- Linux_Ant
- 修改IP地址的cmd脚本
- Linux_Jdk
- Linux_Mysql
- 进程间通信 - 邮槽实现