Close To Metal Programming with Native Development Kit
Submitted by Devi Prasad (@deviprasad) on Monday, 7 November 2011
Section: Performance optimization Technical level: Advanced Session type: Tutorial
Many real-time, performance critical Android applications leverage computationally efficient components written in C/C++, using the Native Development Kit (NDK). In this tutorial we will show how JNI and NDK let developers combine Virtual Machine (VM) based apps (written in Java) with efficient libraries written in C/C++. We will demonstrate the performance gain, with solid examples, and explain the key ideas underlying NDK.
The Native Development Kit is a powerful tool that allows one to create static or shared native libraries from performance critical code written in C/C++. JNI makes it possible for the Java portion of an Android app to leverage such efficient native libraries.
This session shows how NDK may be used to develop independent libraries in C/C++ and combine them with the VM apps. It demonstrates the performance gains by comparing the performance of the self contained VM apps with the ones that combine Java and C/C++. We demonstrate the key ideas with programs that manipulate large images. We also show various pitfalls and caveats in using Android NDK.
Programming knowledge in C/C++ Familiarity with JNI Commonsense!
Devi Prasad has led the Android framework customization efforts at Robosoft Technologies since 2008. He enjoys programming with the Native Development Kit (NDK) and has developed various applications that depend on native libraries for performance.