Android NDK

Last updated
Android NDK
Developer(s) Google
Initial releaseJune 2009;14 years ago (2009-06) [1]
Stable release
r26c [2]   OOjs UI icon edit-ltr-progressive.svg / 12 February 2024;49 days ago (12 February 2024)
Repository
Written in C and C++
Operating system
Platform IA-32 (Windows only) or x86-64 (Windows, [3] macOS and Linux)
Available inEnglish
Type SDK
Website developer.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. [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 Bionic as its C library, and the LLVM libc++ as its C++ Standard Library. The NDK also includes a variety of other APIs: [9] 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 [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.

Related Research Articles

In computing, cross-platform software is computer software that is designed to work in several computing platforms. Some cross-platform software requires a separate build for each platform, but some can be directly run on any platform without special preparation, being written in an interpreted language or compiled to portable bytecode for which the interpreters or run-time packages are common or standard components of all supported platforms.

A software development kit (SDK) is a collection of software development tools in one installable package. They facilitate the creation of applications by having a compiler, debugger and sometimes a software framework. They are normally specific to a hardware platform and operating system combination. To create applications with advanced functionalities such as advertisements, push notifications, etc; most application software developers use specific software development kits.

<span class="mw-page-title-main">Eclipse (software)</span> Software development environment

Eclipse is an integrated development environment (IDE) used in computer programming. It contains a base workspace and an extensible plug-in system for customizing the environment. It is the second-most-popular IDE for Java development, and, until 2016, was the most popular. Eclipse is written mostly in Java and its primary use is for developing Java applications, but it may also be used to develop applications in other programming languages via plug-ins, including Ada, ABAP, C, C++, C#, Clojure, COBOL, D, Erlang, Fortran, Groovy, Haskell, JavaScript, Julia, Lasso, Lua, NATURAL, Perl, PHP, Prolog, Python, R, Ruby, Rust, Scala, and Scheme. It can also be used to develop documents with LaTeX and packages for the software Mathematica. Development environments include the Eclipse Java development tools (JDT) for Java and Scala, Eclipse CDT for C/C++, and Eclipse PDT for PHP, among others.

C++Builder is a rapid application development (RAD) environment for developing software in the C++ programming language. Originally developed by Borland, as of 2009 it is owned by Embarcadero Technologies, a subsidiary of Idera. C++Builder can compile apps for Windows, iOS, macOS, and Android. It includes tools that allow drag-and-drop visual development, making programming easier by incorporating a WYSIWYG graphical user interface builder.

<span class="mw-page-title-main">Delphi (software)</span> General-purpose programming language and a software product

Delphi is a general-purpose programming language and a software product that uses the Delphi dialect of the Object Pascal programming language and provides an integrated development environment (IDE) for rapid application development of desktop, mobile, web, and console software, currently developed and maintained by Embarcadero Technologies.

<span class="mw-page-title-main">Google Web Toolkit</span> Free Java library

Google Web Toolkit, or GWT Web Toolkit, is an open-source set of tools that allows web developers to create and maintain JavaScript front-end applications in Java. It is licensed under Apache License 2.0.

Google Developers is Google's site for software development tools and platforms, application programming interfaces (APIs), and technical resources. The site contains documentation on using Google developer tools and APIs—including discussion groups and blogs for developers using Google's developer products.

<span class="mw-page-title-main">SlickEdit</span>

SlickEdit, previously known as Visual SlickEdit, is a cross-platform commercial source code editor, text editor, and Integrated Development Environment developed by SlickEdit, Inc. SlickEdit has integrated debuggers for GNU C/C++, Java, WinDbg, Clang C/C++ LLDB, Groovy, Google Go, Python, Perl, Ruby, Scala, PHP, Xcode, and Android JVM/NDK. SlickEdit includes features such as built-in "beautifiers" that can enhance code as you type, code navigation, context tagging, symbol references, third-party tool integration, DIFFZilla, syntax highlighting, and 15 emulations.

The Android SDK is a software development kit for the Android software ecosystem that includes a comprehensive set of development tools. These include a debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials. The SDK is part of the official Android Studio IDE but its various tools and resources can be used independently.

The Android Package with the file extension apk is the file format used by the Android operating system, and a number of other Android-based operating systems for distribution and installation of mobile apps, mobile games and middleware. A file using this format can be built from source code written in either Java or Kotlin.

RemObjects Software is an American software company founded in 2002 by Alessandro Federici and Marc Hoffman. It develops and offers tools and libraries for software developers on a variety of development platforms, including Embarcadero Delphi, Microsoft .NET, Mono, and Apple's Xcode.

Bionic is an implementation of the standard C library, developed by Google for its Android operating system. It differs from the GNU C Library (glibc) in being designed for devices with less memory and processor power than a typical Linux system. It is a combination of new code and code from FreeBSD, NetBSD, and OpenBSD released under a BSD license, rather than glibc, which uses the GNU Lesser General Public License. This difference was important in the early days of Android, when static linking was common, and since bionic has its own ABI, it can't be replaced by a different libc without breaking all existing apps.

<span class="mw-page-title-main">Android Debug Bridge</span> Tool for debugging Android-based devices

The Android Debug Bridge is a programming tool used for the debugging of Android-based devices. The daemon on the Android device connects with the server on the host PC over USB or TCP, which connects to the client that is used by the end-user over TCP. Made available as open-source software under the Apache License by Google since 2007, its features include a shell and the possibility to make backups. The adb software is available for Windows, Linux and macOS. It has been misused by botnets and other malware, for which mitigations were developed such as RSA authentication and device whitelisting.

<span class="mw-page-title-main">Android software development</span> Process of writing software for Android operating system

Android software development is the process by which applications are created for devices running the Android operating system. Google states that "Android apps can be written using Kotlin, Java, and C++ languages" using the Android software development kit (SDK), while using other languages is also possible. All non-Java virtual machine (JVM) languages, such as Go, JavaScript, C, C++ or assembly, need the help of JVM language code, that may be supplied by tools, likely with restricted API support. Some programming languages and tools allow cross-platform app support. Third party tools, development environments, and language support have also continued to evolve and expand since the initial SDK was released in 2008. The official Android app distribution mechanism to end users is Google Play; it also allows staged gradual app release, as well as distribution of pre-release app versions to testers.

<span class="mw-page-title-main">Xamarin</span> American software company

Xamarin is a Microsoft-owned San Francisco-based software company founded in May 2011 by the engineers that created Mono, Xamarin.Android and Xamarin.iOS, which are cross-platform implementations of the Common Language Infrastructure (CLI) and Common Language Specifications.

Dart is a programming language designed by Lars Bak and Kasper Lund and developed by Google. It can be used to develop web and mobile apps as well as server and desktop applications.

<span class="mw-page-title-main">Mono (software)</span> Computer software project

Mono is a free and open-source .NET Framework-compatible software framework. Originally by Ximian, it was later acquired by Novell, and is now being led by Xamarin, a subsidiary of Microsoft and the .NET Foundation. Mono can be run on many software systems.

<span class="mw-page-title-main">Android Studio</span> Integrated development environment for the Android platform

Android Studio is the official integrated development environment (IDE) for Google's Android operating system, built on JetBrains' IntelliJ IDEA software and designed specifically for Android development. It is available for download on Windows, macOS and Linux based operating systems. It is a replacement for the Eclipse Android Development Tools (E-ADT) as the primary IDE for native Android application development. Android Studio is licensed under the Apache license but it ships with some SDK updates that are under a non-free license, making it not open source.

Universal Windows Platform (UWP) is a computing platform created by Microsoft and introduced in Windows 10. The purpose of this platform is to help develop universal apps that run on Windows 10, Windows 10 Mobile (discontinued), Windows 11, Xbox One, Xbox Series X/S, and HoloLens without the need to be rewritten for each. It supports Windows app development using C++, C#, VB.NET, and XAML. The API is implemented in C++, and supported in C++, VB.NET, C#, F# and JavaScript. Designed as an extension to the Windows Runtime (WinRT) platform introduced in Windows Server 2012 and Windows 8, UWP allows developers to create apps that will potentially run on multiple types of devices.

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. Ratabouil, Sylvain (2015). Android NDK beginner's guide : discover the native side of Android and inject the power of C/C++ in your applications (2nd ed.). Birmingham. ISBN   978-1-78398-965-2. OCLC   910639612.{{cite book}}: CS1 maint: location missing publisher (link)
  5. Kosarevsky, Sergey (2013). Android NDK game development cookbook : over 70 exciting recipes to help you develop mobile games for Android in C++. Viktor Latypov. Birmingham. ISBN   978-1-78216-779-2. 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".