我即将在市场上发布我的 Android 应用程序,但我决定只为具有正常屏幕尺寸和高密度的设备(例如 HTC Desire)设计它。
除了具有与 HTC Desire 相同规范的设备外,此应用程序在任何其他设备上都无法正常显示。
我想知道如何才能限制市场上的应用程序以符合这些规范?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package=""
android:versionCode="1"
android:versionName="1.0" android:installLocation="auto">
<supports-screens
android:smallScreens="false"
android:normalScreens="true"
android:largeScreens="false"
android:xlargeScreens= "false"
android:anyDensity="false"
android:requiresSmallestWidthDp="480"
android:compatibleWidthLimitDp="480"
android:largestWidthLimitDp="480"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name" android:screenOrientation="landscape">
<activity android:name=".PhonegapScreenshotPluginActivity"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden" android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
最佳答案
如果您的应用程序适用于 Android 3.2 及更高版本,您可以使用:
<supports-screens
android:smallScreens="false"
android:normalScreens="true"
android:largeScreens="false"
android:xlargeScreens= "false"
android:anyDensity="true"
android:requiresSmallestWidthDp="480"
android:compatibleWidthLimitDp="480"
android:largestWidthLimitDp="480"/>
否则你可以使用:
<supports-screens
android:smallScreens="false"
android:normalScreens="true"
android:largeScreens="false"
android:xlargeScreens= "false"
android:anyDensity="true" />
查看以下网址:
http://developer.android.com/guide/topics/manifest/supports-screens-element.html
http://developer.android.com/guide/practices/screens_support.html
我还想与您分享以下文字:
普通屏幕是什么意思?
We tell Android that we only support devices that fall into the normal screens class. Note that this doesn’t necessarily imply that our application isn’t installable anymore on other devices. It doesn’t even mean that it’s doomed to break on them, but it has other implications. We didn’t mention actual sizes in pixels or densities in dpi.
更多详情,请阅读第146页 http://www.manning.com/collins/AiP_sample_ch04.pdf
关于java - 发布应用程序 - 在 Android Market 中受设备限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8786147/