Android NDK for Windows setup guide
来源:互联网 发布:三星盖乐世3淘宝 编辑:程序博客网 时间:2024/04/30 11:31
http://www.pocketmagic.net/?p=1332
Android NDK for Windows setup guide
By Radu Motisan Posted on August 24th, 2010
Introduction
Since most of the NDK tools are coming from the Linux environment, that OS was my first approach in building native C applications for Android. See this tutorial for a start.
However, I also needed to be able to compile JNI Android apps using the Windows environment. It proved an easy task, but there were some issues, so I decided to write this guide.
Install Android NDK on Windows and use it to compile a JAVA/JNI application
You will need an internet connection to install Cygwin and the Android SDK automatically from the Internet.
Download link.
Current version of the file is: android-ndk-r4b-windows.zip 45MB
Download link. (Direct Link)
Select the mirror you need to download from then follow the installation guide.
On package selection, Open Devel category and check "make":
I've installed it to C:/cygwin
Download link.
Current version is android-sdk_r06-windows.zip 23MB
4.1) Unzip the zip content to a location on your harddisk. I choose:
D:/work_code/android/android-sdk-windows/
You will find SDK Setup.exe . Run it. I get a warning to install JAVA JDK
4.2) Download Java JDK
Download link.
Select platform "Windows". Current file is: jdk-6u21-windows-i586.exe (Direct link)
4.3) Install the Java JDK: simply run the exe . It takes a few minutes to complete.
4.4) Re-run the SDK Setup.exe from the Android SDK.
This opens the Android SDK and AVD Manager. If you get a HTTPS Error:
go to Settings and check the "Force https:// ..." checkbox:
4.5) Go to Available Packages, select all, and press Install Selected:
The installer will download the packages from the internet, and might prompt you to accept terms, which you must do if you want to continue with the installation. This step takes a few minutes.
5.1) Unzip the NDK zip file. My choice is: D:/work_code/android/android-ndk-r4b/
5.2) Configure Cygwin parameters
Go to the Cygwin folder and open Cygwin.bat. It contains something like this:
@echo off C:chdir C:/cygwin/bin bash --login -i
Using any text editor change it to:
@echo off set IS_UNIX=set DEV_ROOT=d:/work_code/android/BlueInputset JAVA_HOME=c:/Progra~1/Java/jdk1.6.0_21set CLASSPATH=d:/work_code/android/BlueInput/objset PATH=D:/work_code/android/android-sdk-windows/tools;D:/work_code/android/android-ndk-r4bset ANDROID_NDK_ROOT=/cygdrive/d/work_code/android-ndk-r4bset NDK_PROJECT_PATH=/cygdrive/d/work_code/android/BlueInput C:chdir C:/cygwin/bin bash --login -i
The path in the config, d:/work_code/android/BlueInput, is something I'm currently working on. Change to your Own project name. The project must be organized as follows:
A) The JNI part (the .c and .h and Android.mk files) in:
d:/work_code/android/BlueInput/jni
B) The JAVA part (assets,bin,gen,jni,libs,obj,res,src with the .java files) in:
d:/work_code/android/BlueInput
For these paths always use forward slashes.
5.3) Open Cygwin and browse to the NDK folder, using cd [enter] :
cd d:/work_code/android-ndk-r4b
5.4) Type ./ndk-build to compile the JNI project
The C files have been successfully built. Now using Eclipse, you can build the Java android project, and it will include the JNI part automatically. Easy.
By Radu Motisan
- Android NDK for Windows setup guide
- HOWTO install and setup Android NDK for Windows(Android NDK 开发环境安装和配置)
- HOWTO install and setup Android NDK for Windows(Android NDK 开发环境安装和配置)
- windows cygwin android ndk compile env setup
- Complete Setup Guide for Android SDK / ADT Bundle on Ubuntu
- HOWTO install and setup Android NDK for Linux(Android NDK安装遇到的问题和解决方法)
- setup emacs for windows
- BerryGPS setup Guide for Raspberry Pi
- Android NDK Cross-Compile Setup
- Android NDK Cross-Compile Setup
- setup for android
- 2.NativeScript SetUp For Windows
- Trixbox v1.2 Complete setup guide for a small business
- install android ndk, host-setup.sh error
- Android Beginners: NDK Setup Step by Step
- debian linux android ndk compile env setup
- Android Beginners: NDK Setup Step by Step
- Android.NDK.Beginner's.Guide 一处小错误
- [进程]capget()/capset() -- 获得/设置进程的权能
- sso原理
- 10 12 27 不怎么顺利
- Android C native development – take full control!
- 如何访问具有动态ip的linux服务器
- Android NDK for Windows setup guide
- 手机行业年终考试
- 挂断电话
- 10 12 28 错过时间
- 10 12 29 弄得比较晚
- 10 12 30 终于OK了
- Android C native development using the NDK under Windows
- 10 12 31 回GZ
- FastDB应用