Note: This article is not original. I have referred to the articles of several predecessors. This article is just a bit organized.
Reference 1: configure the ndk_r4 development environment in eclipse (Integrating cygwin and CDT)
This section describes how to configure eclipse Automatic Compiling ndk in Windows and Linux respectively.
Refer to 2: Android ndk Development Environment Configuration
This section describes the configuration of the new ndk.
Reference 3: The best ndk entry-level project in history
The development process of ndk helloworld is introduced in detail, but the ndk version is old and the compilation method is different.
1. What is ndk?
Ndk is a collection of tools used by Android applications to call local code. We all know that android applications run on DVM. Using ndk, we can implement direct calls to local code (C, C ++) by applications ). This improves the running efficiency of applications and provides a better user experience.
Ii. helloworld for ndk
1. Download android-ndk-r4b
: Android-ndk-r4b-windows.zip
There are many differences between the new ndk version and the old version. For details, refer to 2 and 3.
2. Download cygwin. To simulate the Linux environment in windows, ndk-build is based on Linux. Cygwin is not required for Linux.
........................ (For details, see the above three references)
Iii. Notes
This is the content of the android. mk file.
1: LOCAL_PATH := $(call my-dir)
2:
3: include $(CLEAR_VARS)
4:
5: LOCAL_MODULE := jniDemo
6: LOCAL_SRC_FILES := com_halzhang_android_jni_Jni.c
7:
8: # If it is configured as include $ (build_static_library), compilation will fail.
9: include $(BUILD_SHARED_LIBRARY)
Oh, that's it. If you have any questions, please leave a message!
Original
Note: This article is not original. I have referred to the articles of several predecessors. This article is just a bit organized.
Reference 1: configure the ndk_r4 development environment in eclipse (Integrating cygwin and CDT)
This section describes how to configure eclipse Automatic Compiling ndk in Windows and Linux respectively.
Refer to 2: Android ndk Development Environment Configuration
This section describes the configuration of the new ndk.
Reference 3: The best ndk entry-level project in history
The development process of ndk helloworld is introduced in detail, but the ndk version is old and the compilation method is different.
1. What is ndk?
Ndk is a collection of tools used by Android applications to call local code. We all know that android applications run on DVM. Using ndk, we can implement direct calls to local code (C, C ++) by applications ). This improves the running efficiency of applications and provides a better user experience.
Ii. helloworld for ndk
1. Download android-ndk-r4b
: Android-ndk-r4b-windows.zip
There are many differences between the new ndk version and the old version. For details, refer to 2 and 3.
2. Download cygwin. To simulate the Linux environment in windows, ndk-build is based on Linux. Cygwin is not required for Linux.
........................ (For details, see the above three references)
Iii. Notes
This is the content of the android. mk file.
1: LOCAL_PATH := $(call my-dir)
2:
3: include $(CLEAR_VARS)
4:
5: LOCAL_MODULE := jniDemo
6: LOCAL_SRC_FILES := com_halzhang_android_jni_Jni.c
7:
8: # If it is configured as include $ (build_static_library), compilation will fail.
9: include $(BUILD_SHARED_LIBRARY)
Oh, that's it. If you have any questions, please leave a message!
Original