Explanation of AndroidManifest. xml file (compatible-screen)

Source: Internet
Author: User

SYNTAX (SYNTAX ):

<Compatible-screens>
<Screenandroid: screenSize = ["small" | "normal" | "large" | "xlarge"]
Android: screenDensity = ["ldpi" | "mdpi" | "hdpi" | "xhdpi"]/>
...
</Compatible-screens>

Contained in (contained in ):

<Manifest>

DESCRIPTION )):

This element is used to specify the screen configurations that are compatible with the application. Only one <compatible-screent> element is allowed in the Application List, but it can contain multiple <screen> elements. Each <screen> element specifies a specific application-compatible size-density combination.

The Android system does not read the <compatible-screen> list elements (whether installed or running ). The information of this element can only be used by external services (such as Google Play), so that it can better understand the compatibility between applications and specified screen configurations. Any screen configuration that is not declared in this element is incompatible with the application. In this way, external services (such as Google Play) should not provide applications to devices with such screens.

Warning this list element should not be used normally. Because using this element will significantly reduce the potential user base of the application. If the device has an application list that does not list screen configurations, you are not allowed to install the application. This method is used only when the application does not work in all screen configurations. Instead, to provide full support for multiple screens, you should add optional resources for different screen sizes and density according to the "support multiple screen configurations" Guide (http://developer.android.com/guide/practices/screens_support.html.

If you only want to set a minimum screen size for the application, you should use the <supports-screens> element. For example, if you want your application to be valid only for large screen devices or large screen devices, the <supports-screen> element declares that the application does not support small screens (small) and normal screen devices. External services (such as Google Play) filter applications based on <supports-screen> Settings. You can also use the <supports-screens> element to declare whether the system should adjust the application to adapt to different screen sizes.

Child elements ):

<Screen>

This element specifies a screen configuration compatible with the application.

Within the <compatible-screens> element, there must be at least one instance of this element. This element must contain both android: screenSize and android: screenDensity attributes. If it is not declared at the same time, this element will be ignored.

ATTRIBUTES (ATTRIBUTES ):

Android: screenSize

Specifies the screen size of the screen configuration compatible with the application. It can be the following values:

· Small

· Normal

· Large

· Xlarge

Android: screenDensity

The screen density of the screen configuration compatible with the application can be:

· Ldpi

· Mdpi

· Hdpi

· Xhdpi

EXAMPLE ):

If the application is only compatible with the small screen and normal screen devices, regardless of the screen density, you must specify eight different <screen> elements, because each screen size has four different density configurations. These configurations must be declared one by one. Any combination of dimensions and density not specified will be considered incompatible with the application. If the application is only compatible with small and normal screens, the configuration is as follows:

<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>

Introduction (introduced in ):

API Level 9

 


From FireOfStar's column

Related Article

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.