2014-01-29 36 views
2

我在寫媒體播放器應用程序。最好在10英寸平板電腦,7英寸平板電腦,5英寸電話中看到。所以我想限制我的應用程序只安裝到這些設備。我怎樣才能做到這一點?如何限制應用程序到特定設備?

這裏是我當前清單文件中的值

<application 
     android:hardwareAccelerated="true" 
     android:allowBackup="true" 
     android:icon="@drawable/logo_new" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:hardwareAccelerated="true" 
      android:name="VideoActivity" 
      android:label="@string/app_name" 
      android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" 
      android:screenOrientation="sensorLandscape"> 

      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 


    </application> 
+1

你見過 Lingeshwaran

+0

謝謝..那個鏈接有幫助 – saa

回答

2

試試這個:

添加下面的東西放在你的AndroidManifest.xml<application>標籤:

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

您也可以按照參考鏈接::

http://android-developers.blogspot.in/2011/09/preparing-for-handsets.html

enter image description here

上面的代碼自動過濾由Play商店設備。

+0

好的...但是android:requiresSmallestWidthDp =「600」這個屬性適用於7英寸的平板電腦。所以它會允許安裝在5英寸的屏幕上 – saa

+0

@saa android:requiresSmallestWidthDp =「600」這只是一個例子,你可以自己改變它。 600不是強制性的。您可以用480 –

+0

@saa替換,請參閱編輯的代碼。 –

相關問題