Android NDK

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Android NDK
DeveloperGoogle
Initial releaseJune 2009; 16 years ago (2009-06)[1]
Repository
  • {{URL|example.com|optional display text}}Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
Written inC and C++
Engine
    Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
    Operating system
    PlatformIA-32 (Windows only) or x86-64 (Windows,[2] macOS and Linux)
    Available inEnglish
    TypeSDK
    Websitedeveloper.android.com/ndk/

    The Android Native Development Kit (NDK) provides a cross-compiling tool for compiling code written in C/C++ can be compiled to ARM, or x86 native code (or their 64-bit variants) for Android.[3][4] The NDK uses the Clang compiler to compile C/C++. GCC was included until NDK r17, but removed in r18 in 2018.

    Overview

    [edit | edit source]

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

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

    Android uses Bionic as its C library, and the LLVM libc++ as its C++ Standard Library. The NDK also includes a variety of other APIs:[8] zlib compression, OpenGL ES or 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[9] and Visual Studio.[10]

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

    References

    [edit | edit source]
    1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    5. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    6. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    7. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    8. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    9. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    10. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    11. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).