From be0cf70dc3ff77661dbdf416d415757f2500e889 Mon Sep 17 00:00:00 2001 From: Scott Main Date: Fri, 13 Jan 2012 11:13:13 -0800 Subject: docs: emphasize qualifier order and mention implicit version qualifer Change-Id: I6e1d174a27ccbdc5179bd3d06de0a69c17a5cfcc --- .../guide/topics/resources/providing-resources.jd | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'docs/html') diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd index 3a176e6..380791a 100644 --- a/docs/html/guide/topics/resources/providing-resources.jd +++ b/docs/html/guide/topics/resources/providing-resources.jd @@ -231,6 +231,9 @@ for which these resources are to be used (defined in table 2).

You can append more than one {@code <qualifier>}. Separate each one with a dash.

+

Caution: When appending multiple qualifiers, you must +place them in the same order in which they are listed in table 2. If the qualifiers are ordered +wrong, the resources are ignored.

  • Save the respective alternative resources in this new directory. The resource files must be named exactly the same as the default resource files.
  • @@ -254,20 +257,14 @@ screen density, but the filenames are exactly the same. This way, the resource ID that you use to reference the {@code icon.png} or {@code background.png} image is always the same, but Android selects the version of each resource that best matches the current device, by comparing the device -configuration information with the qualifiers in the alternative resource directory name.

    +configuration information with the qualifiers in the resource directory name.

    Android supports several configuration qualifiers and you can add multiple qualifiers to one directory name, by separating each qualifier with a dash. Table 2 lists the valid configuration qualifiers, in order of precedence—if you use multiple -qualifiers for one resource directory, they must be added to the directory name in the order they +qualifiers for a resource directory, you must add them to the directory name in the order they are listed in the table.

    -

    Note: Some configuration qualifiers were added after Android 1.0, -so not -all versions of Android support all the qualifiers listed in table 2. New qualifiers -indicate the version in which they were added. To avoid any issues, always include a set of default -resources for resources that your application uses. For more information, see the section about Providing the Best Device Compatibility with Resources.

    Table 2. Configuration qualifier names.

    @@ -752,6 +749,17 @@ href="#KnownIssues">Known Issues for more information.

    +

    Note: Some configuration qualifiers have been added since Android +1.0, so not all versions of Android support all the qualifiers. Using a new qualifier implicitly +adds the platform version qualifier so that older devices are sure to ignore it. For example, using +a w600dp qualifier will automatically include the v13 qualifier, because +the available-width qualifier was new in API level 13. To avoid any issues, always include a set of +default resources (a set of resources with no qualifiers). For more information, see the +section about Providing the Best Device Compatibility with +Resources.

    + + +

    Qualifier name rules

    Here are some rules about using configuration qualifier names:

    -- cgit v1.1