Erroneous
Erroneous

Reputation: 535

Multiple APKs for different ABI libs

I'm using a precompiled library that is fairly large (15 MiB) with significant speedups between arm5 and arm7 versions. My application is not an NDK application so I can't declare APP_ABI in the Application.mk AFAIK. My target SDK is at least android 2.3 and though I personally haven't seen a device that is 2.3+ that doesn't support armeabi-v7a, according to http://androidhardwares.com/android-hardware-development/android-hardware-requirements/ I should only assume armeabi.

Is there some feature or GL I can assume is available for all arm-v7 processors but not on arm-v6 or arm-v5? Is there a way to convert my application to NDK JUST for that one option in the Application.mk? If I just use different version names (IE 1.0-arm5, 1.0-arm7) and different apks with only either armeabi and armeabi-v7a directories in lib would that work? According to http://developer.android.com/google/play/publishing/multiple-apks.html I have to have something else different in the android manifest for that to work.

Upvotes: 3

Views: 521

Answers (3)

calebeaires
calebeaires

Reputation: 2084

You should order the version codes so that the APK with best performance runs on each device. For example, order the version codes so that the x86 APK has the highest version code, followed by ARMv7, then ARMv5TE. Thus the x86 APK will be preferred for x86 devices and the ARMv7 APK preferred for ARMv7 devices.

Upvotes: 0

Erroneous
Erroneous

Reputation: 535

The solution is to set the versionCode to be a higher number for higher arm systems in AndroidManifest.xml. If your version is 1.0.0 and your version code is 100, change it to 1005 for arm 5 and 1007 for arm 7. This way, when a user sees it in the Play store, the arm 7 version will download if their device supports it since it has a higher version code. Just be sure to upload the lower version codes first when uploading to the developer's console.

Upvotes: 1

Alex Cohn
Alex Cohn

Reputation: 57173

"I'm using a library" - is this a native library (C/C++)? If it is, then your application is an NDK application, even if you don't build this library with ndk-build as part of your regular build process; even if it is built by some different native toolchain, completely unrelated to NDK; even if it is a 3-rd party library which you don't build at all.

So, there is no problem to set APP_ABI in Apllication.mk. I believe this will resolve your problem.

Upvotes: 1

Related Questions