entry in AndroidManifest that would limit app to ARMv7 devices only? - android

Is there a setting I can manually put into my AndroidManifest.XML that would limit the devices on which the app can be installed to ARMv7 architecture only?

When you upload an app to Google Play, if you are using the NDK and only include an armeabi-v7a binary, it will be visible to devices with the ARMv7 arch.

Related

Android: how to test for 64-bit device compatability

I was getting this warning in google play. This release is not compliant with the Google Play 64-bit requirement. The following APKs or App Bundles are available to 64-bit devices, but they only have 32-bit native code
I noticed that my apk had only x86, x86_64, armeabi_v7a folders. So I updated the gradle build script and now I have arm64-v8a folder as well. I see all the .so in armeabi-v7a generated in arm64 too.
How can I validate that this will support 64 bit devices
You can create an emulator with 64 bit image, to see that the app works on it.
Also, in your build variants, you can choose which active abi to use:

How do I know what target Architectures to choose?

I am building my Xamarin.Android project and I have selected AOT compilation which has bloated my .apk to 165mb.
To get my .apk size down I am looking at the target architectures, currently I target:
armeabi, armeabi-v7, x86, arm64-v8a
But I have no idea how these architectures correspond to modern devices.
I have read Android CPU Architectures and it says:
Xamarin.Android defaults to armeabi-v7a for Release builds. This
setting provides significantly better performance than armeabi. If you
are targeting a 64-bit ARM platform (such as the Nexus 9), select
arm64-v8a. If you are deploying your app to an x86 device, select x86.
If the target x86 device uses a 64-bit CPU architecture, select
x86_64.
Therefore do I need to target armeabi and armeabi-v7?
what archetectures should I target for a modern Android tablet and phone?
armeabi is for older devices as most newer devices run armeabi-v7. Secondly, 64 bit devices can fallback to other ABIs. If you're concerned about the size, then your best choice is to create multiple apks:
https://developer.xamarin.com/guides/android/application_fundamentals/cpu_architectures/#Targeting_Multiple_Platforms
Although Google recommends a single APK, this is not always the case:
Although we encourage you to develop and publish a single APK that supports as many device configurations as possible, doing so is sometimes not possible. To help you publish your application for as many devices as possible, Google Play allows you to publish multiple APKs under the same application listing. Google Play then supplies each APK to the appropriate devices based on configuration support you've declared in the manifest file of each APK.
https://developer.android.com/google/play/publishing/multiple-apks.html

Force users of a specific devices to install a particular version on Google Play Store

We have an app on the Google play store with two version of the APK for different architectures (ARM and x86). This is due to a dependant library being more stable when run natively.
However, a certain x86 based device is failing when running the x86 binary and I would like users of this device to switch to using the ARM version. The options to exclude devices only seems to apply to both APK files together.
Is this possible to configure in the Google Play Developer Console?
The only solution I've found is a hack.
It's possible to add additional contraits to the x86 build as specified here:
https://developer.android.com/google/play/filters.html#other-filters
In our case, we can add a constraint on compatible-screens to the app manifest saying that the x86 build is only supported by the precise screen resolution of the device that works with the build. The problematic x86 devices have a different resolution and are then excluded.

Googleplay don‘t filter x86 device

I generated a .so file which is builded by using ndk-build command. And in the Application.mk file,i writed these: APP_ABI := armeabi. Then, I used this .so file in another app, but I figured it out that the app is visible in Google play with an x86 device.
From the docs (http://developer.android.com/google/play/filters.html): By including native libraries built with the Android NDK that target a specific CPU architecture (ARM EABI v7 or x86, for example).
Now I'm confused, what should i do to make my app invisible to x86 device in GooglePlay?
We have an application published in GooglePlay,the application will crash in x86 device. So we want to make the application invisible for x86 device in GooglePlay. Now we have our .so file in armeabi directory under jniLibs directory, but x86 device still can find the application in GooglePlay.
Google Play may be depending on the fact that x86 has a translation layer which will take armeabi code and translate to x86. See: How does native android code written for ARM run on x86?
While I don't know why your particular app won't work on x86, one way to handle it is to check the CPU/Architecture when you app starts up via the old
Build.CPU_ABI
or on API 21 and up
Build.SUPPORTED_ABI
http://developer.android.com/reference/android/os/Build.html#CPU_ABI
and prevent the user from running your app if a condition isn't met like CPU architecture. So on launch you would check and if the device isn't correct degrade with a dialog and/or prevent the user from accessing the feature which would crash.
EDIT
If you are required to block devices from even seeing your app, you'll have to use the Google Play Developer console to select what devices can see your app.
See: How to restrict android app to specific device make?
and https://support.google.com/googleplay/android-developer/answer/1286017?hl=en
Of course as new x86 devices come online you'll have to remove them as well.

Limit Android apk download to ARM devices

I have an App containing a native library. The library only works in Android devices containing an ARM cpu.
The native library .so files are stored in the armeabi-v7a folder indicating the .so files are for a ARM cpu.
However when I upload the apk to the Play Store, the App can be downloaded on Android devices containing a x86 (or mips) based cpu. The App crashes as the library does not work on a non ARM cpu.
Unfortunately the library is only available on ARM so I can't include the x86 and mips .so files.
My question is: how can I limit the App from being downloaded by non ARM cpu devices?
I expected some requires=* settings in the AndroidManifest files but I can't find related settings.
Any ideas?
If you switch to advanced mode in the Google Play Developer Console it should give you some options regarding limiting to specific CPU architectures when uploading your APK. Documentation can be found at http://developer.android.com/google/play/publishing/multiple-apks.html .

Categories

Resources