Android NDK

Source: Wikipedia, the free encyclopedia.
Android NDK
Developer(s)Google
Initial releaseJune 2009; 14 years ago (2009-06)[1]
Stable release
r26c[2] Edit this on Wikidata / 12 February 2024; 57 days ago (12 February 2024)
Repository
Written inC and C++
Operating system
PlatformIA-32 (Windows only) or x86-64 (Windows,[3] macOS and Linux)
Available inEnglish
TypeSDK
Websitedeveloper.android.com/ndk/

The Android Native Development Kit (NDK) provides a

native code (or their 64-bit variants) for Android.[4][5] The NDK uses the Clang compiler to compile C/C++. GCC
was included until NDK r17, but removed in r18 in 2018.

Overview

Native libraries can be called from Java code running under the Android Runtime using System.loadLibrary, part of the standard Android Java classes.[6][7]

Command-line tools can be compiled with the NDK and installed using adb.[8]

Android uses

Vulkan graphics, OpenSL ES audio, and various Android-specific APIs for things like logging, access to cameras, or accelerating neural networks
.

The NDK includes support for CMake and its own ndk-build (based on GNU Make). Android Studio supports running either of these from Gradle. Other third-party tools allow integrating the NDK into Eclipse[10] and Visual Studio.[11]

For CPU profiling, the NDK also includes simpleperf[12] which is similar to the Linux perf tool, but with better support for Android and specifically for mixed Java/C++ stacks.

References

  1. ^ "Android NDK | Android Developers". Developer.android.com. November 13, 2012. Retrieved March 13, 2014.
  2. ^ "Release NDK r26c · android/ndk". Retrieved 31 March 2024.
  3. ^ "NDK Downloads | Android Developers". developer.android.com. Retrieved 2018-04-24.
  4. OCLC 910639612.{{cite book}}: CS1 maint: location missing publisher (link
    )
  5. OCLC 880639342.{{cite book}}: CS1 maint: location missing publisher (link
    )
  6. ^ Srinivas, Davanum (December 9, 2007). "Android — Invoke JNI based methods (Bridging C/C++ and Java)". Archived from the original on December 16, 2008. Retrieved December 13, 2008.
  7. ^ "java.lang.System". Android Developers. Retrieved September 3, 2009.
  8. ^ "Android Debug Bridge (adb)".
  9. ^ "Android NDK Native APIs | Android NDK".
  10. ^ "Using Eclipse for Android C/C++ Development". January 23, 2011.
  11. ^ "Using Visual Studio to Develop Native Android Code – VisualGDB Tutorials".
  12. ^ "Simpleperf | Android NDK".