Here we present some introductory guidelines on how to develop in the NDK environment.
These tips help not only to understand how to develop apps that use native code, but it also covers how the Android OS handles the communication between the different programming language layers, i.e., Java, C++ and C.
Note: Using Android Studio in order to modify the two lower native programming language layers (C++ and C) is a very bad idea, because Android Studio offers no support in developing C and C++ code.
From what can be read in many places including here, Eclipse offers, on the other hand, not only solutions to help the development of native code, but also offers powerful debugging capabilities, similar to the ones offered for Java development.
A combination of Android Studio and ndk-build (an essential tool in ndk development) settings and commands allow you to send a gdbserver object within your apk file when you launch your application, which can then be called from your development machine to use gdb on your app running in the emulator.
Here we plan to develop simple testing apps with native code, but if we decide to develop more demanding solutions, Eclipse might be the way to go.
At this time Eclipse wasn't tested because of compatibility issues that might arise from the different sdks, jdks, etc between Android Studio, Eclipse and even Ubuntu.
https://software.intel.com/en-us/android/articles/how-to-test-and-debug-ndk-based-android-applications
https://vilimpoc.org/blog/2010/09/23/hello-gdbserver-a-debuggable-jni-example-for-android/
http://stackoverflow.com/questions/2056717/how-to-debug-an-app-on-android-with-gdbserver