Wednesday, February 19, 2014

Android run time , ART [simple explaination] No craps.. :D



Introduction ?hmm.gif

-Okay, Actually it's a new runtime for android OS n Experimental released for 4.4 Kit-kat version.
-Features with the ahead-of-time compilation which translates all of the app’s bytecode to machine language at the time of the first installation.

-Less CPU loads , Less battery leakage gimmickshappy.gif
-and it also introduced it as an experimental feature for developers and to gain early feedback, but we could be close to seeing it enabled as the default runtime in an upcoming version of Android. An Android code commit at Google’s git foretells a change that would make ART the preferred option while still maintaining Dalvik as a secondary option for those finding it hard to say goodbye.


Google’s intention to replace Dalvik, though the earlier years of Android forced their hand in putting up with what is generally seen as a less efficient process. Devices back in the early days had very limited RAM and storage, and less capable CPUs, and the Dalvik runtime’s “only compile what you need” architecture made it perfect for those devices as it kept the memory footprint to a minimum.

But some of the entry-level devices of today will not go much lower than 512MB of RAM and 4GB of storage [Same explaination as jellybean 4.1.2-4.3], and they use very capable processors compared to the same class of devices just a few years ago. With Google optimizing Android 4.4 KitKat to make it perform great on these entry-level devices, they can finally use this more traditional compilation engine without worry that someone’s phone isn’t up to par.

Benefit?drool.gif
allows for swifter app performance.
It doesn't compile the app during startup allowing for faster processing.
improve battery life. Less compilation instructions=less CPU time.
The less time the device uses CPU, the more energy efficient it becomes.

Important!icon_idea.gif
According from Android developers

Dalvik must remain the default runtime or you risk breaking your Android implementations and third-party applications.

Two runtimes are now available, the existing Dalvik runtime (libdvm.so) and the ART (libart.so). A device can be built using either or both. (You can dual boot from Developer options if both are installed.)

The dalvikvm command line tool can run with either of them now. See runtime_common.mk. That is included from build/target/product/runtime_libdvm.mk or build/target/product/runtime_libdvm.mk or both.
A new PRODUCT_RUNTIMES variable controls which runtimes are included in a build. Include it within either build/target/product/core_minimal.mk or build/target/product/core_base.mk.
Add this to the device makefile to have both runtimes built and installed, with Dalvik as the default:


Codes
 

PRODUCT_RUNTIMES := runtime_libdvm_default
PRODUCT_RUNTIMES += runtime_libart

Here is the xda explainations :)

 


Happy Reading