Android Resources

In this tutorial you will learn about the Android Resources and its application with practical example.

Apart from coding there are many items which are used to develop a good Android Application, That all items are Resources like bitmaps, colors, strings , animation and many more. These resources are maintained in various sub-directories under res/ directory of the project.

res01

Resource Types

Animation Resources : It define pre-define animations. Tween animations are saved in res/anim/ and accessed from the R.anim class, where Frame Animation are saved in res/drawable/ and accessed from the R.drawable class.

anim1

Color State List Resources : It define color resources that changes based on the View state. It contains list of colors. Colors are saved in res/color/ and accessed from the R.color class.

colors

Drawable Resources : It defines various graphics with bitmap , It contains Image files like .png, .jpg , .gif and XML files. That all are saved in res/drawable/ and accessed from the R.drawable class.

drawable

Layout Resources : It define a user interface layout. It is saved in res/layout and accessed from R.layout class.

xml

Menu Resources : It define contents of your application menus, like Options Menu, Context Menu etc. All menu XML files saved into res/menu/ and accessed from the R.menu class.

menures

String Resources : It define string , string array and plurals. All are saved in res/values/ and accessed from R.string, R.array and R.plurals.

stringsres

 

Style Resource : It defines look and format for UI elements. It is saved in res/style/ and accessed from the R.style class.

styleres

Values Resources: It contains values such as Booleans,integers, strings, dimensions , colors .That all are saved in res/values/ but accessed in different ways like R.bool for Booleans, R.dimen for dimensions etc.

valuesres

In this tutorial we have learn about the Android Resources and its application with practical example. I hope you will like this tutorial.