我正在开发的应用程序在 Nexus 5x 的 Google Play 中不可见。
由于它不支持平板电脑,因此有一个 <compatible-screens>
list 中的部分(如 documentation 中所建议):
<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" />
<!-- XXHdpi Screen -->
<screen android:screenSize="normal" android:screenDensity="480" />
<!-- XXXHdpi Screen -->
<screen android:screenSize="normal" android:screenDensity="560" />
<screen android:screenSize="normal" android:screenDensity="640" />
</compatible-screens>
但我不能使用<supports-screens>
因为this (我需要从平板电脑中完全过滤掉该应用程序):
Caution: If you use the
<supports-screens>
element for the reverse scenario (when your application is not compatible with larger screens) and set the larger screen size attributes to "false", then external services such as Google Play do not apply filtering. Your application will still be available to larger screens, but when it runs, it will not resize to fit the screen. Instead, the system will emulate a handset screen size (about 320dp x 480dp; see Screen Compatibility Mode for more information). If you want to prevent your application from being downloaded on larger screens, use<compatible-screens>
, as discussed in the previous section about Declaring an App is Only for Handsets.
除了向<compatible-screens>
添加密度为420的线外,还有其他方法可以解决这个问题吗 ?
最佳答案
根据 Google Nexus 5X 具有 xxhdpi 屏幕,但密度为 2,6。
所以 2,6 * 160 (mdpi) = 416,但根据 Android developers' site可接受的值为 420。
所以只需添加
<screen android:screenSize="normal" android:screenDensity="420" />
更新:新的 5"Google Pixel 具有相同的密度,因此同样的规则也适用于它。
关于android - <compatible-screens> 在 Google Play 中排除来自 Nexus 5x 的应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35009926/