They allow the execution of ARM binaries for testing without the performance overhead of requiring the full ARM emulation, which should speed the path of testing.
Previously, says the company, developers who were dependent on ARM libraries and could not build an x86 variant of their app either had to use system images with full ARM emulation, which are much slower than x86 system images when run on x86-based computers, or resort to physical devices.
Specifically, there is now support for ARMv7 and ARM64 ABIs.
The image above shows the new Android 11 x86 system image supporting ARM ABIs, which the previous Android “Oreo” system image did not.
Because different Android devices use different CPUs this involves the support of different instruction sets.
Each combination of CPU and instruction set has its own Application Binary Interface (ABI), which includes such things as the CPU instruction set and extensions that can be used, the endianness of memory stores and loads at runtime, conventions for passing data between applications and the system, and the format of executable programs and shared libraries.
“Any C++ in your Android app compiles directly into machine instructions,” says Michael Hazard, Associate Product Manager at Google. “This means that it needs to be compiled differently based on the architecture of the target device. Mobile phones tend to have ARM processors; consequently, many C++ dependencies you might add to your app, like a camera barcode scanner library, are only compatible with ARM processors. This is a problem if you develop on a computer with an x86-based processor, as it would prevent you from running your app.”
“The new ARM-compatible Android 11 system images allow the entire system to run x86 natively and take advantage of virtualization technologies as usual. When an app’s process requires an ARM binary, the binary is translated to x86 within that process exclusively. This allows the rest of the process to continue executing in x86, including the Android Runtime (ART), and other performance-critical libraries like libGLES and libvulkan.”
The translator will also avoid expensive memory access instrumentation and the associated performance hit by avoiding the execution of low-level hardware-specific libraries, he adds.
The new emulator system images can be used both locally and on your own continuous integration infrastructure.
Try emulated ARM again
The image above shows the Android Virtual Device Manager creating an AVD (Android Virtual Device) that runs Android 11
Google is urging developers who have previously avoided its emulator system due to the lack of ARM support, try out the Android 11 system images. They can be downloaded in Android Studio via either the SDK Manager or the Android Virtual Device Manager, which is included with included with Android Studio, Google’s IDE.
Note that the Android 11 Developer Preview 2 was released last week and includes support for 5G processing and foldable screens. Android 11 is scheduled to appear in “Q3”.
See also: Google eyes 5G, foldable screens with Android 11 Developer Preview 2