實驗4 顏色、字串資源的使用

來源:互聯網
上載者:User

標籤:

課程名稱

基於Android平台移動互連網開發

實驗日期

2015.3.25

實驗項目名稱

實驗4 顏色、字串資源的使用

實驗地點

S30010

實驗類型

□驗證型    √設計型    □綜合型

學    時

2

一、實驗目的及要求(本實驗所涉及並要求掌握的知識點)

1,掌握Android中顏色和字串資源的使用方法。

2,理解Android中尺寸和布局資源的使用方法。

二、實驗環境(本實驗所使用的硬體裝置和相關軟體)

(1)PC機

(2)作業系統:Windows XP

(3)軟體: Eclipse, JDK1.6,Android SDK,ADT

三、實驗內容及步驟

      
  1. 建立工程
  2.   
  3. 修改字串資源
  4.   
  5. 建立顏色資源color.xml
  6.   
  7. 使用資源顏色和字串資源
  8.   
  9. 尺寸、布局資源的使用

四、實驗結果(本實驗來源程式清單及運行結果或實驗結論、實驗設計圖)

 

代碼:

String.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">shudu</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="main_title">Android shudu</string>
<string name="continue_label">Continue</string>
<string name="new_game_label">New Game</string>
<string name="about_label">About</string>
<string name="exit_label">Exit</string>
<string name="setting_title">Shudu setting</string>
<string name="setting_label">Setting...</string>
<string name="setting_shorcut">Shortcut</string>
<string name="music_title">Music</string>
<string name="music_summary">Play background music</string>
<string name="hints_title">Hints</string>
<string name="hints_summary">Show hints druing play</string>


<string name="new_game_title">Difficulty</string>
<string name="easy_label">Easy</string>
<string name="medium_label">Medium</string>
<string name="hard_label">Hard</string>
<string name="game_title">Game</string>
<string name="no_moves_label">No moves</string>
<string name="keypad_title">Keypad</string>
<string name="about_title">About Android Shudu</string>
<string name="about_text">\
Shudu is a logic-based number placement puzzle.
Starting with a partially completed 9x9 grid, the
objective is to fill the grid so that each
row, each column, and each of the 3x3 boxes
(also called <i>blocks</i>) contains the digits
1 to 9 exactly once.
</string>
<string name="login">登入</string>
<string name="register">註冊</string>

</resources>

 

color.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>

<color name="background">#ff2f4f4f</color>

<color name="puzzle_background">#ffe6f0ff</color>
<color name="puzzle_hilite">#ffffffff</color>
<color name="puzzle_light">#64c6d4ef</color>
<color name="puzzle_dark">#6456648f</color>
<color name="puzzle_foreground">#ff000000</color>
<color name="puzzle_hint_0">#64ff0000</color>
<color name="puzzle_hint_1">#6400ff80</color>
<color name="puzzle_hint_2">#2000ff80</color>
<color name="puzzle_selected">#64ff8000</color>


</resources>

 

 運行:

五、實驗總結(對本實驗結果進行分析,實驗心得體會及改進意見)

整體實驗進行的還是很順利的,因為能夠熟練的進行color.xml檔案的建造等等,還加了圖片,雖然效果一般般,但還是挺不錯的。

實驗評語

 

實驗成績

 

指導教師簽名:              年   月   日

           

實驗4 顏色、字串資源的使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.