簡體   English   中英

發布應用 - 在Android電子市場中按設備限制

[英]Publishing app - Limiting by device in Android Market

我即將在市場上發布我的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

另外,我想與您分享以下文字:

當我們說普通屏幕時它意味着什么?

我們告訴Android我們只支持屬於正常屏幕類的設備。 請注意,這並不一定意味着我們的應用程序不再可以在其他設備上安裝。 它甚至不意味着它注定要打破它們,但它還有其他含義。 我們沒有提到像素的實際尺寸或dpi中的密度。

有關詳細信息,請閱讀http://www.manning.com/collins/AiP_sample_ch04.pdf的第146頁

還有一個清單元素,在您的情況下可以更有用。 這是文檔頁面的鏈接 在Manifest中它看起來像這樣:

   <compatible-screens>
    <screen android:screenSize="normal" android:screenDensity="hdpi" />
   </compatible-screens>

希望這可以幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM