After a 2010 spat over how Java works in Android with Oracle, Google is moving on to a new way for apps run on mobile devices. Dubbed ART, the new runtime environment is available as a preview option in Android 4.4. Developers are encouraged to try it and provide feedback for ART and if you have Android 4.4, you can test it yourself although you may not see much difference just yet.
On a sparse web page for developers, Google said the new runtime is experimental and a work in progress. You can enable it in Android 4.4 through the Settings, Developer Options menu. I did just that on a Nexus 5 and after a reboot, Android spent about 10 minutes optimizing my apps to run. I don’t yet see any difference in the apps.
Currently, Android apps run in what’s called Dalvik, a runtime environment that compiles Java bytecode “just in time” so that Android can run it. Essentially, it’s the software that lets you run software in Android. So what is ART and why should you care? Check this overview from Cody Toombs at Android Police for a better understanding:
“ART, which stands for Android Runtime, handles app execution in a fundamentally different way from Dalvik. The current runtime relies on a Just-In-Time (JIT) compiler to interpret bytecode, a generic version of the original application code. In a manner of speaking, apps are only partially compiled by developers and the rest of the compilation is completed on a user’s device each and every time they are run. The process involves a lot of overhead and isn’t particularly efficient, but the mechanism makes it easy for apps to run on a variety of hardware and architectures. ART is set to change this process by pre-compiling that bytecode into machine language when apps are first installed, turning them into truly native apps. This process is called Ahead-Of-Time (AOT) compilation. By removing the need to spin up a new virtual machine or run interpreted code, startup times can be cut down immensely and ongoing execution will become faster, as well.”
Coombs said that Google has been working on ART in secret for two years and I have no reason to think otherwise. In fact, it was just under two years ago — May of 2012 — that the courts decided Google didn’t infringe on Oracle’s Java-related patents. So while ART may have been planned to speed up Android apps, I wouldn’t be surprised to hear that it got started because of the Oracle suit.
Regardless of how it was born, it’s coming to Android at some point. Coombs plans some follow-up thoughts on ART in the coming days and I’m looking forward to hearing more. After all, anything that could bring app speed and efficiency to Android is worth watching out for.
Update: This post was updated at 6:21am PT, Nov. 7 to correct the time frame of the court decision.