Tag Archives: NDK

Using the Android NDK

android

Create a regular Android project Add a new folder to your project – <project>/JNI Write a native (C/C++) code and place the files under <project>/JNI. You should follow the JNI rules when writing your native code. Example: #include <string.h> #include <jni.h>   jstring Java_com_mypackage_helloworld_HelloWorld_getNativeString( JNIEnv* env, jobject obj ) {     return (*env)->NewStringUTF(env, "Hello World"); } Create a Android.mk file and ... Read More »

What is Android NDK?

android

What is Android NDK? NDK (Native Development Kit) is a set of tools that enables you to easily include native code written in C or C++ in your Android applications. The NDK uses the JNI mechanism to call functions from Java to C and C++. The NDK was introduced with Android version 1.5. In version 2.3 some major improvements were ... Read More »