DrawableenrUSfinger drawableport drawableportmdpi drawableqwerty

Table 2 lists the valid folder-name qualifiers, in order of precedence. Qualifiers that are listed higher in the table take precedence over those listed lower, as described in How Android finds the best matching directory.

Table 2




The mobile country code optionally followed by mobile network code from the SIM in the device. For example mcc310 (U.S. on any carrier); mcc310-mnc0 04 (U.S., Verizon brand); mcc2 0 8-mnc0 0 (France, Orange brand); mcc234-mnc00 (U.K., BT brand).

If the device uses a radio connection (GSM phone), the MCC will come from the SIM, and the MNC will come from the network to which the device is attached. You might sometimes use the MCC alone, for example to include country-specific legal resources in your application. If your application specifies resources for a MCC/MNC combination, those resources can only be used if both the MCC and the MNC match.

Language and region

The two letter ISO 639-1 language code optionally followed by a two letter ISO 3166-1-alpha-2 region code (preceded by

lowercase "r"). For example fr, en-rUS, fr-rFR, es-rES.

The codes are not case-sensitive; the r prefix is used to distinguish the region portion. You cannot specify a region alone, but you can specify a language alone, for example en, fr, es.

Screen dimensions

small, normal, large

Specify that the resource is for a particular class of screen. The meanings of these are:

• Normal screens are based on the traditional Android HVGA medium density screen. A screen is considered to be normal if it is at least this size (independent of density) and not large. Examples of such screens a WQVGA low density, HVGA medium density, WVGA high density.

• Small screens are based on the space available on a QVGA low density 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 density.

• Large screens are based on the space available on a VGA medium density screen. Such a screen has significantly more available space in both width and height than an HVGA display. Examples are VGA and WVGA medium density screens.

Wider/taller screens

long, notlong

Specify that the resource is for a taller/wider than traditional screen. This is based purely on the aspect ration of the screen: QVGA, HVGA, and VGA are notlong; WQVGA, WVGA, FWVGA are long. Note that long may mean either wide or tall, depending on the current orientation.

Screen orientation

port, land, square

Specifies that the resource is for a screen that is tall (port) or wide (land); square is not currently used.

Screen pixel density

ldpi, mdpi, hdpi, nodpi

Specifies the screen density the resource is defined for. The medium density of traditional HVGA screens (mdpi) is defined to be approximately 160dpi; low density (ldpi) is 120, and high density (hdpi) is 240. There is thus a 4:3 scaling factor between each density, so a 9x9 bitmap in ldpi would be 12x12 is mdpi and 16x16 in hdpi. The special nodpi density can be used with bitmap resources to prevent them from being scaled at load time to match the device density.

When Android selects which resource files to use, it handles screen density differently than the other qualifiers. In step 1 of How Android finds the best matching directory (below), screen density is always considered to be a match. In step 4, if the qualifier being considered is screen density, Android will select the best final match at that point, without any need to move on to step 5.

You can also specify explicit densities like 92dpi or 10 8dpi, but these are not fully supported by the system so should not be used.

Touchscreen type

notouch, stylus, finger

This list does not include device-specific parameters such as carrier, branding, device/hardware, or manufacturer. Everything that an application needs to know about the device that it is running on is encoded via the resource qualifiers in the table above.

All resource directories, qualified and unqualified, live under the res / folder. Here are some guidelines on qualified resource directory names:

• You can specify multiple qualifiers, separated by dashes. For example, drawable-en-rUS-land will apply to US-English devices in landscape orientation.

• The qualifiers must be in the order listed in Table 2 above. For example:

0 0

Post a comment