Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a qualifer when making a new resource directory in android studio?

I am making the various drawable directories in an android studio project and it has the option of qualifiers. It has a list of available qualifiers and another area for chosen qualifiers.

What is a qualifier? How does it effect the project?

like image 335
Grez.Kev Avatar asked May 14 '15 00:05

Grez.Kev


People also ask

How to create a resource directory in Android Studio?

Step 1: Open your project and right click on res, t hen click “New”, then “Android resource directory”, Add Android resource directory: After that change the resource type to “menu” in the dropdown menu and then click “OK”. Change the resource type to menu:

How to specify alternative resources in Android Studio?

Android Specify Alternative Resources 1 Create a new directory in res/ named in the form -. 2 Save the respective alternative resources in this new directory. The resource files must be named exactly the same as the default resource files. See More....

What happens if you don't provide default resources for Android apps?

If you use a new resource qualifier, but maintain code compatibility with older versions of Android, then when an older version of Android runs your app, it will crash if you don't provide default resources, because it cannot use the resources named with the new qualifier.

What is configuration qualifier in Android Studio?

A configuration qualifier is a string that you can append to a resource directory in your Android project and specifies the configuration for which the resources inside are designed. To use a configuration qualifier: Create a new directory in your project's res/ directory and name it using the format: <resources_name>-<qualifier>.


1 Answers

What is a qualifier?

It is a constraint, indicating that the directory's worth of resources is targeting a particular certain devices and configurations.

So, for example:

  • res/layout/ is good for anything, but res/layout-land/ is for landscape orientations

  • res/values/ is good for anything, but res/values-fr/ is for French, and res/values-v11/ is good for devices running API Level 11 or higher

You can read more about resource set qualifiers in the documentation.

like image 66
CommonsWare Avatar answered Oct 16 '22 08:10

CommonsWare