当前位置: 动力学知识库 > 问答 > 编程问答 >

android - How to restrict app to specific devices ?

问题描述:

I am writing a media player application. It is best to see in 10 inch tablet, 7 inch tablet, 5 inch phone. So I wanna restrict my app to install to those devices only. How can I do that?

Here are my current manifest file values

<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>

网友答案:

Try this:

Add the following things on your AndroidManifest.xml before <application> tag :

<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"/>

You can also follow the reference links::

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

The above code automatically filters devices by Play Store.

分享给朋友:
您可能感兴趣的文章:
随机阅读: