What is… Android Runtime (ART)?

Back in June, at the Google I/O event, Google heralded the next major version of Android. While the Material Design UI change grabbed a lot of attention, another important development was also flagged – Android Runtime (ART)

Android ART webpage

The “L Developer Preview” that was released saw the introduction of the Android Runtime (ART) as the system default, replacing the current Dalvik system. Think of this as the runtime middleware that enables apps to run on Android devices – the process virtual machine, to be precise.

In a nutshell, Google claimed ART would enable:


  • ahead-of-time (AOT) compilation (contrasting with Dalvik’s just-in-time (JIT) compilation),
  • more efficient garbage collection,
  • improved development and debugging features

“In many cases it improves performance of the device with no action required by the developer,” said Google.

Why is AOT compilation significant? Because by pre-compiling bytecode into machine language when apps are first installed, instead of just being interpreted, they can benefit from being “native apps”, optimised for the hardware.


Making a break with KitKat

ART first appeared, in preview form, with the release of Android 4.4 “KitKat” in the autumn of 2013.

Specifically, two runtime environments were made available: the existing Dalvik runtime (libdvm.so) and the ART (libart.so). According to Google, a device could be built using either or both, with options for a dual boot.

Note that Google warns that, for existing apps, some techniques that work on Dalvik do not work on ART. For the details, see Verifying App Behavior on the Android Runtime (ART)

You can find lots of information on ART at https://source.android.com/devices/tech/dalvik/art.html

See also:

 


Leave a Reply

Your email address will not be published. Required fields are marked *

*