2014-01-29 38 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替换,请参阅编辑的代码。 –

相关问题