Resource types overview
Stay organized with collections
Save and categorize content based on your preferences.
Each page in this section describes the usage, format, and syntax for a certain type
of app resource
that you can provide in your project resources directory (res/
).
Here's a brief summary of each page:
- Animation resources
- Define pre-determined animations.
Tween animations are saved in res/anim/
and accessed from the R.anim
class.
Frame animations are saved in res/drawable/
and accessed from the R.drawable
class.
- Color state list resource
- Define a color resource that changes based on the
View
state.
Saved in res/color/
and accessed from the R.color
class.
- Drawable resources
- Define various graphics with bitmaps or XML.
Saved in res/drawable/
and accessed from the R.drawable
class.
- Layout resource
- Define the layout for your application UI.
Saved in res/layout/
and accessed from the R.layout
class.
- Menu resource
- Define the contents of your application menus.
Saved in res/menu/
and accessed from the R.menu
class.
- String resources
- Define strings, string arrays, and plurals and include string formatting and styling.
Saved in res/values/
and accessed from the R.string
, R.array
,
and R.plurals
classes.
- Style resource
- Define the look and format for UI elements.
Saved in res/values/
and accessed from the R.style
class.
- Font resources
- Define font families and include custom fonts in XML.
Saved in res/font/
and accessed from the R.font
class.
- More resource types
- Define other primitive values as static resources, including the following:
- Bool
- XML resource that carries a boolean value.
- Color
- XML resource that carries a hexadecimal color value.
- Dimension
- XML resource that carries a dimension value with a unit of measure.
- ID
- XML resource that provides a unique identifier for application resources and
components.
- Integer
- XML resource that carries an integer value.
- Integer array
- XML resource that provides an array of integers.
- Typed array
- XML resource that provides a
TypedArray
, which you can use
for an array of drawables.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Resource types overview\n\nEach page in this section describes the usage, format, and syntax for a certain type\nof [app resource](/guide/topics/resources/providing-resources)\nthat you can provide in your project resources directory (`res/`).\n\nHere's a brief summary of each page:\n\n[Animation resources](/guide/topics/resources/animation-resource)\n: Define pre-determined animations. \n\n Tween animations are saved in `res/anim/` and accessed from the `R.anim` class. \n\n Frame animations are saved in `res/drawable/` and accessed from the `R.drawable` class.\n\n[Color state list resource](/guide/topics/resources/color-list-resource)\n: Define a color resource that changes based on the `View` state. \n\n Saved in `res/color/` and accessed from the `R.color` class.\n\n[Drawable resources](/guide/topics/resources/drawable-resource)\n: Define various graphics with bitmaps or XML. \n\n Saved in `res/drawable/` and accessed from the `R.drawable` class.\n\n[Layout resource](/guide/topics/resources/layout-resource)\n: Define the layout for your application UI. \n\n Saved in `res/layout/` and accessed from the `R.layout` class.\n\n[Menu resource](/guide/topics/resources/menu-resource)\n: Define the contents of your application menus. \n\n Saved in `res/menu/` and accessed from the `R.menu` class.\n\n[String resources](/guide/topics/resources/string-resource)\n: Define strings, string arrays, and plurals and include string formatting and styling. \n\n Saved in `res/values/` and accessed from the `R.string`, `R.array`,\n and `R.plurals` classes.\n\n[Style resource](/guide/topics/resources/style-resource)\n: Define the look and format for UI elements. \n\n Saved in `res/values/` and accessed from the `R.style` class.\n\n[Font resources](/guide/topics/resources/font-resource)\n: Define font families and include custom fonts in XML. \n\n Saved in `res/font/` and accessed from the `R.font` class.\n\n[More resource types](/guide/topics/resources/more-resources)\n: Define other primitive values as static resources, including the following:\n\n [Bool](/guide/topics/resources/more-resources#Bool)\n : XML resource that carries a boolean value.\n\n [Color](/guide/topics/resources/more-resources#Color)\n : XML resource that carries a hexadecimal color value.\n\n [Dimension](/guide/topics/resources/more-resources#Dimension)\n : XML resource that carries a dimension value with a unit of measure.\n\n [ID](/guide/topics/resources/more-resources#Id)\n : XML resource that provides a unique identifier for application resources and\n components.\n\n [Integer](/guide/topics/resources/more-resources#Integer)\n : XML resource that carries an integer value.\n\n [Integer array](/guide/topics/resources/more-resources#IntegerArray)\n : XML resource that provides an array of integers.\n\n [Typed array](/guide/topics/resources/more-resources#TypedArray)\n : XML resource that provides a [TypedArray](/reference/android/content/res/TypedArray), which you can use\n for an array of drawables."]]