Tuesday, May 24, 2016

A Faster Emulator with Better Hardware Support

[This post is by Xavier Ducrohet and Reto Meier of the Android engineering tm. — Tim Bray.]The Android emulator is a tool for Android developers in building and testing their apps. As the power and diversity of Android devices has grown quickly, it’s been hard for the emulator keep pace. Today we’re thrilled to announce several significant improvements to the emulator, including a dramatic performance upgrade and support for a broader range of hardware ftures, notably sensors and multi-finger input.Added GPU SupportThe system we’re shipping today has built-in GPU support (Android 4.0.3 r2). With Android’s growing reliance on using the GPU to improve performance, the difference is significant. In the below, the emulator is still interpreting ARM instructions; the performance boost is the effect of putting the GPU to work.
As a bonus, since we’re now supporting OpenGL ES 2.0, your OpenGL games can now run inside the emulator. Plse note that there are a lot of GPUs out there, and we haven’t tested all of them for this beta relse, so let us know if you have feedback or encounter issues. More Hardware Fture EmulationThe hardware ftures of mobile devices are a significant part of what makes them a unique platform for development, so we’re also plsed to announce that in addition to the camera support we added last yr, it’s now possible to use a tethered Android device to supply inputs for sensors and multi-touch input.We’re working on providing emulator support for more hardware ftures including Bluetooth and NFC.Improved CPU PerformanceWe’ve also improved the CPU performance of the Android emulator. Hardware floating point operation has been available for system s since Ice Crm Sandwich (Android 4.0), allowing CPU operations to be emulated roughly twice as quickly.Last week’s r17 developer tools relse included x86 system s and host drivers (available through the SDK Manager), allowing the emulator to access the host CPU natively and offer significantly faster execution.This shows a CPU-bound appliion on two emulators running the same system , one with virtualization, one without.Building a modern emulatorBecause the Android platform allows deep interaction between appliions, and with system components, we need to provide an emulator with a complete system . Our emulator virtualizes a complete device: hardware, kernel, low-level system libraries, and app framework.Of course, the system being emulated typically has an ARM CPU; historically, we’d been emulating those instructions in software, and that worked OK until the advent of tablet support with additional animations and complexity in Android 3.0.The missing pieces were the completion of Android x86 support, and the GPU support in last week’s relse of SDK Tools r17. This works by funneling the OpenGL ES 2.0 instructions from the emulator to the host OS, converted to standard OpenGL 2.0, and running natively on the host GPU.ConclusionThe Android ecosystem has a lot of devices in many different form factors. Developers need a good way of testing these apps without having to own everything out there and a fast, rich Android emulator is immensely helpful.We hope that these new improvements will make the emulator a more useful tool in your development and testing, and look forward to improving it further for you.

No comments:

Post a Comment