After downloading the appropriate NDK from Google, simply uncompress it into a suitable directory.
$ bunzip2 ~/Downloads/android-ndk-r5b-linux-x86.tar.bz2 $ tar xvf ~/Downloads/android-ndk-r5b-linux-x86.tar ./Now the NDK is located is some directory
...and that's it! Now time to have some fun.
First review the examples included with the NDK. The basic flow (as described by the NDK page):
- Place your native sources under
<project>/jni/... - Create
<project>/jni/Android.mkto describe your native sources to the NDK build system - Optional: Create
<project>/jni/Application.mk. - Build your native code by running the 'ndk-build' script from your project's directory. It is located in the top-level NDK directory:
cd <project> <ndk>/ndk-build
The build tools copy the stripped, shared libraries needed by your application to the proper location in the application's project directory. - Finally, compile your application using the SDK tools in the usual way. The SDK build tools will package the shared libraries in the application's deployable
.apkfile.
For complete information on all of the steps listed above, please see the documentation included with the NDK package.
No comments:
Post a Comment