Ahead-of-time (AOT) compilation
ART introduces ahead-of-time (AOT) compilation, which can improve app performance. ART also has tighter install-time verification than Dalvik.
At install time, ART compiles apps using the on-device dex2oat tool. This utility accepts DEX files as input and generates a compiled app executable for the target device. The utility should be able to compile all valid DEX files without difficulty. However, some post-processing tools produce invalid files that may be tolerated by Dalvik but cannot be compiled by ART. For more information, see Addressing Garbage Collection Issues.
Bluetooth low energy
In addition to new features, Android 5.0 emphasizes improvements in battery life. Use the new APIs and tool to understand and optimize your app’s power consumption.
Android 5.0 provides a new JobScheduler API that lets you optimize battery life by defining jobs for the system to run asynchronously at a later time or under specified conditions (such as when the device is charging). Job scheduling is useful in such situations as:
- The app has non-user-facing work that you can defer.
- The app has work you’d prefer to do when the unit is plugged in.
- The app has a task that requires network access or a Wi-Fi connection.
- The app has a number of tasks that you want to run as a batch on a regular schedule.
A unit of work is encapsulated by a JobInfo object. This object specifies the scheduling criteria.
Use the JobInfo.Builder class to configure how the scheduled task should run. You can schedule the task to run under specific conditions, such as:
- Start when the device is charging
- Start when the device is connected to an unmetered network
- Start when the device is idle
- Finish before a certain deadline or with a minimum delay
For example, you can add code like this to run your task on an unmetered network:
JobInfo uploadTask = new JobInfo.Builder(mJobId,
mServiceComponent /* JobService component */)
JobScheduler jobScheduler =
If the device has stable power (that is, it has been plugged in for more than 2 minutes and the battery is at a healthy level), the system will run any scheduled job that is ready to run, even if the job’s deadline has not expired.
To see an example of how to use the JobScheduler API, refer to the JobSchedulerSample implementation sample in this release.
Render PDF as bitmap
You can now render PDF document pages into bitmap images for printing by using the new PdfRenderer class. You must specify a ParcelFileDescriptor that is seekable (that is, the content can be randomly accessed) on which the system writes the the printable content. Your app can obtain a page for rendering with openPage(), then call render()to turn the opened PdfRenderer.Page into a bitmap. You can also set additional parameters if you only want to convert a portion of the document into a bitmap image (for example, to implement tiled rendering to zoom in on the document).
For an example of how to use the new APIs, see the PdfRendererBasic sample.
I’ve collected these informations from: