Installing the Android SDK
The Android NDK uses the Android SDK. You can find the Android SDK at
http://code.google.com/android/download.html
This version of the Android NDK requires the Cupcake version of the
Android SDK.
Installing the Prebuilt Native Toolchain
The NDK uses the prebuilt native toolchain from the Android Open Source
git repository.
To download the prebuilt native toolchain to your working directory,
execute the following commands:
git clone
git://android.git.kernel.org/platform/prebuilt.git
cd prebuilt
git checkout -b cupcake -t
origin/cupcake
Setting Environment Variables
The NDK requires that you set two environment variables:
-
PREBUILT must be set to the directory that contains the prebuilt
toolchain. Include the "prebuilt" directory in the path. Example:
/Volumes/android/prebuilt
-
ANDROID_SDK_BASE must be set to the directory that contains the
Android SDK. Example: ~/AndroidSDK
Unpacking the NDK
Unpack the android_pndk.tar.gz into your working directory
tar -zxvf
android_pndk.tar.gz
This will create a directory called pndk. It should contain a README.html
file (this file) and the following directories: config, include, lib, and
sample.
Look in the "samples" directory for samples showing how to use the NDK.