I have an android app which, in the build.gradle file, lists the minSdkVersion as 23 (which should match down to Android 6.0) and the targetSdkVersion of 26, as well as compile of 26.
My device is a Zebra TC20, which is of android version 7.1.
I believe the issue is that my app allows the user to access the camera for a particular (optional) feature - the TC20 has no camera. I've tried to use the feature on the TC20 and it crashes.
So of course like any developer, I googled around to find out what's going on, and found this answer which suggests that you check if a feature is available before launching it, and I found this answer which describes how to check for CAMERA.
Now, my main activity wasn't using the Camera at all, but my main activity was launching another activity, via startActivityForResult
, and THAT activity uses a camera. So what I've done in my code is in the main activity, before launching the activity that uses the camera, I check for the camera first if (pm.hasSystemFeature(PackageManager.FEATURE_CAMERA))
, and only launch if it does, otherwise show a toast that the camera isn't available.
I've installed the APK myself and checked that this works on the TC20 device, and it does in fact work. My question then is, is this likely to be sufficient to allow my app to be downloaded by the TC20 on the playstore? Will I need to do the feature request INSIDE of the other activity as well? What are the guidelines for doing a check like this for the playstore to allow it?