1 / 8

基本功能與程序觀念

基本功能與程序觀念. 下載 / 上傳. App Inventor 原始檔是 .zip 壓縮檔 下載 於 My Projects 點選想要下載的檔案 ( 一次一個 ) More Actions -> Download Source 上 傳 More Actions -> Upload Source. 安裝到手機. Package for Phone Show Barcode: 一組二維條碼,該程式開發者才能下載 Download to this Computer: 將 . apk 檔案下載至電腦 Download to Connected Phone. 註解.

gitel
Download Presentation

基本功能與程序觀念

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. 基本功能與程序觀念

  2. 下載/上傳 • App Inventor原始檔是.zip壓縮檔 • 下載 • 於My Projects點選想要下載的檔案(一次一個) • More Actions -> Download Source • 上傳 • More Actions -> Upload Source

  3. 安裝到手機 • Package for Phone • Show Barcode: 一組二維條碼,該程式開發者才能下載 • Download to this Computer: 將.apk檔案下載至電腦 • Download to Connected Phone

  4. 註解 • 於想要註解的指令上按下右鍵 • 無法輸入中文 • 移除: • 除錯時無效化

  5. Screen元件屬性 • 自行新增的元件都包含於Screen • 執行時先載入Screen後再載入其他元件 • 主要負責初始化、回報錯誤碼、裝置握持方向改變及其他基本設定

  6. 事件event • Polling programming(浪費系統資源) • while(true) { • if(sensor(s1) == 1) {} • else {} • } • Event三要素 • 事件(Event): 發生的事件(ex.按下按鈕或放開) • 事件來源(Event Source): 引發事件的來源 • 事件監聽器(Event Listener): 監視可能會發生的事件,並做出對應的動作 事件監聽器 事件 事件來源

  7. Button1.setOnClickListener(new Button.OnClickListener() { • public void onClick(View v) { • Label1.setText(“Hello World!”); • } • });

  8. 副程式 • 經常性重複出現的程式片段可以寫成副程式 • 可以讓程式長度縮短 • 容易除錯 • 節省撰寫時間 • procedure與procedureWithResult • 範例: 面積計算 • 作業: 利用副程式的方式,輸入兩個數字,計算兩數字間所有值的總和

More Related