These days to write an Android runtime to speed up HTML5 Canvas, so that GAMEBUILDER+CANTK not only the development speed, speed can also be close to native applications. So it took a little time to study
Android NDK, the online information is about the IDE's compilation method, here to record the command line under the compilation method, for the needs of friends reference.
Here is an example of compiling HELLO-GL2:
- 0. Install the Android NDK/SDK, set the PATH variable (depending on the situation)
PATH=$PATH:/work/android/android-sdk-linux/platform-tools/:/work/android/android-sdk-linux/tools/PATH=$PATH:/work/android/android-ndk-r8/build/tools:/work/android/android-ndk-r8/PATH
- 1. Create a new project with Android
cd /work/android/android-ndk-r8-n-p-a-k com.-t1
The purpose of creating this project is to produce the files required by the ant compilation:
build.xml local.properties project.properties
- 2. Now that you need to compile the NDK example, copy the files to the corresponding directory. Compile HELLO-GL2 here:
[lixianjing@lixianjing samples]$ cp hello/build.xml hello-gl2/[lixianjing@lixianjing samples]$ cp hello/local.properties hello-gl2/[lixianjing@lixianjing samples]$ cp hello/project.properties hello-gl2/
- 3. Then compile, first compile the native code with Ndk-build, and then use ant Debug to produce the APK.
[lixianjing@lixianjing hello-gl2]$ ndk-build [lixianjing@lixianjing hello-gl2]$ ant debug
Example code for compiling Android NDK under linux command line