Lab Report
Course Name |
Mobile Internet development based on Android platform |
Date of experiment |
2016.3.25 |
Name of the experimental project |
Use of color, string resources |
Location of the experiment |
S3010 |
Type of experiment |
-Verification Type √ design type-comprehensive type |
Hours |
2 |
The purpose and requirements of the experiment (the knowledge points which are involved in this experiment and are required to be mastered) |
- Learn how to use color and string resources in Android.
- Understand how size and layout resources are used in Android.
|
second, the experimental environment (the hardware equipment and related software used in this experiment) |
(1) PC Machine (2) Operating system: Windows XP (3) Software: Eclipse, jdk1.6,android Sdk,adt |
Third, the contents and steps of the experiment |
- Create a project
- modifying string resources
- New Color Resource Color.xml
- Working with resource colors and string resources
- Use of dimensions and layout resources
|
Four, the experimental results (the experimental source program list and operating results or experimental conclusions, experimental design drawings) |
Resdemo Engineering Code 1,
<relativelayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http// Schemas.android.com/tools " android:layout_width=" match_parent " android:layout_height=" Match_parent " android:background= "@color/red_bg" android:paddingbottom= "@dimen/activity_vertical_margin" android:paddingleft= "@dimen/activity_horizontal_margin" android:paddingright= "@dimen/activity_horizontal_ Margin " android:paddingtop=" @dimen/activity_vertical_margin " tools:context=". Mainactivity "> <textview android:layout_width=" wrap_content " android:layout_height=" Wrap_ Content " android:layout_alignparenttop=" true " android:layout_centerhorizontal=" true " Android: layout_margintop= "67DP" android:text= "@string/hello_world" android:textcolor= "@color/textcolor" android:textsize= "30SP"/></relativelayout>
2.
<?xml version= "1.0" encoding= "Utf-8"?><resources> <color name= "RED_BG" > #00ffff </color > <color name= "TextColor" > #ff00ff </color> </resources>
Run Result: ()
Ziyuan Engineering Code 1.
<relativelayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http// Schemas.android.com/tools "android:layout_width=" match_parent "android:layout_height=" Match_parent "android:backg round= "@drawable/ic_launcher" android:paddingbottom= "@dimen/activity_vertical_margin" android:paddingleft= "@ Dimen/activity_horizontal_margin "android:paddingright=" @dimen/activity_horizontal_margin "android:paddingTop=" @ Dimen/activity_vertical_margin "tools:context=". Mainactivity "> <button android:id=" @+id/button1 "android:layout_width=" Wrap_content "Androi d:layout_height= "Wrap_content" android:layout_below= "@+id/textview1" android:layout_centerhorizontal= "true" android:text= "@string/cc"/> <textview android:id= "@+id/textview1" android:layout_width= "Wra P_content "android:layout_height=" Wrap_content "android:layout_alignparenttop=" true "Android:layout_c EnterhOrizontal= "true" android:layout_margintop= "41DP" android:text= "@string/gzcc" android:textsize= "24DP" /></relativelayout>
Run Result: ()
Five, Experimental summary (analysis of the results of the experiment, experience and improvement of experimental ideas) |
Through this experiment, relatively simple, complete more smoothly, you can learn more about the Android experiment color, the use of string resources, can be more flexible to apply this knowledge. |
Experiment 4 Experiment Report on the use of color and string resources