In computer programming and software development, a native development kit (NDK) usually is an abstract programming interface (API) that provides a developer with the ability to use functions or execute code directly through the core operating system. This method of executing a program is distinctly different from running managed code or interpreted programs, in which the code that is written is executed by a virtual machine or interpreter that acts as a software layer between the core operating system functions and the user-written code. The use of a native development kit can be essential in applications that require the fastest possible execution and processing times, because it can provide direct access to hardware and libraries the operating system uses. Depending on the type of program being written and the target operating system, the use of a native development kit might not increase program speed at all, and could make code that is difficult to maintain, read and port to other systems.
Applications that are written for some devices, such as smart phones, or use interpreted computer languages are not executed directly by the core operating system processes, or the kernel. Instead, the program code is executed by a separate program known as a virtual machine (VM), or interpreter. The virtual machine reads the code, expands and resolves commands, and interfaces with the kernel to execute the code. This can be beneficial for some developers, because it provides a good layer of abstraction for portability and leaves many complex details, such as resource management and file handling, to the creators of the virtual machine.
In some instances, however, the virtual machine can be a hindrance to some types of programs. The VM can slow execution or fail to provide access to some functions within the host kernel. A native development kit for the target operating system or device exposes the functions of the kernel to the application being written. Depending on the extent of the kit, this can allow a program to directly access hardware, load its own custom libraries into the kernel, or use system-specific optimizations.
A native development kit is most often used only for time-critical portions of a program. These can be graphics processing calculations, output to the display or file input and output. Not all programs that use native functions or routines will see a speed benefit, because the virtual machine might already make optimizations to the managed code so the resulting machine code is identical, regardless of whether native functions are used. Additionally, native code ties a program to a specific implementation of an operating system and sometimes a specific version of a device, meaning that code using a native development kit might not be easily ported to other systems.