| Android NDK | |
|---|---|
| Developer | |
| Initial release | June 2009; 16 years ago (2009-06)[1] |
| Stable release | |
| Written in | C andC++ |
| Operating system |
|
| Platform | IA-32 (Windows only) orx86-64 (Windows,[3] macOS and Linux) |
| Available in | English |
| Type | SDK |
| Website | developer |
| Repository | |
TheAndroid Native Development Kit (NDK) provides across-compiling tool for compiling code written inC/C++ can becompiled toARM, orx86native code (or their64-bit variants) forAndroid.[4][5] The NDK uses theClang compiler to compile C/C++.GCC was included until NDK r17, but removed in r18 in 2018.
Native libraries can be called fromJava code running under theAndroid Runtime usingSystem.loadLibrary, part of the standard Android Java classes.[6][7]
Command-line tools can be compiled with the NDK and installed usingadb.[8]
Android usesBionic as itsC library, and theLLVM libc++ as itsC++ Standard Library. The NDK also includes a variety of other APIs:[9]zlib compression,OpenGL ES orVulkan graphics,OpenSL ES audio, and various Android-specific APIs for things like logging, access to cameras, or acceleratingneural networks.
The NDK includes support forCMake and its ownndk-build (based onGNU Make).Android Studio supports running either of these fromGradle. Other third-party tools allow integrating the NDK intoEclipse[10] andVisual Studio.[11]
ForCPU profiling, the NDK also includes simpleperf[12] which is similar to theLinux perf tool, but with better support for Android and specifically for mixed Java/C++ stacks.
{{cite book}}: CS1 maint: location missing publisher (link){{cite book}}: CS1 maint: location missing publisher (link)