/res folder and subdirectories

Description

Resource files are stored in various subdirectories based on their type under /res folder.

Folder

Here are some important subdirectories in the /res folder and the types of resources they host:

  • anim: Compiled animation files
  • drawable: Bitmaps
  • layout: UI and view definitions
  • values: Arrays, colors, dimensions, strings, and styles
  • xml: Compiled arbitrary XML files
  • raw: Noncompiled raw files

Note

The resource compiler in the Android Asset Packaging Tool (AAPT) compiles all the resources except the raw resources and places them into the final .apk file.
apk stands for Android package.

This .apk file, which contains the Android application's code and resources, correlates to Java's .jar file.

The .apk file is what gets installed onto the device.

Naming

XML resource parser allows resource names such as hello-string, but you will see a compile-time error in R.java. You can fix this by renaming your resource hello_string.





















Home »
  Android »
    Android Basics »




Hello Android
Resources
Activity
Calendar
Camera
Contact
Content Provider
Database
Hardware
Intent
Location
Media
Network
Notification
Preference
Sensor
Service
SMS