IntelliJ IDEA 13.1.0 Web Help

Besides the standard way to create files and folders, you can create resource definitions right from the res node without looking for the relevant folder. IntelliJ IDEA detects the type and qualifier of the new resource and appoints the folder to save the resource definition file in. You can create separate resource definition files and entire folders.

In this section:

Creating a resource folder

IntelliJ IDEA composes the name for the new resource folder from the resource type and the qualifier you choose and creates a folder with this name under the res folder. The name is built in compliance with the Android naming conventions.

  1. In the Project tool window, select the res node where all Android resource definitions are stored.
  2. On the context menu, choose New | Android Resource Directory. The New Resource Directory dialog box opens.
  3. Specify the type of the resources to be stored in the new folder. From the Resource Type drop-down list, select the required type. The selected type is displayed in the Directory name read-only field.
  4. Do one of the following:
    • If your application does not need to be compatible with various Android devices and therefore no multiple screens support is required, just click OK.
    • To provide alternative resources, specify the resource qualifiers that determine the specific device configuration.
      • From the Available Qualifiers list, select the required qualifier, and click the icon_InsertReplace.gif button. The selected item is added to the Chosen qualifiers list. Depending on the particular qualifier, either specify its value manually or choose the required value from the drop-down list next to the Chosen qualifiers list.
      • To remove a qualifier, select it in the Chosen qualifiers list and click the icon_InsertReplace2.gif button.

      IntelliJ IDEA appends all the selected qualifiers to the resource type with a dash character as separator. The result is shown in the Directory name read-only field. Click OK.

    IntelliJ IDEA creates a new folder with the composed name under the res node.

Creating a resource definition file in the relevant resource folder
  1. In the Project tool window, select the res node where all Android resource definitions are stored.
  2. On the context menu, choose New | Android resource file. The New Resource File dialog box opens.
  3. Specify the name for the new resource definition file in the File name text box.
  4. Specify the resource type and qualifiers using the Resource type and Available qualifiers fields.

    Tip

    You can scroll through the list of resource types right from the File name text box by using the Up and Down keyboard keys.

  5. Click OK, when ready. IntelliJ IDEA composes the name of the relevant resource folder to save the new file in. The name is built from the specified resource type and the qualifier. in compliance with the Android naming conventions. If such folder already exists, IntelliJ IDEA saves the new file in it. If no such folder is found, IntelliJ IDEA creates it under the res folder and saves the new resource definition file there.

See Also

Reference:

Android:

Web Resources: