Experiment 4 Experiment Report on the use of color and string resources

Source: Internet
Author: User

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)

  1. Learn how to use color and string resources in Android.
  2. 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

  1. Create a project
  2. modifying string resources
  3. New Color Resource Color.xml
  4. Working with resource colors and string resources
  5. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.