1, install ADT plugin, CDT plugin
2,SDK Directory Configuration:
The Eclipse File menu selects window---> Preferences---> Android---> Set the SDK location---> Browse to select the SDK directory. Such as:
NDK Directory Configuration:
After setting up the SDK, you also need to set the "NDK" on the "Android" configuration item, and after selecting the NDK, there is an option "NDK location", which configures the NDK root directory.
3, set the build parameter, set the build command in project->properties->c/c++ build, remove the Use default option, and add parameters after Ndk-build ndk_debug= 1, make compiled so with the source code debugging information.
4, right click on project, add native support menu
5, the result file compiled with NDK has OBJS directory, and the dynamic library under this directory is copied to the Libs directory.
6, run-time select the Android native application under Debug as
7, switch eclipse to DDMS view mode, select the process to debug, then click the Debug icon.
Problem:
1, unable to detect application ABI ' s
Workaround: Edit the Application.mk file to add the following two lines according to your emulator processor type and SDK level:
App_abi: = armeabi-v7a
App_platform: = android-14 (must correspond to android:minsdkversion in Androidmenifest.xml)
2.
Gdbserver output:  run-as : package Com.opencv.genderdetector ' is unknown
Verify if the application was built with NDK_DEBUG=1
Solution One:
$ adb shell
$ su
# chmod 771/data/data
# chown System.system/data/data
Solution Two:
Simulator can debug normally with simulator
Original Android Native Debug