android - Play 商店忽略 API 21+ 上的 requiresSmallestWidthDp

标签 android google-play

我想避免在非平板设备(宽度小于 600dp 的任何设备)上通过 Play 商店安装我的应用程序。

https://developer.android.com/guide/practices/screens-distribution.html#FilteringTabletApps 中所述我正在使用 <supports-screens>requiresSmallestWidthDp在 list 上,但似乎商店是 忽略此属性 (例如,我仍然在 Play 管理中心的兼容设备部分看到 Nexus 5)

https://developer.android.com/guide/topics/manifest/supports-screens-element.html注意,我的 minSdkVersion 21 不需要其他参数:

If you're developing your application for Android 3.2 and higher, you should use these attributes to declare your screen size support, instead of the attributes based on generalized screen sizes.



所以使用 android:smallScreens="false"应该避免如文档中所述。但是商店忽略 新的/首选参数。

现在做什么?我想让该应用程序仅适用于具有 requiresSmallestWidthDp=600 的设备所以我也会支持 Nexus 7。

但是当使用 legacy-parameter largeScreens="true"我允许安装在任何大于 480dp 的设备上,这意味着屏幕上的空间更小(实际上我想选择 720dp,但 7"设备似乎很常见)。

最佳答案

对于小型和普通设备,在 list 中添加以下行

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

关于android - Play 商店忽略 API 21+ 上的 requiresSmallestWidthDp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45433676/

相关文章:

android - 为什么我得到 java.lang.IllegalArgumentException : background can not be translucent: #0 when using MediaRouteButton?

android - 无法将 .apk 上传到 Google Play(无法上传仅供测试的 APK)

google-play - 在多个平台上维护和组织购买

android - Firebase - 电子邮件验证邮件不工作 - 发生内部错误。 [ USER_NOT_FOUND ]

android - Android 版本 > 7 是否支持 LD_PRELOAD?

Android Cursor RecyclerView 在滑动时轻弹

android - Google Play 商店暂停应用程序?

android - android中的图形表示

android - 在新的Android控制台中哪里可以看到停用的APK?

google-play - 使用 Play 市场封闭 alpha 测试时应用程序没有可用错误