This example describes the usage of resource files in Android. Share to everyone for your reference, specific as follows:
Use of resource files between XML files
Reference format:
Attribute= "@[packagename:]resourcetype/resourceidentifier"
Example
There are Strings.xml, Color.xml, dimen.xml files, using the parameters in them
<?xml version= "1.0" encoding= "Utf-8"?> <linearlayout xmlns:android=
"http://schemas.android.com/" Apk/res/android "
android:orientation=" vertical "
android:layout_width=" fill_parent "
android:layout_" height= "Fill_parent"
android:padding= "@dimen/standard_border" >
<edittext android:id=
"@+id/ Myedittext "
android:layout_width=" fill_parent "
android:layout_height=" Wrap_content "
android: text= "@string/stop_message"
android:textcolor= "@color/opaque_blue"
/>
</LinearLayout>
Ii. resources for using the system
Use Android Local system resources to write this:
Copy Code code as follows:
Charsequence httperror = getString (Android. R.string.httperrorbadurl);
How to use in an XML file:
<edittext
android:id= "@+id/myedittext"
android:layout_width= "fill_parent"
android:layout_height = "Wrap_content"
android:text= @android: String/httperrorbadurl "
android:textcolor=" @android: color/ Darker_gray "
/>
Note that the Android prefix is added to the file that references the local resource.
For more information on Android-related content readers can view the site topics: "Android Resources Operating Skills Summary", "Android File Operating skills summary", "Android operation SQLite Database Skills Summary", " Android operations JSON format Data tips summary, "Android Database Operation skills Summary", "Android programming activity Operation Skills Summary", "Android programming development of SD card operation method Summary", "Android Development and advanced tutorial ", the Android View View tips Summary" and the Android Control usage summary
I hope this article will help you with the Android program.