jcr*_*son 2 java android google-play
我即将在市场上发布我的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>
Run Code Online (Sandbox Code Playgroud)
如果您的应用程序适用于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"/>
Run Code Online (Sandbox Code Playgroud)
否则你可以使用:
<supports-screens
android:smallScreens="false"
android:normalScreens="true"
android:largeScreens="false"
android:xlargeScreens= "false"
android:anyDensity="true" />
Run Code Online (Sandbox Code Playgroud)
看看以下网址:
http://developer.android.com/guide/topics/manifest/supports-screens-element.html
http://developer.android.com/guide/practices/screens_support.html
另外,我想与您分享以下文字:
当我们说普通屏幕时它意味着什么?
我们告诉Android我们只支持属于普通屏幕类的设备.请注意,这并不一定意味着我们的应用程序不再可以在其他设备上安装.它甚至不意味着它注定要打破它们,但它还有其他含义.我们没有提到dpi中的实际像素大小或密度.
有关详细信息,请阅读http://www.manning.com/collins/AiP_sample_ch04.pdf的第146页
归档时间: |
|
查看次数: |
2288 次 |
最近记录: |