Introduction to Android Application Development: Android Essentials (Developer's Library) by Annuzzi Joseph Jr. & Darcey Lauren & Conder Shane

Introduction to Android Application Development: Android Essentials (Developer's Library) by Annuzzi Joseph Jr. & Darcey Lauren & Conder Shane

Author:Annuzzi, Joseph, Jr. & Darcey, Lauren & Conder, Shane [Annuzzi, Joseph, Jr.]
Language: eng
Format: azw3
Publisher: Pearson Education
Published: 2015-12-18T05:00:00+00:00


Table 13.1 Important Alternative Resource Qualifiers

Always try to include default resources—that is, those resources saved in directories without any qualifiers. These are the resources that the Android operating system will fall back on when no specific alternative resource matches the criteria. If you don’t, the system falls back on the closest matching resource based upon the directory qualifiers, which could be one that might not make sense.

Now that you understand how alternative resources work, let’s look at some of the directory qualifiers you can use to store alternative resources for different purposes. Qualifiers are tacked onto the existing resource directory name in a strict order, shown in descending order in Table 13.1.

Good examples of alternative resource directories with qualifiers are

res/values-en-rUS-port-finger/

res/drawables-en-rUS-land-mdpi/

res/values-en-qwerty/

Bad examples of alternative resource directories with qualifiers are

res/values-en-rUS-rGB/

res/values-en-rUS-port-FINGER-wheel/

res/values-en-rUS-port-finger-custom/

res/drawables-rUS-en/

The first bad example does not work because you can have only one qualifier of a given type, and this one violates that rule by including both rUS and rGB. The second bad example violates the rule that qualifiers (with the exception of the region) are always lowercase. The third bad example includes a custom attribute defined by the developer, but these are not currently supported. The last bad example violates the order in which the qualifiers must be placed: language first, then region, and so on.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.