Syntax (syntax ):
<Supports-screensandroid: resizeable = ["true" | "false"]
Android: smallscreens = ["true"
| "False"]
Android: normalscreens = ["true"
| "False"]
Android: largescreens = ["true"
| "False"]
Android: xlargescreens = ["true"
| "False"]
Android: anydensity = ["true"
| "False"]
Android: requiressmallestwidthdp ="Integer"
Android: compatiblewidthlimitdp ="Integer"
Android: largestwidthlimitdp ="Integer"/>
Included in (contained in ):
<Manifest>
Description ):
This element is used to specify the screen size supported by the application and enable the screen compatibility mode for larger screens than the screen supported by the application. It is vital to use this element in an application to specify the screen size supported by the application.
If the application adjusts the size attribute to fill the screen, the application must support the given size. Generally, for most applications, the system can do this well, and you do not need to do any extra work to make the application work on a screen larger than a handheld device. However, it is often important to optimize the UI of an application by providing optional layout resources for different screen sizes. For example, if you want to run an activity layout on a tablet, You need to modify the layout of the activity.
However, if the size is adjusted to adapt to different screen sizes, but the application cannot work well, you can use the attribute of the <supports-screens> element to control whether the application should be published to a device with a small screen, or use the screen compatibility mode of the system, let the UI zoom in to meet the requirements of large screen. When there is no design for a large screen size and the normal size cannot reach an appropriate result, the screen compatibility mode scales the UI by simulating a normal screen size and a medium density, so that it can fill the entire screen, which will lead to UI blur, so it is better to optimize the large screen.
Note: android3.2 introduces new attributes: Android: requiressmallestwidthdp, Android: compatiblewidthlimitdp, and Android: largestwidthlimitdp. If you are developing an android3.2 or later application, you should use these attributes to declare the screen size supported by the application, rather than based on the general screen size attributes.
For more information about how to correctly support different screen sizes to avoid using screen compatibility mode for applications, see "supporting multiple screens"
Http://developer.android.com/guide/practices/screens_support.html)
Attributes (attributes ):
Android: resizeable
This attribute is used to indicate whether the application can adjust the size for different screen sizes. The default value is true. If this attribute is set to false, the system runs the application in screen compatibility mode on a large screen.
This attribute has been deprecated. This attribute is introduced to help the application transition from 1.5 to 1.6. When multi-screen support is introduced, it should not be used.
Android: smallscreens
This attribute is used to specify whether the application supports screens with small shapes. A small screen is defined as a screen smaller than a normal (traditional hvga) screen. External services (such as Google Play) do not provide applications that do not support small screens to small screen devices, because few platforms can ensure that the applications work normally on small screen devices. The default value of this attribute is true.
Android: normalscreens
This attribute is used to indicate whether the application supports normal screen shapes. A typical screen is a hvga medium-density screen. However, wqvga low-density and WVGA high-density screens are also considered common screens. The default value of this attribute is true.
Android: largescreens
This attribute is used to indicate whether the application supports a large screen. A screen of the large type is defined as a screen that is much larger than a screen of a normal handheld device, and in order to make the application work well, be especially careful when using this property, although you can rely on the system to adjust the size to be able to fill the screen.
The default value of this attribute is actually different in some versions, so it is best to explicitly declare this attribute at any time. If it is set to false, the system will enable the screen compatibility mode, so be extra careful.
Android: xlargescreens
This attribute is used to indicate whether the application supports a large screen. An xlarge screen is defined as a screen larger than a large screen, such as a tablet. In order to make good use of applications, you must be especially careful when using this property, although the UI size of the system can be used to fill the screen.
Android: anydensity
This attribute specifies whether the application contains resources that can apply to any screen density.
For applications that support android1.6 (API Level 4) and later, the default value of this attribute is true, and unless absolutely confirmed that this is required for the normal operation of the application, otherwise, it should not be set to false. This attribute must be disabled only when the application directly operates the bitmap.
Android: requiressmallestwidthdp
This attribute is used to specify the minimum requirement of smallestwidth. Smallestwidth is the shortest size of the screen space (in DP). It must be effective for the application UI. That is to say, it is the shortest of the two dimensions of the valid screen. Therefore, to ensure the compatibility between devices and applications, the smallestwidth value of the device must be greater than or equal to the value set for this property. This attribute value is usually the minimum width supported by the layout, rather than the current direction of the screen.
For example, the screen smallestwidth of a typical handheld device is 320dp; the screen width of a 7 inch tablet is 600dp; the screen width of a 10 inch tablet is 720dp. These values are generally the smallest width because they are the shortest size in the available space of the screen.
To compare the size value, consider the screen decoration and system UI. For example, if the system has some Fixed UI elements to display, the minimum width (smallestwidth) of the device declared by the system is smaller than the actual screen size, because the screen pixels occupied by the system UI are invalid for the UI of the application. Therefore, this value must be the minimum width used by the application layout, regardless of the current direction of the screen.
This attribute is not required if the application is able to properly adjust small screen sizes (small or screen with a minimum width below 320dp. Otherwise, this attribute value should match the value of the minimum screen width qualifier used by the application (SW <n> DP.
Warning: the Android system does not pay attention to this attribute, so it does not affect the behavior of the application at runtime. Instead, it is used by services (such as Google Play) to filter applications. However, Google Play does not support filtering (on android3.2). Therefore, if the application does not support small screen devices, you should continue to use other size attributes.
This attribute is introduced in API Level 13.
Android: compatiblewidthlimitdp
This attribute allows you to enable the screen compatibility mode by specifying the maximum "smallest screen width" when designing an application as a user-selectable feature. If the minimum side of the valid screen of the device is greater than the value of this attribute, the user can still install the application, but the screen compatibility mode must be used during running. By default, the screen compatibility mode seems to be disabled, and the screen is filled by adjusting the layout size, but there is a button in the system bar, enable or disable the screen compatibility mode.
This attribute is not required if the application is compatible with all screen sizes and its layout can be adjusted correctly.
Note: currently, the screen compatibility mode can only simulate the screen of a 320 DP-width handheld device. Therefore, if the Android: compatiblewidthlimitdp value is greater than, the screen compatibility mode is not applicable.
This is introduced in API Level 13.
Android: largestwidthlimitdp
This attribute allows you to forcibly enable the screen compatibility mode by specifying the maximum "smallest screen width" when re-designing an application. If the minimum side of the valid screen of the device is greater than the value of this attribute, the application runs in screen compatibility mode, and the user cannot disable this mode.
This attribute is not required if the application is compatible with all screen sizes and can be correctly adjusted. Otherwise, you must first consider using the Android: compatiblewidthlimitdp attribute. This attribute should be used only when the function of the application is damaged due to large screen size adjustment and the screen compatibility mode is the only method.
Note: currently, the screen compatibility mode can only simulate the screen of a 320 DP-width handheld device. Therefore, if the Android: compatiblewidthlimitdp value is greater than, the screen compatibility mode is not applicable.
This is introduced in API Level 13.
Introduced version (introduced in ):
API level 4