Home Tutorials Training Consulting Books Company Contact us


Get more...

Android NDK. This tutorial describes how to use native code in Android applications. The tutorial is based on Android 6.0

1. Developing native code with the Android Gradle plugin

1.1. What is the Android Native Development Kit (NDK)

The Android NDK allows you to use native code in your Android application. This can be useful in case you have a complex algorithm which you need to optimize or in case you have a lot of native C code already which you want to port to Android.

The native code is called via the Java Native Interface (JNI). JNI is a Java standard for accessing native code and the NDK provides the infrastructure to use JNI in Android applications.

JNI adds some overhead. So the overall performance might be better if you use only Java.

1.2. Usage of the Android NDK

Android Studio and the Android Gradle plugin support the creation of native code. See http://tools.android.com/tech-docs/android-ndk-preview - Android NDK documentation for more information.

2. Android NDK resources