我想避免在非平板设备(宽度小于 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/