Android NDK : what should I set in Application.mk for APP_ABI?

17,146

Solution 1

You can also specify mips, which would be included when you use all.

armeabi code can run on armeabi-v7a devices, but not the other way around. So you don't need armeabi-v7a if you have armeabi, but it will allow you take advantage of hardware floating point operations on some devices.

Also note that the more architectures you include, the larger your resulting APK will be. And if you are regularly compiling for all platforms, your builds will take longer.

Take a look at docs/CPU-ARCH-ABIS.html in your NDK installation for more information about the different architectures.

Solution 2

I would recommend setting, as a minimum, armeabi-v7a and x86.

armeabi-v7a covers most, possibly all, of the most recent arm devices, and gives you hardware floating point support.

x86 covers all of the current crop of x86 devices (the biggest of which is the Samsung Galaxy Tab 3). Additionally, Intel are making a big, and very public, push for tablet market share this year onwards, and are likely to be more popular in the future.

There are a number of effects of this. krsteve is correct, this will make your builds slightly slower (as you are now building your game twice, effectively) and it will make your APK larger (because you are including the x86 and ARM binaries together), however, in the grand scheme of things those binaries are likely to be dwarfed in size by your assets, and if they aren't then your game isn't likely big enough to cross the Google Play APK size limit anyway.

To summarise:

  1. Use armeabi-v7a and x86, or use all
  2. The additional apk size will either be irrelevant or dwarfed by your asset size
  3. Your build times will increase, but it increases the number of devices you can hit, so that seems a fair trade off
Share:
17,146

Related videos on Youtube

toto_tata
Author by

toto_tata

Updated on September 18, 2022

Comments

  • toto_tata
    toto_tata almost 2 years

    I am wondering which architectures I should put in the Application.mk file of my Android game.

    I want to support all possible platforms that can download games on Google Play and other kinds of Android stores.

    I would say that I should set:

    APP_ABI := armeabi x86 (as many x86 devices are coming soon as far as I know)
    

    But I wonder if I should not set:

    APP_ABI := armeabi armeabi-v7a x86
    

    or

    APP_ABI := all
    

    Please clarify.