The Android NDK is an abbreviation for the native development Kit running on the Android platform. Android app developers can invoke C or C + + native code through the NDK.
The role of the NDK:
- Code protection, because the Java layer Code of the APK is easy to decompile, and the C + + library counter-sink is more difficult.
- Call third-party C/S libraries in the NDK, because most of the open source libraries are written in C/s + + code.
- It is easy to transplant and can be used again on other embedded platforms with C + + write libraries.
The following is the installation configuration process for the NDK.
Environment: The Ubuntu10.10 (NDK can only be installed under Linux) has an Android development environment installed.
1. Download
There is no access to Google's relevant pages at home, but can be downloaded directly from the address below.
http://dl.google.com/android/ndk/android-ndk-r8b-linux-x86.tar.bz2
: http://www.cnblogs.com/yaotong/archive/2011/01/25/1943615.html
2. Unzip
Personal habits put things under the/usr/local/lib folder.
command to use:
Copying files
CP Android-ndk-r8b-linux-x86.tar.bz2/usr/local/lib
Unzip the file
Tar jxvf android-ndk-r8b-linux-x86.tar.bz2
Modify Permissions
chmod 777 Android-ndk-r8b-r
3. Modifying environment variables
Terminal operation: Gedit ~/.BASHRC
Add the following statement to the
#NDKsetting
ndk_root=/usr/local/lib/android-ndk-r8b
Export Ndk_root
Save, terminal run: Source ~/.BASHRC
Make it effective immediately.
Running at Terminal: Echo $NDK _root
If the path to the NDK is printed correctly, the environment variable is modified successfully.
4. Testing
The CD enters Android-ndk-r8b/samples/hello-jni and then runs the NDK's compile script at the terminal:
Sudo/usr/local/lib/android-ndk-r8b/ndk-build
If the results are as follows, the NDK installation succeeds.
./configure--prefix=/zwjinfo/ffmpeg/dist--enable-cross-compile--enable-static--enable-shared--ENABLE-GPL-- Disable-encoders
--disable-muxers--disable-filters--arch=arm--cpu=armv7-a
--enable-memalign-hack--disable-symver--enable-asm--enable-neon--cross-prefix=/zwjinfo/ndkr10/android-ndk-r10/ toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
--sysroot=/zwjinfo/ndkr10/android-ndk-r10/platforms/android-l/arch-arm--sysinclude=/zwjinfo/ndkr10/ Android-ndk-r10/platforms/android-l/arch-arm--disable-debug--target-os=linux--extra-cflags= '-MFLOAT-ABI=SOFTFP -o3-mfpu=vfpv3-d16-marm-mthumb '--disable-doc
--disable-yasm--enable-pic--enable-small--enable-hardcoded-tables--extra-ldflags= '-Wl,--fix-cortex-a8-mthumb '- March=armv7-a-mfpu=vfpv3-d16-os-ox-mfloat-abi=softfp-mthumb
./configure--prefix=/zwjinfo/ffmpeg/android/arm--enable-shared--disable-static--disable-doc-- Disable-ffserver--enable-cross-compile--cross-prefix=/zwjinfo/ndkr10/android-ndk-r10/toolchains/ Arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi---target-os=linux--arch=arm--sysroot =/zwjinfo/ndkr10/android-ndk-r10/platforms/android-l/arch-arm/--extra-cflags= '-os-fpic-marm '--extra-ldflags=
./configure--prefix=/zwjinfo/ffmpeg/dist--enable-cross-compile--enable-static--enable-shared--ENABLE-GPL-- Disable-encoders--disable-muxers--disable-filters--arch=arm--cpu=armv7-a--enable-memalign-hack--disable-symver --enable-asm--enable-neon--cross-prefix=/zwjinfo/ndkr10/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/ prebuilt/linux-x86_64/bin/arm-linux-androideabi---sysroot=/zwjinfo/ndkr10/android-ndk-r10/platforms/android-l/ Arch-arm--sysinclude=/zwjinfo/ndkr10/android-ndk-r10/platforms/android-l/arch-arm--disable-debug--target-os= Linux--extra-cflags= '-mfloat-abi=softfp-o3-mfpu=vfpv3-d16-marm-mthumb '--disable-doc--disable-yasm--enable-pic- -enable-small--enable-hardcoded-tables--extra-ldflags= '-wl,--fix-cortex-a8-mthumb '
-march=armv7-a-mfpu=vfpv3-d16-os-ox-mfloat-abi=softfp-mthumb
64-bit CentOS NDK compiler FFMPEG