Why use armeabi-v7a code over armeabi code?

107,797

Solution 1

Depends on what your native code does, but v7a has support for hardware floating point operations, which makes a huge difference. armeabi will work fine on all devices, but will be a lot slower, and won't take advantage of newer devices' CPU capabilities. Do take some benchmarks for your particular application, but removing the armeabi-v7a binaries is generally not a good idea. If you need to reduce size, you might want to have two separate apks for older (armeabi) and newer (armeabi-v7a) devices.

Solution 2

EABI = Embedded Application Binary Interface. It is such specifications to which an executable must conform in order to execute in a specific execution environment. It also specifies various aspects of compilation and linkage required for interoperation between toolchains used for the ARM Architecture. In this context when we speak about armeabi we speak about ARM architecture and GNU/Linux OS. Android follows the little-endian ARM GNU/Linux ABI.

armeabi application will run on ARMv5 (e.g. ARM9) and ARMv6 (e.g. ARM11). You may use Floating Point hardware if you build your application using proper GCC options like -mfpu=vfpv3 -mfloat-abi=softfp which tells compiler to generate floating point instructions for VFP hardware and enables the soft-float calling conventions. armeabi doesn't support hard-float calling conventions (it means FP registers are not used to contain arguments for a function), but FP operations in HW are still supported.

armeabi-v7a application will run on Cortex A# devices like Cortex A8, A9, and A15. It supports multi-core processors and it supports -mfloat-abi=hard. So, if you build your application using -mfloat-abi=hard, many of your function calls will be faster.

Solution 3

Instead of having a fat APK file, I would like to use just the armeabi files and remove the armeabi-v7a folder.

The opposite is a much better strategy. If you have minSdkVersion to 14 and upload your apk to the play store, you'll notice you'll support the same number of devices whether you support armeabi or not. Therefore, there are no devices with Android 4 or higher which would benefit from armeabi at all.

This is probably why the Android NDK doesn't even support armeabi anymore as per revision r17b. [source]

Share:
107,797
PaulT
Author by

PaulT

Updated on July 08, 2022

Comments

  • PaulT
    PaulT almost 2 years

    In my current project I make use of multiple .so files. These are located at the armeabi and armeabi-v7a folder. Unfortunately one of the .so files is a 6MB and I need to reduce file size. Instead of having a fat APK file, I would like to use just the armeabi files and remove the armeabi-v7a folder.

    According to the NDK documentation, armeabi-v7a code is extended armeabi code which can contain extra CPU instructions. This all goes beyond my expertise, but I question why one would like to have both armeabi-v7a and armeabi code. There must be a good reason to have both, right?

    On my test devices this all seem to work fine. These have ARM v7 CPU's. Is it safe to assume that everything works now?

  • PaulT
    PaulT almost 13 years
    Thanks for your clear reply. It will be a good idea to do benchmarking as well of splitting the application in 2 APK files. The latter is actually a very good idea! Many thanks!
  • webshaker
    webshaker over 12 years
    Where Can I find difference between the both ABI ? I'm very instersted to understand real differences...
  • Nikolay Elenkov
    Nikolay Elenkov over 12 years
  • Dean Wild
    Dean Wild almost 12 years
    any idea's on an elegent solution for getting google Play to allow you to upload these two different APK's? There is no way to differentiate in the manifest that they are different so Google Play just wants to replace one with the other (they have different version codes)
  • Nikolay Elenkov
    Nikolay Elenkov almost 12 years
    Not really. You are limited by Google Play used to differentiate APKs (screen size, target version, etc). There are some apps that have their native libs as a 'plugin' of sorts, but you need to download another APK for you platform. Check MX Player for example.
  • Charles Harley
    Charles Harley over 11 years
    @DeanWild Google have now added support for targeting different CPU architectures in the Play Store multiple APK feature: developer.android.com/guide/google/play/publishing/…
  • Nikolay Elenkov
    Nikolay Elenkov over 11 years
    Long overdue. They seem to still recommend single APK when possible though.
  • trusktr
    trusktr over 11 years
    Is the phrase "separate apks for older (armeabi) and newer (armeabi-v7a) devices" the same as "separate apks for older (armv5) and newer (armv7a) devices"?
  • Nikolay Elenkov
    Nikolay Elenkov over 11 years
    Kind of. I think the only released Android devices before armv7a are all armv5 (G1, Magic, etc.).
  • fadden
    fadden almost 11 years
    The older devices are actually ARMv6, but Android used ARMv5TE as the baseline. There's very little reason to build for pre-v7 hardware today.
  • IgorGanapolsky
    IgorGanapolsky almost 8 years
    According to developer.android.com/ndk/guides/abis.html: The armeabi-v7a ABI uses the -mfloat-abi=softfp switch. So what do you mean by supports -mfloat-abi=hard?
  • Charles Harley
    Charles Harley almost 8 years
    @IgorGanapolsky, thanks for pointing that out. This is now the correct link: developer.android.com/google/play/publishing/…