You can build separate APK files for different processor architectures, and Play Store fully supports this. Instead of downloading one "fat" APK, your customers will get only what they really need, see Android Build Separate Apks for Different Processor Architectures.
To perform such build with ant, you can use the following script:
<target name="-pre-build">
<exec executable="${ndk.dir}/ndk-build" failonerror="true"/>
<arg value="APP_ABI=${abi}"/>
</target>
and use a batch file to run the loop (I use a simple sed
script; sed is available in %NDK_ROOT%\prebuilt\windows\bin\
and on all other platforms):
sed -i -e "s/versionCode=\"\([0-9]*\).]\"/versionCode=\"\11\"/" AndroidManifest.xml
ant -Dsdk.dir=%SDK_ROOT% -Dndk.dir=%NDK_ROOT% -Dabi=armeabi release
ren %apkfile%.apk %apkfile%_armeabi.apk
sed -i -e "s/versionCode=\"\([0-9]*\).\"/versionCode=\"\12\"/" AndroidManifest.xml
ant -Dsdk.dir=%SDK_ROOT% -Dndk.dir=%NDK_ROOT% -Dabi=mips release
ren %apkfile%.apk %apkfile%_mips.apk
sed -i -e "s/versionCode=\"\([0-9]*\).\"/versionCode=\"\13\"/" AndroidManifest.xml
ant -Dsdk.dir=%SDK_ROOT% -Dndk.dir=%NDK_ROOT% -Dabi=armeabi-v7a release
ren %apkfile%.apk %apkfile%_armeabi-v7a.apk
sed -i -e "s/versionCode=\"\([0-9]*\).\"/versionCode=\"\14\"/" AndroidManifest.xml
ant -Dsdk.dir=%SDK_ROOT% -Dndk.dir=%NDK_ROOT% -Dabi=x86 release
ren %apkfile%.apk %apkfile%_x86.apk
This assumes that android.verisonCode in the manifest file has zero as last digit, e.g. android:versionCode="40260"
.
Note that there is technically no reason to change versionCode for armeabi and mips variants, but it may be important to keep armeabi < armeabi-v7a < x86.