我正在编写一个媒体播放器应用程序。最好在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>
试试这个:
在AndroidManifest.xml
before<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
上面的代码会按Play商店自动过滤设备。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句