在 Android 上限制屏幕兼容性

Restricting screen compatibility on Android

限制 Android 应用程序安装到手持设备的正确方法应该是使用清单中的 compatible-screen 元素 (https://developer.android.com/guide/topics/manifest/compatible-screens-element.html)。

然而,这实际上不起作用(或者不再起作用?)。

如果我对本文档的理解是正确的,那么 Google Play 应该声明我的应用程序与任何平板电脑设备不兼容:

<compatible-screen>
    <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" />
</compatible-screen>

然而事实并非如此。经过更新和几天的等待,Google Play 一直声明该应用程序与我的所有设备(包括平板电脑)兼容。

是不是有什么误解,还是文档不是最新的?

您是否将其声明为 AndroidManifest.xml<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" />
    <screen android:screenSize="small" android:screenDensity="480" />
    <screen android:screenSize="small" android:screenDensity="640" />

    <!-- 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" />
    <screen android:screenSize="normal" android:screenDensity="480" />
    <screen android:screenSize="normal" android:screenDensity="640" />
</compatible-screens>

不要忘记添加 xxhdpixxxhdpi