January 2014
Intermediate to advanced
736 pages
70h 43m
English
As you build your app’s GUI and add resources (such as strings in the strings.xml file or views in the activity_main.xml file) to your app, the IDE generates a class named R that contains nested classes representing each type of resource in your project’s res folder. You can find this class in your project’s gen folder, which contains generated source-code files. The nested classes are declared static, so that you can access them in your code with R.ClassName. Within class R’s nested classes, the IDE creates static final int constants that enable you to refer to your app’s resources programmatically from your code (as we’ll discuss momentarily). Some of the nested classes in class R include:
• class drawable ...
Read now
Unlock full access