Official development tools




Android SDKedit

Android SDK
Developer(s)Google
Initial releaseOctober 2009; 11 years ago (2009-10)
Stable release
26.1.1 / September 2017; 3 years ago (2017-09)
Written inJava
Operating systemCross-platform
Available inEnglish
TypeIDE, SDK
Websitedeveloper.android.com/sdk/index.html

The Android software development kit (SDK) includes a comprehensive set of development tools. These include a debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials. Currently supported development platforms include computers running Linux (any modern desktop Linux distribution), Mac OS X 10.5.8 or later, and Windows 7 or later. As of March 2015update, the SDK is not available on Android itself, but software development is possible by using specialized Android applications.

Until around the end of 2014, the officially-supported integrated development environment (IDE) was Eclipse using the Android Development Tools (ADT) Plugin, though IntelliJ IDEA IDE (all editions) fully supports Android development out of the box, and NetBeans IDE also supports Android development via a plugin. As of 2015, Android Studio, made by Google and powered by IntelliJ, is the official IDE; however, developers are free to use others, but Google made it clear that ADT was officially deprecated since the end of 2015 to focus on Android Studio as the official Android IDE. Additionally, developers may use any text editor to edit Java and XML files, then use command line tools (Java Development Kit and Apache Ant are required) to create, build and debug Android applications as well as control attached Android devices (e.g., triggering a reboot, installing software package(s) remotely).

Enhancements to Android's SDK go hand-in-hand with the overall Android platform development. The SDK also supports older versions of the Android platform in case developers wish to target their applications at older devices. Development tools are downloadable components, so after one has downloaded the latest version and platform, older platforms and tools can also be downloaded for compatibility testing.

Android applications are packaged in .apk format and stored under /data/app folder on the Android OS (the folder is accessible only to the root user for security reasons). APK package contains .dex files (compiled byte code files called Dalvik executables), resource files, etc.

Android SDK Platform Toolsedit

The Android SDK Platform Tools are a separately downloadable subset of the full SDK, consisting of command-line tools such as adb and fastboot.

Android Debug Bridge (ADB)edit

The Android Debug Bridge (ADB) is a tool to run commands on a connected Android device. The adbd daemon runs on the device, and the adb client starts a background server to multiplex commands sent to devices. In addition to the command-line interface, numerous graphical user interfaces exist to control adb.

The format for issuing commands is typically:

adb -d|-e|-s <serialNumber> <command>
where -d is the option for specifying the single USB-attached device,
      -e for the single running Android emulator on the computer,
      -s for specifying a USB-attached device by its unique serial number.
If there is only one attached device or running emulator, these options are not necessary.

For example, Android applications can be saved by the command backup to a file, whose name is backup.ab by default.

In a security issue reported in March 2011, ADB was targeted as a vector to attempt to install a rootkit on connected phones using a "resource exhaustion attack".

Fastbootedit

Fastboot is a protocol and it has a tool with the same name included with the Android SDK package used primarily to modify the flash filesystem via a USB connection from host computer. It requires that the device be started in a boot loader or Secondary Program Loader mode, in which only the most basic hardware initialization is performed. After enabling the protocol on the device itself, it will accept a specific set of commands sent to it via USB using a command line. Some of the most commonly used fastboot commands include:

  • flash – rewrites a partition with a binary image stored on the host computer.
  • erase – erases a specific partition.
  • reboot – reboots the device into either the main operating system, the system recovery partition or back into its boot loader.
  • devices – displays a list of all devices (with the serial number) connected to the host computer.
  • format – formats a specific partition; the file system of the partition must be recognized by the device.

Android NDKedit

Android NDK
Developer(s)Google
Initial releaseJune 2009; 11 years ago (2009-06)
Stable release
r21b / April 2020; 7 months ago (2020-04)
Written inC and C++
Operating system
  • Windows Vista and later
  • OS X 10.10 and later
  • Linux
PlatformIA-32 (Windows only) or x86-64 (Windows, macOS and Linux)
Available inEnglish
TypeSDK
Websitedeveloper.android.com/ndk/

Code written in C/C++ can be compiled to ARM, or x86 native code (or their 64-bit variants) using the Android Native Development Kit (NDK). The NDK uses the Clang compiler to compile C/C++. GCC was included until NDK r17, but removed in r18 in 2018.

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

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

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: 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 and Visual Studio.

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

Android Open Accessory Development Kitedit

The Android 3.1 platform (also backported to Android 2.3.4) introduces Android Open Accessory support, which allows external USB hardware (an Android USB accessory) to interact with an Android-powered device in a special "accessory" mode. When an Android-powered device is in accessory mode, the connected accessory acts as the USB host (powers the bus and enumerates devices) and the Android-powered device acts as the USB device. Android USB accessories are specifically designed to attach to Android-powered devices and adhere to a simple protocol (Android accessory protocol) that allows them to detect Android-powered devices that support accessory mode.

Comments

Popular posts from this blog

Java standards

Android Developer Challenge