android - Nexus 5、Galaxy S5 和其他一些设备在 Google Play 中显示不兼容

标签 android galaxy incompatibility s5

我已经在 google play 中发布了一个应用程序,但某些设备显示为不受支持,例如 Nexus 5、Galaxy S5 等等。

我在我的 AndroidManifest.xml 中提到了以下链接中建议的仅适用于小型和正常尺寸屏幕的过滤器

http://developer.android.com/guide/practices/screens-distribution.html#FilteringHandsetApps

    <!-- 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>

有人可以建议还需要添加什么以使设备在支持列表中,我怀疑这些设备的密度更高。

最佳答案

我刚刚遇到了类似的问题。我想发布一个应用只能在智能手机上下载。稍后我将介绍平板电脑支持。所以我需要一个过滤器,让我的应用程序只适用于智能手机。该应用无法安装在 Nexus 5 或 Galaxy S5 上。

为了解决这个问题,我按照 dev documentation (screen distribution) 中的建议做了(另见 answer on stackoverflow ):

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

但这还不够。 不支持某些 xxhdpi 设备。您可能想复制/粘贴最后一行并添加“xxhdpi”,但 tt 不起作用(我刚刚测试了它并且 APK 签名失败并出现此错误:“错误 APT0000:不允许字符串类型(在 'screenDensity'值为 'xxhdpi')") ;)

要支持 xxhdpi,请检查 dev documentation (compatible screens element) .

Note: 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.

因此需要添加480,而不是xxhdpi,如下:

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

现在,回到不支持 Nexus 5Galaxy S5 的问题。让我们检查一些规范:

LG Nexus 5:http://www.gsmarena.com/lg_nexus_5-5705.php

  • 屏幕尺寸为 4.95 英寸。
  • 密度:445 ppi

三星 Galaxy S5:http://www.gsmarena.com/samsung_galaxy_s5-6033.php

  • 屏幕尺寸:5.1 英寸
  • 密度:432 ppi

所以根据dev documentation (screen support) :

how Android roughly maps actual sizes and densities to generalized sizes and densities (figures are not exact)

Figure 1. Illustration of how Android roughly maps actual sizes and densities to generalized sizes and densities (figures are not exact).

如您在上图中所见,4 到 5 英寸之间有点“棘手”(如果我错了请评论),因为屏幕可以是“正常”或“大”。所以基本上为了安全起见,我不得不添加对 large 的支持:

<screen android:screenSize="large" android:screenDensity="ldpi" />
<screen android:screenSize="large" android:screenDensity="mdpi" />
<screen android:screenSize="large" android:screenDensity="hdpi" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />
<screen android:screenSize="large" android:screenDensity="480" />

我刚刚在 Play 商店中进行了测试,我拥有 Nexus 5 的同事能够下载该应用程序。这样,无论如何,一些小型平板电脑或平板手机(屏幕尺寸在 4 到 7 英寸之间)仍然可以下载我的应用,但至少最新的超大屏幕平板电脑(大于7 英寸)不会。就我而言,这是可以接受的……希望这会有所帮助,并且……

...如果我对 4 到 5 英寸之间的区域有误,请发表评论,这对我来说并不是很清楚。哪个是正常的还是大的……

关于android - Nexus 5、Galaxy S5 和其他一些设备在 Google Play 中显示不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24690739/

相关文章:

gcc - C程序编译错误

android - 如何在android中使用parcelable传递字符串数组

java - 改变一个数组中的值会改变另一个数组中的值

android - 如何从一个 fragment 移动到一个 Activity

android:defaultValue 在某些手机上不工作 - 解决方法?

java - 如何修复 java.lang.UnsupportedClassVersionError : Unsupported major. 次要版本

python - 错误 400 : invalid_request The out-of-band (OOB) flow has been blocked in order to keep users secure

android - "take a picture and present it"在三星 Galaxy S 的纵向模式下

R:用子字符串替换数据框的行名[2]

c - 错误: assigning to 'char' from incompatible type 'const char *' .even if i have not defined string as constant