What are resources? Resources include text strings, images and icons, audio files, videos, and other data used by the application. Whatever resources are allocated each one get some address and get auto generated in R.java file. Android resource files are stored separately from the java class files. You can also store raw data files and graphics as resources. Explain following resources with example Here one resource is explained. In which way you can explain all resource as per markes. String resources: Use o Use to store string value. Directory o /res/values/string.xml Xml tag o
value Accessing String value in following two way: o XML file code
First Application
o Java file code TextView tv = new TextView(); Tv.setText(getResources().getString(“app_name”).toString());
OR
Prof. Jasmin Jasani
jjasani.com
[email protected]