2012-07-27 97 views
3

我的項目支持手機和10英寸平板電腦的單個apk。然而,手機和平板電腦的用戶界面非常不同。我將在下週發佈應用程序,並且我希望該應用程序暫時可供電話用戶使用。由於測試未完成,平板電腦版本將暫停。 將下面的聲明清單中阻止應用程序安裝/可見的10英寸平板電腦防止應用程序在Android平板電腦上運行

<manifest ... > 
    <supports-screens android:smallScreens="true" 
         android:normalScreens="true" 
         android:largeScreens="true" 
         android:xlargeScreens="false"/> 
    ... 
    <application ... > 
     ... 
    </application> 
</manifest> 

這個問題的解決應該是:這將篩選出10英寸(超大)平板電腦的應用程序?

<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" /> 
    <!-- all large size screens --> 
    <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" /> 
</compatible-screens> 
... 
<application ... > 
    ... 
<application> 

回答

8

將下面的聲明清單中阻止應用程序安裝/可見的10英寸平板電腦

號是用清單條目,你告訴的Android,讓您的應用在-xlarge設備上,Android會做一些額外的工作來嘗試讓UI拉伸以填充屏幕。

要阻止安裝(並從Play商店列表中過濾掉),you will need to use <compatible-screens>

+0

贊成,.// .. @CommonsWare,我想我的應用程序與平板電腦不兼容?我怎樣才能防止使用? – 2012-12-26 19:35:46

+0

@AbdulWahab:這在問題的編輯中已涵蓋。 – CommonsWare 2012-12-26 19:38:02

+0

行動,小姐完全讀取這個問題, 我認爲,下面是最聰明的代碼,我是對嗎? 2012-12-26 19:44:12

相關問題