Android Studio ndk第一次使用
2015-03-06 13:49
423 查看
**
ndk下载32地址:http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86.bin
ndk下载64位地址:http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86_64.bin
官方文档给出的以下安装提示(进在Linux下进行的尝试):
On Linux and Mac OS X (Darwin):
Download the appropriate package from this page.
Open a terminal window.
Go to the directory to which you downloaded the package.
Run chmod a+x on the downloaded package.
其实就是使用Ctrl+Alt+T组合键打开terminal,使用如下命令进行下载:
文件夹android-ndk-r10d就是Ndk的目录文件!
接下来需要配置环境变量:
添加如下内容:
然后使用命令:
使用命令检查配置:
系统环境:Ubuntukylin14.04
Java环境:JDk1.7
打开Android Stidio工具:
导入Ndk文件下的示例Demo,代码所在目录:~android/android-ndk-r10d/samples/hello-jni
如图:
左边是工程目录,右边文件是local.properties的内容,需要在里面添加:
然后运行hello-jni工程即可编译成功
1。安装Ndk并配置环境变量:
系统环境:Ubuntukylin 14.04 ,32位系统ndk下载32地址:http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86.bin
ndk下载64位地址:http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86_64.bin
官方文档给出的以下安装提示(进在Linux下进行的尝试):
On Linux and Mac OS X (Darwin):
Download the appropriate package from this page.
Open a terminal window.
Go to the directory to which you downloaded the package.
Run chmod a+x on the downloaded package.
其实就是使用Ctrl+Alt+T组合键打开terminal,使用如下命令进行下载:
$:mkdir android $:cd android android$:wget http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86.bin android$:chmod a+x android-ndk-r10c-darwin-x86.bin android$:./android-ndk-r10c-darwin-x86.bin
文件夹android-ndk-r10d就是Ndk的目录文件!
接下来需要配置环境变量:
$:gedit .bashrc
添加如下内容:
export NDK=/home/xff/android/android-ndk-r10d export PATH=${PATH}:$NDK `
然后使用命令:
$:source .bashrc
使用命令检查配置:
~$ ndk-build -v GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for x86_64-pc-linux-gnu
2。Ndk使用示例
Android开发工具:Android Studio 1.0系统环境:Ubuntukylin14.04
Java环境:JDk1.7
打开Android Stidio工具:
导入Ndk文件下的示例Demo,代码所在目录:~android/android-ndk-r10d/samples/hello-jni
如图:
左边是工程目录,右边文件是local.properties的内容,需要在里面添加:
ndk.dir=/home/xff/android/android-ndk-r10d
然后运行hello-jni工程即可编译成功
相关文章推荐
- mac android studio NDK 安装使用(不用翻墙)
- 【Android】android studio ndk使用例子
- Android Studio使用新的Gradle构建工具配置NDK环境
- NDK 在 Android studio如何使用(Android studio NDK)
- Android Studio第一次使用配置gradle项目构建
- Android Studio NDK使用
- Android Studio NDK基础使用
- [Android Studio / NDK] 如何使用javah生成.h文件
- Android Studio使用gradle-experimental构建NDK工程(无需Android.mk、Application.mk文件)
- Android studio NDK配置使用
- android studio ndk使用openMP
- Android Studio NDK开发之javah命令使用
- android studio NDK使用教材以及出现
- android studio NDK使用,编译c生成.so实践记录
- Android Studio NDK配置及使用
- Android Studio NDK环境配置(opencv)以及使用
- window环境下使用ndk编译出android studio/Eclipse能使用的ffmpeg动态库
- (原)使用android studio ndk开发流程
- android studio ndk 配置使用(好用的链接)
- Android Studio NDK环境配置及JNI使用方法