<兼容屏>在Google Play中排除Nexus 5x中的应用 [英] <compatible-screens> excludes app from Nexus 5x in Google Play

查看:142
本文介绍了<兼容屏>在Google Play中排除Nexus 5x中的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在开发的应用在Nexus 5x的Google Play中不可见。
由于它不支持平板电脑,清单中有一个< compatible-screens> 部分(如

 

code>< compatible-screens>
<! - 所有小尺寸屏幕 - >
< screen android:screenSize =smallandroid:screenDensity =ldpi/>
< screen android:screenSize =smallandroid:screenDensity =mdpi/>
<屏幕android:screenSize =smallandroid:screenDensity =hdpi/>
< screen android:screenSize =smallandroid:screenDensity =xhdpi/>
<! - 所有正常尺寸的屏幕 - >
< screen android:screenSize =normalandroid:screenDensity =ldpi/>
< screen android:screenSize =normalandroid:screenDensity =mdpi/>
< screen android:screenSize =normalandroid:screenDensity =hdpi/>
< screen android:screenSize =normalandroid:screenDensity =xhdpi/>
<! - XXHdpi屏幕 - >
< screen android:screenSize =normalandroid:screenDensity =480/>
<! - XXXHdpi屏幕 - >
<屏幕android:screenSize =normalandroid:screenDensity =560/>
< screen android:screenSize =normalandroid:screenDensity =640/>
< / compatible-screens>

但我无法使用< supports-screens> 因为这个(我需要完全过滤请从平板电脑中取出应用程序):


注意:如果您使用< supports-screens> 元素(当您的应用程序与大屏幕不兼容时)并将较大的屏幕尺寸属性设置为false,则外部服务(如Google Play)不会应用过滤。您的应用程序仍然可用于较大的屏幕,但运行时,它不会调整大小以适应屏幕。相反,系统将模拟手机屏幕尺寸(约320dp x 480dp;有关更多信息,请参阅屏幕兼容模式)。如果您想阻止您的应用程序在较大的屏幕上下载,请使用< compatible-screens> ,如前一节中关于声明应用程序仅适用于手机中所述。

是否有其他方法可以解决这个问题除了将420密度的行添加到<根据 //design.google.com/devices/rel =nofollow noreferrer> Google Nexus 5X有一个xxhdpi屏幕,但密度为2,6。
So 2,6 * 160(mdpi)= 416,但根据 Android开发者网站接受的价值是420.
因此,只需添加
< screen android:screenSize =normalandroid:screenDensity = 420/>



更新:新的5Google Pixel具有相同的密度,因此同样的规则也适用于此。

The app I am developing now is not visible in Google Play from Nexus 5x. As it does not support tablets, there is a <compatible-screens> section in the manifest (as suggested in 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>

But I can't use <supports-screens> because of this (I need to completely filter out the app from tablets):

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.

Are there any other ways to solve this problem except adding line with 420 density to <compatible-screens>?

解决方案

According to Google the Nexus 5X has a xxhdpi screen but with a density of 2,6. So 2,6 * 160 (mdpi) = 416, but according to Android developers' site the accepted value is 420. So just add <screen android:screenSize="normal" android:screenDensity="420" />

UPDATE: The new 5" Google Pixel has the same density so the same rule applies for it as well.

这篇关于&LT;兼容屏&GT;在Google Play中排除Nexus 5x中的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆