2013-07-25 65 views
0

我有一個Google Play過濾問題。我想隱藏我的應用程序的設備,其中最低的分辨率,然後800x480px。我如何設置?如何僅支持分辨率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塞巴斯蒂安想法與標記<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> 
+0

AFAIK,沒有辦法做到這一點,我懷疑這是永遠不可能的。即使'android:requireSmallestWidthDp'也是'dp',而不是'px',根據您的要求。 – CommonsWare

回答

1

我想你可以試試這個:

​​

<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

+0

很好的回答!這幫助了我很多 –