
The second source for performance improvements at NDK is that native code allows developers to make use of some processor features that are not accessible at Android SDK, such as NEON, a Single Instruction Multiple Data (SIMD) technology, allowing multiple data elements to be processed in parallel. But in many cases, native code still runs faster than Java code. At Android 2.2 or higher, a Just-In-Time (JIT) compiler is added to Dalvik VM to analyze and optimize the Java byte-code while the program is running (for example, JIT can compile a part of the byte-code to binary code before its execution). The performance improvements can come from three sources.įirstly, the native code is compiled to a binary code and run directly on OS, while Java code is translated into Java byte-code and interpreted by Dalvik Virtual Machine (VM). Many multimedia applications and video games use native code for processor-intensive tasks. This is usually true for many processor-bound applications. The library is based on the code of Mario Klingemann. Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result.

Slides: Using the Android Native Development Kit (NDK).Porting and Using the Existing Libraries with Android NDK.

