Android App Resources: Grouping Resource Types
Android App Resources: Grouping Resource Types
Android App Resources: Grouping Resource Types
These are additional files and static content that your code uses
o Example
bitmaps,
layout definitions,
user interface strings,
animation instructions
externalize app resources from your code to maintain them independently
We must provide alternative resources for specific device configurations
o At runtime, Android uses the appropriate resource based on the current
configuration.
o Example - provide a different UI layout depending on the screen size
Externalized app resources can be accessed by using resource IDs that are
generated in your project's R class.
MyProject/
src/
MyActivity.java
res/
drawable/
graphic.png
layout/
main.xml
info.xml
mipmap/
icon.png
values/
strings.xml
Resource directories supported inside project res/ directory.
xml/ Arbitrary XML files that can be read at runtime by calling Resources.getXML().
Various XML configuration files must be saved here.
font/ Font files with extensions such as .ttf, .otf, or .ttc, or XML files that include
a <font-family> element.
Example:-
Note:-