Building the JNI Source Code for Android in Eclipse

Leave a comment

When we develop a Android project includes the JNI technique, we should use the Android NDK tool for building these source code. But, the NDK is a command line tool that not convenient to use when we develop in the IDE.

In this article, I shows an example to explain the steps to build JNI source code in Eclipse.

The key is you have to create a new Builder used to execute the NDK tool for building JNI source code. So, at first, you have to create a new Builder in the Eclipse.

In my example, I try to add a new NDK Builder for OpenCV project in the Eclipse.

Step 1: Enter to the Project’s property window, and then click the “New” button to create a new Builder.

More

Advertisements

Using NDK to Call C code from Android Apps

Leave a comment

Android NDK (Native Development Kit) allows working with native C code using a shared C library. It includes the entire toolchain needed to build for your target platform (ARM). Native C code accessible via JNI still runs inside the Dalvik VM, and as such is subject to the same life-cycle rules that any Android application lives by. The advantage of writing parts of your app code in native language is presumably speed in certain cases.