Decoding Resource Directory Names

Our app has a bunch of resource directories. Some have simple names, like drawable/ and layout/. Others have suffixes, like drawable-v24/ and mipmap-hdpi/.

The initial segment of the directory name — or the whole name for those that lack suffixes — usually indicates the type of the resource. There are many resource types in Android, and we will explore a few of them in this chapter. The exception is the values/ directory, which can contain a variety of smaller resource types, not just one “values” type.

The suffixes represent “resource sets”, and they indicate that this directory contains resources of a particular type that should only be used in certain scenarios. We call these scenarios “configurations”; the suffixes indicate what configurations those resources are used for.

For example:

We will explore these rules more later in the book, as they get fairly complex fairly quickly.


Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.