diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java index 31119d7ea3da1..72fa07c40d9d2 100644 --- a/core/java/android/content/res/Configuration.java +++ b/core/java/android/content/res/Configuration.java @@ -57,11 +57,30 @@ public final class Configuration implements Parcelable, ComparableSupporting + * Multiple Screens for more information. */ public static final int SCREENLAYOUT_SIZE_SMALL = 0x01; + /** Constant for {@link #screenLayout}: a {@link #SCREENLAYOUT_SIZE_MASK} + * value indicating the screen is at least approximately 320x470 dp units. + * See Supporting + * Multiple Screens for more information. */ public static final int SCREENLAYOUT_SIZE_NORMAL = 0x02; + /** Constant for {@link #screenLayout}: a {@link #SCREENLAYOUT_SIZE_MASK} + * value indicating the screen is at least approximately 480x640 dp units. + * See Supporting + * Multiple Screens for more information. */ public static final int SCREENLAYOUT_SIZE_LARGE = 0x03; + /** Constant for {@link #screenLayout}: a {@link #SCREENLAYOUT_SIZE_MASK} + * value indicating the screen is at least approximately 720x960 dp units. + * See Supporting + * Multiple Screens for more information.*/ public static final int SCREENLAYOUT_SIZE_XLARGE = 0x04; public static final int SCREENLAYOUT_LONG_MASK = 0x30; @@ -88,6 +107,9 @@ public final class Configuration implements Parcelable, ComparableThe {@link #SCREENLAYOUT_LONG_MASK} defines whether the screen * is wider/taller than normal. They may be one of * {@link #SCREENLAYOUT_LONG_NO} or {@link #SCREENLAYOUT_LONG_YES}. + * + *

See Supporting + * Multiple Screens for more information. */ public int screenLayout; diff --git a/docs/html/guide/practices/screens_support.jd b/docs/html/guide/practices/screens_support.jd index 520bd28853e48..9875a6ec85e8e 100644 --- a/docs/html/guide/practices/screens_support.jd +++ b/docs/html/guide/practices/screens_support.jd @@ -189,12 +189,32 @@ offer UI designed for the generalized sizes and densities and let the system handle the actual rendering of the UI on the current device screen according to its characteristics.

-

Figure 1. Illustration of how the Android platform maps actual screen densities and sizes to generalized density and size configurations.

+

Layout designs often need to be done against a minimum amount of +available space, so each screen size bucket has an associated minimum size. +These sizes are in "dp" units -- the same units you should use in defining +your layouts, which allow us to avoid worrying about changes in screen density.

+ + + +

Note that these minimum screen sizes were not +as well defined prior to Android 3.0, so you may encounter some devices +that are mis-classified between normal and large. These are also based +on the physical resolution of the screen, so may vary across devices -- +for example a 1024x720 tablet with a system bar would actually have a bit +less space available to the application due to it being used by the system +bar. Android does not currently support screens smaller than the "small" +426dp x 320dp size.

+

Although the platform lets your application provide customized resources for the various size and density configurations, you do not need to do write custom code or provide custom resources for every combination of screen size and density. @@ -212,7 +232,8 @@ of the emulator skins to replicate the characteristics of any specific screen.

Table 1. Screen -sizes and densities of emulator skins included in the Android SDK.

+sizes and densities of emulator skins included in the Android SDK and other +representative resolutions.

@@ -235,27 +256,33 @@ sizes and densities of emulator skins included in the Android SDK.

- + - + - - - - + + + + - - + + @@ -263,10 +290,13 @@ sizes and densities of emulator skins included in the Android SDK.

- - - - + + + + + + +
Small screen QVGA (240x320)QVGA (240x320) 480x640
Normal screen WQVGA400 (240x400)
WQVGA432 (240x432)
HVGA (320x480)WVGA800 (480x800)
WVGA854 (480x854)
WQVGA400 (240x400) +
WQVGA432 (240x432)
HVGA (320x480)WVGA800 (480x800) +
WVGA854 (480x854) +
600x1024
640x960
Large screen WVGA800* (480x800)
WVGA854* (480x854)
WVGA800** (480x800) +
WVGA854** (480x854)
WVGA800* (480x800) +
WVGA854* (480x854) +
600x1024
Extra Large screen 600x1024768x1024
WXGA (768x1280) +
800x1280
1152x1536
1152x1920 +
1200x1920
1536x2048
1536x2560 +
1600x2560
* To emulate this @@ -274,6 +304,12 @@ sizes and densities of emulator skins included in the Android SDK.

creating an AVD that uses a WVGA800 or WVGA854 skin.
** To emulate this + configuration, specify a custom density of 120 when + creating an AVD that uses a WVGA800 or WVGA854 skin. +

For an overview of the relative numbers of high (hdpi), medium (mdpi), and diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd index 1583deefc79bf..1da2622f2b8ae 100644 --- a/docs/html/guide/topics/resources/providing-resources.jd +++ b/docs/html/guide/topics/resources/providing-resources.jd @@ -337,21 +337,25 @@ indicates the current locale.

  • {@code small}: Screens based on the space available on a low-density QVGA screen. Considering a portrait HVGA display, this has the same available width but less height—it is 3:4 vs. HVGA's - 2:3 aspect ratio. Examples are QVGA low density and VGA high + 2:3 aspect ratio. The minimum layout size for this screen configuration + is approximately 320x426 dp units. Examples are QVGA low density and VGA high density.
  • {@code normal}: Screens based on the traditional medium-density HVGA screen. A screen is considered to be normal if it is - at least this size (independent of density) and not larger. Examples + at least this size (independent of density) and not larger. The minimum + layout size for this screen configuration is approximately 320x470 dp units. Examples of such screens a WQVGA low density, HVGA medium density, WVGA high density.
  • {@code large}: Screens based on the space available on a medium-density VGA screen. Such a screen has significantly more available space in both width and height than an HVGA display. + The minimum layout size for this screen configuration is approximately 480x640 dp units. Examples are VGA and WVGA medium density screens.
  • {@code xlarge}: Screens that are considerably larger than the traditional - medium-density HVGA screen. In most cases, devices with extra large screens would be too -large to carry in a pocket and would most likely be tablet-style devices. Added in API Level -9.
  • + medium-density HVGA screen. The minimum layout size for this screen configuration + is approximately 720x960 dp units. In most cases, devices with extra large + screens would be too large to carry in a pocket and would most likely + be tablet-style devices. Added in API Level 9.

    Added in API Level 4.

    See Supporting Multiple