如何仅支持800x480px以上的分辨率?

时间:2013-07-25 21:23:32

标签: android android-manifest android-screen-support

我的Google Play过滤存在问题。我想隐藏我的应用程序的设备,其分辨率最低,然后800x480px。我该如何设置?

我试试:

<supports-screens 
    android:largeScreens="true" 
    android:anyDensity="true" 
    android:normalScreens="false" 
    android:smallScreens="false"
    android:xlargeScreens="true"
    android:requiresSmallestWidthDp="480" />

<supports-screens 
        android:largeScreens="true" 
        android:anyDensity="true" 
        android:normalScreens="true" 
        android:smallScreens="false"
        android:xlargeScreens="true"
        android:requiresSmallestWidthDp="480" />

首先解决方案非常糟糕。只有平板电脑可以在Google Play中看到我的应用第二种解决方案也很糟糕,因为它能够在分辨率为480x320px的设备上下载应用程序。遗憾的是,此命令android:requiresSmallestWidthDp="480"未在Google Play中使用过滤器。这里的文档很谨慎:

Caution: The Android system does not pay attention to this attribute, so it does not affect how your application behaves at runtime. Instead, it is used to enable filtering for your application on services such as Google Play. However, Google Play currently does not support this attribute for filtering (on Android 3.2), so you should continue using the other size attributes if your application does not support small screens.

有什么想法吗?

非常感谢。


感谢Manolescu Sebastian的标签为<compatible-screens>的想法。我不知道存在类似这个标签的东西。

解决方案在这里:

<compatible-screens>
    <screen android:screenSize="normal" android:screenDensity="hdpi" />
    <screen android:screenSize="normal" android:screenDensity="xhdpi" />

    <screen android:screenSize="large" android:screenDensity="ldpi" />
    <screen android:screenSize="large" android:screenDensity="mdpi" />
    <screen android:screenSize="large" android:screenDensity="hdpi" />
    <screen android:screenSize="large" android:screenDensity="xhdpi" />

    <screen android:screenSize="xlarge" android:screenDensity="ldpi" />
    <screen android:screenSize="xlarge" android:screenDensity="mdpi" />
    <screen android:screenSize="xlarge" android:screenDensity="hdpi" />
    <screen android:screenSize="xlarge" android:screenDensity="xhdpi" />
</compatible-screens>

1 个答案:

答案 0 :(得分:1)

我想你可以试试这个:

<compatible-screens>
<screen android:screenSize=["small" | "normal" | "large" | "xlarge"]
        android:screenDensity=["ldpi" | "mdpi" | "hdpi" | "xhdpi"] />
...

<manifest ... >
...
<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>
<application ... >
    ...
<application>

来源:http://developer.android.com/guide/topics/manifest/compatible-screens-element.html