Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android NDK and Google Play filtering

The Google Play appstore automatically filters your application to devices with compatible CPU architecture. E.g. if you have a library which is only compiled for ARMv5, your app will only show up for devices with ARMv5 or ARMv7 processors.

What if I have a Java alternative, and want my app to be downloaded by non-ARM devices too? E.g. I catch an exception when trying to load the external library, and implement a workable alternative in Dex bytecode (Java).

When I upload the .apk, the Android Developer Console says: "This apk requests 1 native platforms that will be used for Google Play filtering. armeabi"

Do I need to compile dummy libraries for x86 and MIPS? Then in my Java code, check the processor architecture to know if I can actually use the library? There should be a better solution.

As far as I know, there is nothing in the Manifest about CPU architecture, and I cannot find a way in the Developer Console to turn this filter off.

Hopefully somebody who knows a lot more than I do about Google Play filtering and the NDK knows the answer.

like image 821
Cory Avatar asked Jun 01 '12 08:06

Cory


People also ask

How do I filter Google Play store?

Filter Google Play Content To view, and modify your content settings, open the Google Play app, click the three-dot menu icon choose Settings. Under User Controls, choose filtering options.

What is Android NDK used for?

The Native Development Kit (NDK) is a set of tools that allows you to use C and C++ code with Android, and provides platform libraries you can use to manage native activities and access physical device components, such as sensors and touch input.

What is Abi filter?

Different Android devices use different CPUs, which in turn support different instruction sets. Each combination of CPU and instruction set has its own Application Binary Interface (ABI). An ABI includes the following information: The CPU instruction set (and extensions) that can be used.

Is Android Little Endian?

Again, though, Mac OS X on Intel, Windows, iOS and Android are little-endian, so you might just code up structures with the native endianness and hope the next great OS you want to port data to doesn't go big-endian.


1 Answers

While trapping for loadLibrary failures will work on any device (at least all that I have tried including GTVs), but the Play Store will not show on devices if the ABI for that platform does not exist in the apk.

From the docs ( http://developer.android.com/guide/appendix/market-filters.html ): An application that includes native libraries that target a specific platform (ARM EABI v7 or x86, for example) are visible only on devices that support that platform.

In in theory, building for all platforms would be able to target all devices, but in practice there are some devices like Google Tv that report no ABI, which means that only apks that have no native code will appear in the Play Store on those devices. You can use multiple apks, however, 1 with no native code and 1 with all platforms that support your native code.

You can read about multiple apk support here: http://developer.android.com/guide/market/publishing/multiple-apks.html

like image 113
Matt Avatar answered Oct 07 '22 21:10

Matt