Android Development-api Guide-<compatible-screens>

Source: Internet
Author: User

<compatible-screens>

English Original: http://developer.android.com/guide/topics/manifest/compatible-screens-element.html
Acquisition (update) Date: 2014-6-30
Moved from the original blog: http://blog.sina.com.cn/s/blog_48d491300100zmub.html

Grammar:
< Compatible-screens >    <  android:screensize| "Normal" | "Large" | "XLarge"]            android:screendensity/>     ... </ Compatible-screens >
Included in:
<manifest>
Description
Specifies the screen parameters that the application is compatible with. Only one occurrence in the Manifest file <compatible-screens>element, but the element can contain more than one instance of the <screen>Elements. Each <screen>element defines a compatible screen size-density combination.

The Android system does not read the elements in the Manifest file <compatible-screens> (neither install nor run). This element is just a message that can be used by external services, such as Google Play, to better understand the application's compatibility with various screens and to enable filtering for the user. A screen parameter that is not declared in the element indicates that the application is incompatible with it. In this way, external services, such as Google Play, do not provide this application for devices on those screens.

reminder: Generally, do not use this Manifest element . If the screen parameters of the user device are not listed, these users will not be able to install the application, so using this element may significantly reduce the potential user base. This element is used as a last resort only if the program does not actually run on all screen parameters. As an alternative, you can provide scalable support for a variety of screens, using alternative Layout and bitmaps that correspond to various screen sizes and densities, as instructed by support for multiple screens.

If you just want to set a minimum screen size for your application, you should use <supports-screens> elements. For example, an application that supports only large and xlarge screens can be declared in an <supports-screens>  element that does not support small and normal screen sizes. External services, such as Google Play, will filter the application accordingly. You can also use <supports-screens> elements to declare whether the system can change the size of the application to suit a variety of screen sizes.

For more information on how Google Play uses this element and other Manifest elements to filter the application, please refer to Google Play's filter documentation.

Child elements:
<screen>
Defines a screen parameter that is compatible with the application.

<compatible-screens> Must contain at least one instance of this element. This element must both contain android:screenSize and android:screenDensity attribute (otherwise this element will be ignored).

Property:

android:screenSize
Required fields. defines the screen size in the screen parameters of this article.

Acceptable values are:

  • small
  • normal
  • large
  • xlarge

For more information on the various screen sizes, see support for multiple screens.

android:screenDensity
Required fields. defines the screen density in the screen parameters of this article.

Acceptable values are:

  • ldpi
  • mdpi
  • hdpi
  • xhdpi

Note: This property does not currently accept xxhdpi values, but can be used 480 instead, which is the closest density value to xhdpi.

For more information about screen density, see support for multiple screens.

Example:

If your application can only be compatible with small and normal-sized screens regardless of screen density, you must specify eight different <screen> elements, since each screen size has four different density configurations. Each combination must declare that any undeclared dimensions and densities are considered application-incompatible screen parameters. If the application is only compatible with the small and normal screens, the Manifest configuration should look similar to this:

<Manifest... >    ...    <Compatible-screens>        <!--All small size screens -        < Screenandroid:screensize= "small"android:screendensity= "ldpi" />        < Screenandroid:screensize= "small"android:screendensity= "MDPI" />        < Screenandroid:screensize= "small"android:screendensity= "hdpi" />        < Screenandroid:screensize= "small"android:screendensity= "xhdpi" />        <!--All normal size screens -        < Screenandroid:screensize= "normal"android:screendensity= "ldpi" />        < Screenandroid:screensize= "normal"android:screendensity= "MDPI" />        < Screenandroid:screensize= "normal"android:screendensity= "hdpi" />        < Screenandroid:screensize= "normal"android:screendensity= "xhdpi" />    </Compatible-screens>    <Application... >        ...    <Application></Manifest>
Introduced from:
API Level 9
See:
supports multiple screens
Google Play Filters

Android Development-api Guide-<compatible-screens>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.