For the past two years Google have been working on something for Android that could herald a sea change on the platform. ART.
Essentially, ART is a new runtime which incorporates AOT (Ahead Of Time) compilation, essentially taking JIT to the next level by compiling an application in full at the time of installation on a device.
.NET of course already has this technology or at least something very similar.
The implications of this are obvious and significant.
Any developer using a platform native, Java based development environment today – including tools such as Oxygene for Java – is assured of reaching the broadest range of Android devices and able to take full advantage of the Android SDK‘s, including proprietary extensions such as the Samsung Galaxy S-Pen SDK.
With ART those same platform native applications will now also benefit from the performance boost that comes from full compilation to native code. And it seems this will simply com “free of charge”, without any need to modify code or change or even upgrade tools.
At a stroke, a wholly native code approach to development loses any advantages to outweigh the limitations, constraint and additional difficulties that it brings.
With ART, Android SDK developers can continue to take full advantage of the platform while their users enjoy the benefit of native code.
Everyone’s a winner!
Furthermore, they will get this benefit on all the hardware that Google supports with their ART technology. Even better, developers won’t have to choose what particular native code their compiler should produce since it is generated at the time of installation and is therefore targeted to the users device at that time.
The hardware that will be supported by this technology is not yet known but it could in theory mean the full range of Android devices whether ARM based or Intel or some other entirely new and exotic architecture that might emerge.
Even if there is some hardware that ART does not support, Android SDK apps will of course continue to run on those devices, only without the additional benefit of ART.
But it’s not all fluffy kittens and daisies. There is a cost.
Pre-compiled applications increase in size compared to their byte-code sources; an inflation said to be in the region of 10%-20%. So a 40KB widget will now blow out to a massive 44KB or worse as much as 50KB.
A 1MB application will explode to 1.2MB. Gadzooks!
Ok, so maybe it is all fluffy kittens and daisies after all.
ART is still an experimental technology, but it’s an experiment you may be able to participate in.
If you are an Oxygene for Java developer targeting Android (or using Java itself of course) and have access to a Google Nexus device with Kit-Kat, you can enable ART (on the device – nothing to do with the code or the tools) and see for yourself what difference it can make to turn your already platform native applications into native code applications as well.
Unfortunately I don’t have such a device myself, but who knows…. perhaps some day soon…
Here are some more links on the subject, to alleviate the strain on Google’s servers:
- Google Android Developer Site
- GSM Arena (includes information on enabled ART on Google Nexus Kit-Kat)