简体   繁体   中英

Why HTC One is unsupported device for my app on google play

I created an app for all Camera Phones . However when I upload the app to playstore the HTC One is listed as an unsupported device . So HTC One users are unable to install the app.

Here some more unsupported device : Sony Xperia Z, HTC One and Samsung Galaxy S4.

Some lines of my manifest:

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

<compatible-screens>

    <!-- all small size screens -->
    <screen
        android:screenDensity="ldpi"
        android:screenSize="small" />
    <screen
        android:screenDensity="mdpi"
        android:screenSize="small" />
    <screen
        android:screenDensity="hdpi"
        android:screenSize="small" />
    <screen
        android:screenDensity="xhdpi"
        android:screenSize="small" />

    <!-- all normal size screens -->
    <screen
        android:screenDensity="ldpi"
        android:screenSize="normal" />
    <screen
        android:screenDensity="mdpi"
        android:screenSize="normal" />
    <screen
        android:screenDensity="hdpi"
        android:screenSize="normal" />
    <screen
        android:screenDensity="xhdpi"
        android:screenSize="normal" />

</compatible-screens>

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-feature android:name="android.hardware.camera" />
<uses-feature
    android:name="android.hardware.camera.autofocus"
    android:required="false" />
<uses-feature
    android:name="android.hardware.camera.flash"
    android:required="false" />

My S4 returns a densityDpi of DisplayMetrics.DENSITY_XXHIGH and a Configuration.SCREENLAYOUT_SIZE_NORMAL. So you'd have to add those settings to your manifest. The HTC One and Xperia Z probably have the same values as the S4.

Also, the latest api version is 18. You might want to consider updating android:targetSdkVersion .

Play's filtering is doing precisely what you told it in the Manifest. Since you are using the element and only listing ldpi-xhdpi and small-normal screens, that what you get. Be aware that with you need to specify EACH configuration[1] you want your app to run on. So if new devices come out, like xxhdpi or large or even new and exotic configurations that do not exist yet, you will need to update your application.

The solution is either find out what the density/screen size of the devices you want your app to work on are and add those, or use the element. Or turn off screen filtering whatsoever, an app with properly designed layouts should be operational on any screen size, even if it's not optimized for tablets.

[1] http://developer.android.com/guide/topics/manifest/compatible-screens-element.html

Thanks for the answers, which help me to fix this issue.

Since screen density of some latest phones (Sony Xperia Z, HTC One and Samsung Galaxy S4) is xxhpdi and android:screenDensity This attribute currently does not accept xxhdpi as a valid value, but you can instead specify 480 as the value, which is the approximate threshold for xhdpi screens.

Just added following lines in the Manifest and it works.

<screen
    android:screenDensity="480"
    android:screenSize="normal" />

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