1 / 23

手機與 PDA 行動裝置平台簡介

手機與 PDA 行動裝置平台簡介. 實驗介紹. 實驗目的 撰寫第一隻程式 “ Hello World” 從程式的撰寫到部署,瞭解手持裝置開發與一般電腦開發的差異性. 實驗環境. 開發環境 Eclipse 3.5 Android 2.0.1 JDK 6 以上. 實驗步驟. 首先打開 Eclipse 3.5 File → New→ Android Project. 專案初始畫面. Hello World. 撰寫“ Hello World” 程式 在模擬器中執行 情境: 出現“ Hello World” 字串. Step 1.

albina
Download Presentation

手機與 PDA 行動裝置平台簡介

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 手機與PDA行動裝置平台簡介

  2. 實驗介紹 • 實驗目的 • 撰寫第一隻程式 “Hello World” • 從程式的撰寫到部署,瞭解手持裝置開發與一般電腦開發的差異性

  3. 實驗環境 • 開發環境 • Eclipse 3.5 • Android 2.0.1 • JDK 6 以上

  4. 實驗步驟 • 首先打開 Eclipse 3.5 • File → New→ Android Project

  5. 專案初始畫面

  6. Hello World • 撰寫“Hello World”程式 • 在模擬器中執行 • 情境: • 出現“Hello World”字串

  7. Step 1 • 由工具箱中挑選適合的元件 • 打開路徑Hello Android \ res \ layout 的 main.xml (打開模擬畫面跟Views介面) • Views裡選擇TextView元件 • 將TextView拉至模擬畫面中佈置

  8. 選擇要用的元件

  9. 將元件拉進模擬畫面中佈置

  10. Step 2 • 撰寫觸發事件 • 打開路徑 Hello Android\src\my.hello.android.program 的 HelloAndroid.java • 撰寫程式碼 • 先帶入importandroid.widget.TextView; • TextView tv = new TextView(this); • tv.setText("Hello, Android!"); • setContentView(tv);

  11. Step 3 • 部署且執行 • Eclipse選單的Run / Run Configurations, • 請點選左邊方框中的Android Application, • Name的欄位填入專案的Application name, • Project欄位點選Browse選取Hello Android專案, • Launch Action欄位,選擇 • my.hello.android.program.HelloAndroid • 最後按Run [註] 模擬器執行較慢, 請耐心等待

  12. 模擬器執行畫面

  13. 發佈軟體 • 在撰寫程式並正確在模擬器上執行後 • 希望進一步將此程式發佈到PDA上

  14. 安裝檔 • 首先到Hello Android專案的目錄底下 • 打開bin的資料夾 • 看到的Hello Android.apk檔案即安裝檔 檔案名稱端視專案當初名稱

  15. Android 手機安裝APK檔案 • 先把接上USB掛載SD卡

  16. 在資料夾當中建立一 個APK資料夾,把APK檔放入

  17. 關閉USB儲存裝置,按設定>應用程式>未知來源打勾

  18. 安裝APK檔 • 利用檔案總管讀取放在SD卡中的APK檔,選擇安裝 • 安裝APK • APK的安裝就完成了

More Related