简体   繁体   中英

Is there a tool that tells why my android app is not visible to a specific device in play store?

My app is not visible on a specific device(Honeywell CT50) in play store. Its visible in another Honeywell device CN51.
CT 50 works with google play because its listed in the supported device list for google play From some blog post published in 2013, I discovered that google play used to show what feature was blocking a specific device from being shown in the play store. I don't see such information right now in the play store. The incompatible device is simply grayed out. I tried publishing a sample app in store with the same manifest file(with same uses-library, uses-permission, permission, uses-feature, supports-screens but not the same activities, receivers or services) but the sample app is visible in the play store.

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14"/>

There is no tool for doing this. We need to test for all the hardware features(like android.hardware.location.gps ) in the specific device using the following code in onCreate method of a sample app.

setContentView(R.layout.activity_main);
PackageManager pm = getPackageManager();
TextView tv = (TextView) findViewById(R.id.hello);

if (!pm.hasSystemFeature(PackageManager.FEATURE_LOCATION)) {
    tv.append(PackageManager.FEATURE_LOCATION+" is NOT available \n");
} else {
    tv.append(PackageManager.FEATURE_LOCATION+" is available \n");

}

My Problem: My manifest had the following permission ACCESS_FINE_LOCATION . An app with this permission will be visible in play store only if the device has the following feature

android.hardware.location.gps

The specific Honeywell CT50 device I had trouble with, didn't have the above feature in it. So, my app didn't show up in the play store for this device. Also, my target API level is 14. If it was 20 or above, this problem wouldn't have arised(its mentioned in the table here )

The solution: I found the solution by reading the documentation here .

Note that declarations, including any declared android:required attribute, always take precedence over features implied by the permissions in table 2. For any of these permissions, you can disable filtering based on the implied feature by explicitly declaring the implied feature explicitly, in a element, with an android:required="false" attribute. For example, to disable any filtering based on the CAMERA permission, you would add this declaration to the manifest file: The solution for this problem was to add the following line

<uses-feature android:name=" android.hardware.location.gps" android:required="false" />

With the above line, we are making sure the gps feature is not a required feature. As a result, play store doesn't filter the app out for devices without this feature.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM