Android Programming The Big Nerd Ranch Guide by Bill Phillips, Chris Stewart, Kristin Marsicano (z-lib.org)

(gtxtreme123) #1

Chapter 18  Localization


Configuration Qualifiers


You have now seen and used several configuration qualifiers for providing alternative resources:
language (e.g., values-es/), screen orientation (e.g., layout-land/), screen density (e.g., drawable-
mdpi/), and screen size (e.g., layout-sw600dp).


The device configurations for which Android provides configuration qualifiers to target resources are:



  1. mobile country code (MCC), optionally followed by mobile network code (MNC)

  2. language code, optionally followed by region code

  3. layout direction

  4. smallest width

  5. available width

  6. available height

  7. screen size

  8. screen aspect

  9. round screen (API level 23 and above)

  10. screen orientation

  11. UI mode

  12. night mode

  13. screen density (dpi)

  14. touchscreen type

  15. keyboard availability

  16. primary text input method

  17. navigation key availability

  18. primary non-touch navigation method

  19. API level


You can find descriptions of these characteristics and examples of specific configuration
qualifiers at developer.android.com/guide/topics/resources/providing-
resources.html#AlternativeResources.


Not all qualifiers are supported by earlier versions of Android. Luckily the system implicitly adds a
platform version qualifier to qualifiers that were introduced after Android 1.0. So if, for example, you
use the round qualifier, Android will automatically include the v23 qualifier, because round screen
qualifiers were added in API level 23. This means you do not have to worry about problems on older
devices when you introduce resources qualified for newer devices.

Free download pdf