Android and the 7 ABIs.

Intel droid bot

By Xavier Hallade, Intel Corporation

In its early days, the Android OS was pretty much supporting only one CPU architecture, ARMv5.
Do you know how many it does support now? 7.

Seven distinct CPU specific ABIs (Application Binary Interfaces) are now supported by Android: ARMv5, ARMv7 (since 2010), x86 (2011), MIPS (2012), ARMv8, MIPS64 and x86_64 (2014) – the same goes for the apps.

In the case of the x86 architectures, flagship products like the Dell Venue* 7000 devices, Nokia* n1, Google Nexus* Player, Asus* Zenfone 2 and more than 200 other device models have been released since 2012.

An honest question you may have is: why should you care about architecture specifics in the first place?
Well, if you’re dealing only with Java code, maybe you don’t need to care. But in fact, even in this case, quite often, you may rely without knowing it on libraries and engines that make your application CPU-dependent. Using the RenderScript support Library? OpenCV? libgdx? …?

In any case, the CPU dependency is reflected by the presence of “.so files” inside your APK, under the “libs/ABI” folders where ABI can be one or more of armeabi, armeabi-v7a, arm64-v8a, mips, mips64, x86, x86_64 (the seven ABIs).

Nativelibsmonitor
Native Libs Monitor can help you understanding what .so files are embedded insideyour APK and installed on your device, and from which libraries and frameworks they’re coming

There is a dead simple but not well-known important rule to follow when dealing with .so files. You should provide libraries optimized for each ABIs if possible, but it’s all in or nothing: you shall not mix. You need the full set of what you're using in each ABI folder.

When an application is installed on a device, only the .so files from one of its supported architectures are getting installed. On x86 devices, that can be the libs from the x86 folder first if there is one, else from the armeabi-v7a, else armeabi folder (yes, Intel Architecture based devices support these too).

This was a public service announcement from Intel. Now, if you want to learn more about .so files and CPU architectures, here is a series of articles on compatibility, packaging and libraries/engines porting. And of course, you’re welcome to pass by Intel booth at Droidcon Berlin, where we will  be there to help you!

We’ll also have two sessions on power optimization ( 4.6., 11.00 – 11.20h, Stage 1), and Android TV apps development ( 5.6. 14.30 – 15.10h, Stage1.