Posted by Mina Samy
Why use Resources:
- The resources are bound to the application in a way that you can change them without needing to change the source code or recompile the application.
- The Android Generates an ID for each resource file so you can access them directly and easily. All the resources IDs are added to the R.Java file.
- When you use XML resource files, Android pareses these files automatically so you can reference values defined in them directly with no extra effort.
- Using resources is very useful in Localization and Internationalization of the application in case you develop multilingual applications. This includes not just the labels but it can include alignment, directions images or any kind of files.
- Strings, colors, arrays, dimensions. Defined in res/values/ directory. Using them is very useful in Localization and Internationalization.
- Images put in res/drawable directory. You can put all the images or icons you need in your application.
- Animations, defined in res/anime/ directory. You can define animations that for example correspond to a button click.
- XML, defined in res/xml/ directory for xml files containing your custom data.
- Layout resources, defined in res/layout/ for declaring the views that construct the user interface of the activities.