过滤掉 google-play 上的所有平板电脑(无屏幕兼容模式)

filter out all tablets on google-play ( no screen compatibility mode)

关于文档 (http://developer.android.com/guide/practices/screens-distribution.html#FilteringHandsetApps) 你应该这样做:

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

但这也会过滤掉手机,例如xxhdpi - 遗憾的是您无法添加 xxhdpi,因为它不可用作值:http://developer.android.com/guide/topics/manifest/compatible-screens-element.html supports-screens 也没有选项:

Caution: If you use the 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 , as discussed in the previous section about Declaring an App is Only for Handsets.

另一种选择是过滤电话功能 - 但有些平板电脑具有电话功能。有什么办法可以做到这一点吗?

你试过吗?

<supports-screens android:largestWidthLimitDp="500"/>
   <supports-screens
    android:largeScreens="true"
    android:normalScreens="false"
    android:requiresSmallestWidthDp="600"
    android:smallScreens="false"
    android:xlargeScreens="true" />

它对 you.its 过滤片的帮助仅像 7 和 10 inches.try 一次

这应该有效:

<compatible-screens>
    <!-- all small size screens -->
    ...
    <!-- support for xxhdpi densities -->
    <screen android:screenSize="small" android:screenDensity="480" />
    <!-- all normal size screens -->
    ...
    <!-- support for xxhdpi densities -->
    <screen android:screenSize="normal" android:screenDensity="480" />
</compatible-screens>

根据 the documentation itself,您只需输入 xxhdpi 屏幕的原始 int 值:

Note: This attribute currently does not accept xxhdpi as a valid value, but you can instead specify 480 as the value, which is the approximate threshold for xhdpi screens.

我会改为使用此配置,以便您可以包含更多电话:

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

这样您就可以支持 http://developer.android.com/guide/topics/manifest/compatible-screens-element.html 中提到的所有可能的密度,如果您想支持一些最新的手机(例如三星 Galaxy S6),还可以添加 640