Search code examples
androidxmlr.java-file

why does android create the R.java file


why not just leave the data( strings.xml, main.xml ) in the .xml files? why convert it into the R.java?

it seems that android can read xml ( eg. androidmanifest.xml ). so why not just leave the strins.xml data and main.xml data in .xml form and send those xml's to the android device?

I am new ... maybe I will eventually see that there is a lot more in the R.java other than mere static variables that derived directly from those .xml's.

thanks, Shannon


Solution

  • so that you can easily reference you object that you have created in you layout, drawable and string files. this class represents all the resources that can be instantiated inside a code or can be used inside your coding