English Original: http://developer.android.com/guide/topics/manifest/supports-screens-element.html
Acquisition (update) Date: 2014-7-3
Moved from the original blog: http://blog.sina.com.cn/s/blog_48d491300100zmvk.html
-
-
Grammar:
-
<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:
-
-
<manifest>
-
-
Description:
-
The
-
defines the screen sizes that your application supports and enables screen compatibility mode for larger screens. It is important to make sure that you use this element to specify the screen sizes that your application supports. The
So-called application "support" screen size, refers to the program can automatically change the size to fill the entire screen. Typically, the system-provided auto-tuning function works well for most applications, allowing the program to function properly on a larger-screen handheld device without doing any extra work. However, this often takes advantage of alternative Layout resources to optimize the user interface in a variety of screen sizes. For example, to differentiate between tablet devices and handheld devices, you might need to modify the layout of your Activity.
However, if the application does not run correctly for different screen sizes, the individual properties within the <supports-screens> element can be used to restrict This allows the program to run only on small screens, or to scale the user interface through the system's screen compatibility mode to accommodate larger screens. Screen compatibility mode determines the magnification of the user interface by simulating the screen and medium screen density of the normal size, if no special design is made for the larger screen, and the usual auto-sizing feature does not achieve the desired effect. Then zoom in to fill the entire screen. Note that this causes the user interface to be pixelated and blurred, so it is best to customize the user interface for large screen customization.
Note: new properties have been introduced since Android 3.2: android:requiressmallestwidthdp , Android: COMPATIBLEWIDTHLIMITDP and ANDROID:LARGESTWIDTHLIMITDP . If you are developing an application for Android 3.2 or later, you should use these properties to declare the supported screen sizes and not to use attributes that are descriptive about the screen size.
For more information about how to support various screen sizes to avoid using screen compatibility mode, see support for multiple screens.
-
-
Property:
-
-
-
android:resizeable
-
-
Indicates whether the application changes size according to different screen sizes. The default value is
true . If set to no, the system will run the application in screen compatibility mode on a larger screen.
This property is obsolete. This attribute was introduced to help the application upgrade from Android 1.5 to 1.6, when support for multiple screens was introduced for the first time. Do not use this property again.
-
-
android:smallScreens
-
-
indicates whether the application supports small size screens. The small size screen is defined as a screen smaller than the "normal" (traditional HVGA) size. Applications that do not support the small screen will be banned for small-screen devices in external services, such as Google Play, because only a handful of platforms will allow the program to run on a small screen. The default value is "
true ".
-
-
android:normalScreens
-
-
indicates whether the application supports a "normal"-sized screen. Traditionally, this refers to medium-density HVGA screens, but low-density WQVGA and high-density WVGA are generally considered normal sizes. The default property is "
true ".
-
-
android:largeScreens
-
-
Indicates whether the application supports larger size screens. The large screen refers to a screen that is significantly larger than the "normal" handheld device. While depending on the size of the system can also be used to achieve full-screen display, but in order to make full use of the screen space, it may be necessary to the application of special design.
The default values for this property vary by version, so it is best to ensure that this property is explicitly declared. Note that setting this property to "false" will always enable screen compatibility mode.
-
-
android:xlargeScreens
-
-
indicates whether the application supports XLarge size screens. The XLarge screen is defined as a screen that is significantly larger than the "large" size, such as a tablet (or larger device). While depending on the size of the system can also be used to achieve full-screen display, but in order to make full use of the screen space, it may be necessary to the application of special design.
The default values for this property vary by version, so it is best to ensure that this property is explicitly declared. Note that setting this property to "false" will always enable screen compatibility mode.
This property has been introduced since API level 9.
-
-
android:anyDensity
-
-
Indicates whether the application contains resources that fit all screen densities.
For applications that support Android 1.6 (API level 4) or later, the default value for this property is " true ". do not set to " false "unless you are sure that the program must be operational. This property may need to be disabled only if the application is directly manipulating the bitmap (see document support for multiple screens).
-
-
android:requiresSmallestWidthDp
-
The
-
specifies the minimum smallestwidth required for the application. Smallestwidth is the smallest screen space (in
DP ) that can be used by the user interface-that is, the shortest one in the two-direction edge length of the screen. Therefore, to ensure compatibility with the application, the smallestwidth of the device must be greater than or equal to this property value. (typically the value given here is the "minimum width" supported by the program's screen layout, regardless of the current orientation of the screen.)
For example, the minimum width of a typical handheld device is a 320dp,7 inch tablet with a minimum width of 600dp,10 inch tablet with a minimum width of 720DP. Because these values are the minimum amount of free space on the screen, it is generally the value of smallestwidth.
is compared to this property value when arranging the screen layout and the system user interface. For example, if there are some persistent user interface elements on the device's screen because their screen space is no longer available, the system-declared device Smallestwidth will be less than the actual screen size after the dimension of these elements is calculated. Therefore, set this value to the minimum width required by the program layout, regardless of the orientation of the screen.
This property is not required if the application is able to correctly resize on a small screen (at least small size or 320dp width). Otherwise, the minimum screen width identifier ( SW <N> DP ) should be used to set this property to the minimum size that meets the program's requirements.
Reminder: The Android system does not care about this property, so it does not affect the performance of the program when it runs. It is for services such as Google Play to enable filtering mechanisms. However, Google Play does not currently support filtering this property (Android 3.2), so if your application does not support small screens, continue to use other screen size properties.
This property has been introduced since API level 13.
-
-
android:compatibleWidthLimitDp
-
-
This property enables screen compatibility mode to provide options for the user by specifying the maximum number of "minimum screen widths" supported by the program. If the device is available on the shortest edge of the screen and grows up in the value set here, the user can still install the program but will run in screen compatibility mode. By default, screen Compatibility mode will be turned off, Layout will typically zoom to full screen, but a button will appear in the System status bar, which users can use to switch screen compatibility mode.
If the application is compatible with all sizes of screens and Layout is scaled properly, then this property is not required.
Note: Currently, screen compatibility mode only simulates a handheld device with a screen width of 320dp, so android:compatibleWidthLimitDp screen compatibility mode will not take effect when it is greater than 320.
This property is introduced from API level 13.
-
-
android:largestWidthLimitDp
-
-
This property forces the screen compatibility mode to be turned on by specifying the maximum number of minimum screen widths supported by the program. If the minimum edge of the device screen grows over this property value, the application runs in screen compatibility mode and the user cannot disable this mode.
If the application is compatible with all sizes of screens and Layout is scaled normally, then this property is not required. Even if not, you should prioritize the use of android:compatibleWidthLimitDp attributes. Properties are used only when zooming to a large screen and the application crashes, and the screen compatibility mode is the only way the user can use it android:largestWidthLimitDp .
Note: Currently, screen compatibility mode only simulates a handheld device with a screen width of 320dp, so android:largestWidthLimitDp screen compatibility mode will not take effect when it is greater than 320.
This property has been introduced since API level 13.