In Android Studio, the res directory is an important directory that contains various resources used by Android applications.
These resources include layouts, drawing assets, values, and more.
Here is a summary of the res directory and its subdirectories:
res/drawable:
This directory is for various drawable resources such as images, icons, and other graphics used in your app and all drawable file names must be small characters.
Example file name: ic_launcher.png
res/layout:
This directory contains XML layout files that define the structure and appearance of your app's user interface.
Each XML file corresponds to a specific screen or component within your app.
Example file: activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<!-- Design Here-->
</RelativeLayout>
res/values:
This
directory contains XML files for different types of values used in your
app, such as strings, colors, dimensions, styles, and more.
Example file: strings.xml
<?xml version="1.0" encoding="utf-8"?><resources>
<string name="app_name">NewTestProject</string>
<string name="hello_world">Hello, World!</string>
</resources>
Example file: colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>
res/mipmap:
This directory contains launcher icons for different screen densities
res/menu:
This directory contains XML files for menu items for your app.
Example file: main_menu.xml
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings"
android:title="Settings"
app:showAsAction="never" />
</menu>