建立Android新專案

Size: px
Start display at page:

Download "建立Android新專案"

Transcription

1 Android 智慧型手機程式設計 Android Google Maps 建國科技大學資管系饒瑞佶 2012/4 V1 2012/8 V2 2013/5 V3 V4 2014/10 v5

2 Google Maps Reference: _an_api_project 取得 Google Map API Step1: 先進入 JDK 目錄

3 Google Maps 透過 keytool.exe 建立認證指紋 SHA1 需要 debug_keystore 路徑 ( 每個作業系統位置不同 )

4 新版 IDE 已經列出 SHA1 碼 下一步驟用

5 重做一次認證 輸入 keytool -list -v -keystore "C:\Documents and Settings\Administrator\.android\debug.keystore 預設密碼是 android 來自 Eclipse 內的 default keystore 檔案位置要看作業系統

6 Google Maps 產生認證指紋 要的是 SHA1 編碼

7 Google Maps V1 進入 Google Map API Key 申請頁面 ( 不再使用 ) 目前不用 輸入認證指紋碼

8 Google Maps Android API Version 1 開發法 已經停用 新版 API 需要配合 Google Play Services

9 進入申請頁面 /tutorial#api_key 需要登入 Google

10 Google Maps 進入 Google Map API Key 申請頁面 Reference: 這裡有做法 _an_api_project

11

12 使用 SHA1 與 package Name

13 result

14 使用 API Key

15 首先將 API key 加入 AndroidManifest.xml <meta-data android:name="com.google.android.maps.v2.api_key" android:value="your_api_key"/>

16 加入使用權限

17 加入使用權限到 AndroidManifest.xml 改成自己的 package name <permission android:name="ctu.rcjao.helloandroid.permission.maps _RECEIVE android:protectionlevel="signature"/> <uses-permission android:name="ctu.rcjao.helloandroid.permission.maps _RECEIVE"/> 改成自己的 package name

18 加入使用權限到 AndroidManifest.xml

19 Use permission <uses-permission android:name="android.permission.internet"/> <uses-permission android:name="android.permission.access_network_state"/> <uses-permission android:name="android.permission.write_external_storage"/> <uses-permission android:name="com.google.android.providers.gsf.permission.read_gservices"/ > <!-- The following two permissions are not required to use Google Maps Android API v2, but are recommended. --> <uses-permission android:name="android.permission.access_coarse_location"/> <uses-permission android:name="android.permission.access_fine_location"/>

20 再加入 use-feature

21 uses-feature <uses-feature android:glesversion="0x " android:required="true"/>

22 最後加入地圖

23 Xml 檔案 加入下列 code <fragment xmlns:android=" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.supportmapfragment"/>

24 JAVA 程式 public class Map extends FragmentActivity protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.map); } }

25 執行 結果不能跑, 有錯誤!

26 打開 SDK 中的 SDK Manager, 找到 Extras 並安裝 Android Support Library 及 Google Play Services 兩個項目

27 匯入 Google Play Services 函式庫 File > Import > Android > Existing Android Code Into Workspace 路徑 : android-sdk\extras\google\google_play_services\libproject\google-play-services_lib

28 匯入完成

29 專案要加入這個 library

30 還有要開 google Maps Android API v2 不是 v3 這個喔!

31 執行 還是不行 最新版的還要再加上 <meta-data android:name="com.google.android.gms.version" />

32 執行 需要實體手機 過程中可能需要更新 Google Play

33 Google Maps 實體手機

34 發佈到 AVD2.2

35 AVD 設定 使用 SDK 4.0.3

36 Download Google Play Service APK 由 下載 < com.android.vending apk> 將下載的安裝到 AVD

37 有了, 但是還是不行!

38 設定模擬器顯示地圖 首先在模擬器中安裝 Google Play Service 修改 System 目錄之檔案權限, 允許寫入權限 adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system adb shell chmod 777 /system/app adb push GoogleLoginService.apk /system/app/ adb push GoogleServicesFramework.apk /system/app/ adb push Phonesky.apk /system/app/

39 adb install Maps_ apk adb install com.google.android.gms-3.apk Google Play Service 要夠新 漫長的等待.

40 如果出現要 update Google Play Service!

41 通常是失敗, 因為不支援線上更新 下載新的 APK 重裝就可以了 這裡我們裝 com.google.android.gms- APK4Fun.com.apk 如果無法安裝, 請先將 avd 內的 Google Play Services 移除

42 result 如果是灰底, 沒有地圖 1. 請檢查 API KEY 2. 請重新調整 AVD 參數, 例如放大 Internal Storage 或是 SD card size, 然後重新發布程式

43 在 Google Maps 上加標示 SDK 至少要 public class Main extends FragmentActivity { // 要顯示的座標 static final LatLng CTU = new LatLng( , ); private protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); // 取得地圖物件 map = ((MapFragment) getfragmentmanager().findfragmentbyid(r.id.map)).getmap(); // 建立紅色氣球標示 Marker mk = map.addmarker(new MarkerOptions().position(CTU).title(" 建國科技大學 ").snippet(" 資管系 ")); // 設定縮放大小是 16, 且將標示點放在正中央 map.movecamera(cameraupdatefactory.newlatlngzoom(ctu, 16)); } } 如果更早的 SDK 也要可以用 map = ((SupportMapFragment) getsupportfragmentmanager().findfragmentbyid(r.id.map)).getmap();

44 result

45 修改 UI 的 xml <LinearLayout xmlns:android=" android:layout_width="fill_parent" android:layout_height="fill_parent" 原地圖 android:orientation="vertical" > 設定 layout_weight <fragment android:layout_weight="1" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.supportmapfragment"/> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_weight="0" > <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" 地圖 " /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" 衛星 " /> </LinearLayout> </LinearLayout> 加入這段來切換地圖種類

46 result

47 Oncreate 中加入下列 code Button btn_normalview=(button)findviewbyid(r.id.button1); Button btn_satellitetview=(button)findviewbyid(r.id.button2); btn_normalview.setonclicklistener(new Button.OnClickListener() { public void onclick(view arg0) { map.setmaptype(googlemap.map_type_normal); // 顯示地圖模式 } }); btn_satellitetview.setonclicklistener(new Button.OnClickListener() { public void onclick(view arg0) { 星模式 } }); map.setmaptype(googlemap.map_type_satellite); // 顯示衛

48

49 地址轉座標功能將下列 code 加入 UI (fragment 前 ) <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_weight="0" > <EditText android:id="@+id/edittext1" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" > <requestfocus /> </EditText> <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=" 顯示 " /> <TextView android:id="@+id/textview1" android:text="" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout>

50 地址轉座標功能 Button btn_address_to_geo=(button)findviewbyid(r.id.button3); btn_address_to_geo.setonclicklistener(new Button.OnClickListener() { public void onclick(view arg0) { try { EditText inputaddress=(edittext)findviewbyid(r.id.edittext1); tv1=(textview)findviewbyid(r.id.textview1); Geocoder geocoder = new Geocoder(Main.this, Locale.getDefault()); List<Address> georesults = geocoder.getfromlocationname(inputaddress.gettext().tostring(), 5); while (georesults.size()==0) { georesults = geocoder.getfromlocationname(inputaddress.gettext().tostring(), 5); } if (georesults.size()>0) { Address addr = georesults.get(0); Double latitude = addr.getlatitude() * 1E6; Double longitude = addr.getlongitude() * 1E6; tv1.settext(latitude + "/" + longitude); } } catch (Exception e) { tv1.settext(" 轉換失敗 "); } } });

51 result 實機 模擬器

52 建立 showlocation 方法 // 顯示座標點 private void showloaction(double d,double e,string title, String snip){ LatLng CTU = new LatLng(d, e); // 取得地圖物件 map = ((SupportMapFragment) getsupportfragmentmanager().findfragmentbyid(r.id.map)).getm ap(); // 建立紅色氣球標示 Marker mk = map.addmarker(new MarkerOptions().position(CTU).title(title).snippet(snip)); // 設定縮放大小是 16, 且將標示點放在正中央 map.movecamera(cameraupdatefactory.newlatlngzoom(ctu, 16)); }

53 呼叫 showlocation 方法 showloaction( , ," 建國科技大學 "," 資管系 ");

54 呼叫 showlocation 方法 Button btn_address_to_geo=(button)findviewbyid(r.id.button3); btn_address_to_geo.setonclicklistener(new Button.OnClickListener() { public void onclick(view arg0) { try { EditText inputaddress=(edittext)findviewbyid(r.id.edittext1); tv1=(textview)findviewbyid(r.id.textview1); Geocoder geocoder = new Geocoder(Main.this, Locale.getDefault()); List<Address> georesults = geocoder.getfromlocationname(inputaddress.gettext().tostring(), 5); while (georesults.size()==0) { georesults = geocoder.getfromlocationname(inputaddress.gettext().tostring(), 5); } if (georesults.size()>0) { Address addr = georesults.get(0); Double latitude = addr.getlatitude() * 1E6; Double longitude = addr.getlongitude() * 1E6; tv1.settext(latitude + "/" + longitude); showloaction((double)(addr.getlatitude()), (double)(addr.getlongitude()),inputaddress.gettext().tostring(),""); } } catch (Exception e) { tv1.settext(" 轉換失敗 "); } } });

55 AVD 多數執行有問題, 最好使用手機測試 輸入地址 轉換地址成座標 座標 顯示座標點

56 不用註冊 Google Maps API 也可以 使用 Intent

57 顯示 Google Maps 地圖 public class MapIntent extends Activity protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); Uri uri=uri.parse("geo: , "); Intent it=new Intent(Intent.ACTION_VIEW,uri); startactivity(it); } }

58 利用 Intent 玩 Google Maps

59 Google Maps street view Uri uri=uri.parse("google.streetview:cbll= , &cbp=1,99.56,,1,- 5.27&mz=21"); 只支援美加地區 AVD 是看不到的!

60

61 更多 Google Maps 路徑規劃 Uri uri = Uri.parse(" f=d&saddr=startlat%20startlng&daddr=endlat%20endlng& hl=en"); Intent it = new Intent(Intent.ACTION_VIEW, uri); startactivity(it); //where startlat, startlng, endlat, endlng are a long with 6 decimals like:

62 整合 GPS

63 加入對應的 xml <LinearLayout xmlns:android=" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:text="" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <fragment android:layout_weight="1" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.supportmapfragment"/> </LinearLayout>

64 AndroidManiFest.xml 需要開放以下權限 <uses-permission android:name="android.permission.access_coarse_l OCATION"></uses-permission> <uses-permission android:name="android.permission.access_fine_loc ATION"></uses-permission>

65 偵測是否開啟 GPS private LocationManager mlocationmanager; // 如果沒有開啟 GPS mlocationmanager=(locationmanager)(this.getsystemservice(context. LOCATION_SERVICE)); if(mlocationmanager.isproviderenabled(locationmanager.gps_prov IDER) mlocationmanager.isproviderenabled(locationmanager.network_p ROVIDER)){ }else{ // 到系統開啟 GPS 與 WIFI 服務的畫面 startactivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS)); } // 如果沒有開啟 GPS

66 Android GPS 運作方式 使用 LocationManager: 判定是否有提供定位服務 ( 硬體 GPS 或 WIFI) 建立 LocationProvider, 設定定位參數, 並同時透過 LocationManager 取得座標 ( 硬體 軟體,GPS 或是 WiFi) 設定 LocationManager 的 Listener 事件, 偵測事件的改變 MapController 負責控制 Google Maps

67 GPS 訊號抓取主體 宣告 GPS 訊號擷取主體 沒有 GPS 時觸發

68 補充說明 mlocationmanager =(LocationManager)(this.getSystemService(Context.LOCATION_SERVICE)); if(mlocationmanager.isproviderenabled(locationmanager.gps_provider) mlocationmanager.isproviderenabled(locationmanager.network_provider)){ }else{ // 到達系統開啟 GPS 與 WIFI 服務的畫面 startactivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS)); } // 如果沒有開啟 GPS 啟動 GPS 如果沒有啟動使用 GPS 服務, 將跳至設定畫面 /* Provider 初始化 */ getlocationprivider(); 要求 GPS 提供服務 /* 設定事件的 Listener */ mlocationmanager.requestlocationupdates(mlocationprivider, 2000, 0, mlocationlistener); 設定 GPS 監聽服務 if(mlocation!=null) // 第一次顯示 { // 取得速度 double speed=mlocation.getspeed()/1000*60*60; // 原單位是 m/s double altitude = mlocation.getaltitude(); tv_show_gps.settext(" 緯度 :" + formatgeo(mlocation.getlatitude()) + " 經度 :" + formatgeo(mlocation.getlongitude()) + " 海拔 :" + altitude + " m 速度 :" + formatspeed(speed) + "km/h"); } TextView tv_show_gps; private ProgressDialog MyDialog; private String mlocationprivider=""; private Location mlocation; 宣告物件 如果有 GPS 訊號, 顯示到畫面上

69 tv_show_gps=(textview)findviewbyid(r.id.textview1); createcancelprogressdialog(" 定位中 "," 定位中.. 請稍待!"," 取消 "); try{ // 如果沒有開啟 GPS mlocationmanager =(LocationManager)(this.getSystemService(Context.LOCATION_SERVICE)); if(mlocationmanager.isproviderenabled(locationmanager.gps_provider) mlocationmanager.isproviderenabled(locationmanager.network_provider)){ }else{ // 到系統開啟 GPS 與 WIFI 服務的畫面 startactivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS)); } // 如果沒有開啟 GPS mlocationmanager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); // Provider 初始化 getlocationprivider(); // 設定 GPS 的 Listener mlocationmanager.requestlocationupdates(mlocationprivider, 2000, 0, mlocationlistener); if(mlocation!=null) // 第一次顯示 { // 取得速度 double speed=mlocation.getspeed()/1000*60*60; // 原單位是 m/s double altitude = mlocation.getaltitude(); tv_show_gps.settext(" 緯度 :" + formatgeo(mlocation.getlatitude()) + " 經度 :" + formatgeo(mlocation.getlongitude()) + " 海拔 :" + altitude + " m 速度 :" + formatspeed(speed) + "km/h"); }

70 }catch(exception e){ new AlertDialog.Builder(GPS.this).setTitle(" 系統訊息 ").setmessage(" 無法取得 GPS 座標 ").setpositivebutton(" 確認 ",new DialogInterface.OnClickListener() { public void onclick(dialoginterface dialog, int which) { // TODO Auto-generated method stub MyDialog.dismiss(); } }).show(); }

71 // 取得 LocationProvider public void getlocationprivider() { Criteria mcriteria01 = new Criteria(); mcriteria01.setaccuracy(criteria.accuracy_fine); mcriteria01.setaltituderequired(true); // 需要高度 mcriteria01.setbearingrequired(false); mcriteria01.setcostallowed(true); mcriteria01.setpowerrequirement(criteria.power_low); mlocationprivider = mlocationmanager.getbestprovider(mcriteria01, true); mlocation = mlocationmanager.getlastknownlocation(mlocationprivider); }

72 // 偵測位置改變 public final LocationListener mlocationlistener = new LocationListener() { public void onlocationchanged(location location) { // 取得速度 double speed=location.getspeed()/1000*60*60; // 原單位是 m/s double altitude = location.getaltitude(); tv_show_gps.settext(" 緯度 :" + formatgeo(location.getlatitude()) + " 經度 :" + formatgeo(location.getlongitude()) + " 海拔 :" + altitude + " m 速度 :" + formatspeed(speed) + "km/h"); MyDialog.dismiss(); // 結束進度 } public void onproviderdisabled(string provider) { } public void onproviderenabled(string provider) { } public void onstatuschanged(string provider,int status,bundle extras) { } }; // 偵測位置改變

73 // format GPS 座標的方法 public String formatgeo(double num) { NumberFormat formatter = new DecimalFormat("###.####"); String s=formatter.format(num); return s; } // format speed 的方法 public String formatspeed(double num) { NumberFormat formatter = new DecimalFormat("###.##"); String s=formatter.format(num); return s; }

74 // 按 BACK public void onbackpressed() { android.os.process.killprocess(android.os.process.mypid()); HelloGPSActivity.this.finish(); } // 產生定位中視窗 private void createcancelprogressdialog(string title, String message, String buttontext) { MyDialog = new ProgressDialog(this); MyDialog.setTitle(title); MyDialog.setMessage(message); MyDialog.setButton(buttonText, new DialogInterface.OnClickListener(){ public void onclick(dialoginterface dialog, int which){ // Use either finish() or return() to either close the activity or just the dialog android.os.process.killprocess(android.os.process.mypid()); HelloGPSActivity.this.finish(); return; } }); MyDialog.show(); // 顯示進度 }

75 透過 ddms 送出模擬 GPS 座標到 AVD 需要 <uses-permission android:name="android.permission.access_mock_location"/>

76

77 取得 GPS 訊號後, 將其顯示到 Google Maps 上

78 結合前面的 showloaction 方法 在 onlocationchanged 中加入呼叫 記得加入地圖 private GoogleMap map;

79 稍微修改 showloaction 方法 Marker mk=null; // 顯示座標點 private void showloaction(double d,double e,string title, String snip){ LatLng CTU = new LatLng(d, e); // 取得地圖物件 map = ((SupportMapFragment) getsupportfragmentmanager().findfragmentbyid(r.id.map)).getmap(); // 建立紅色氣球標示 if(mk!= null) mk.remove(); mk = map.addmarker(new MarkerOptions().position(CTU).title(title).snippet(snip)); // 設定縮放大小是 16, 且將標示點放在正中央 map.movecamera(cameraupdatefactory.newlatlngzoom(ctu, 16)); } 移除前一個氣球

80 result

81 控制旋轉不觸發 oncreate AndroidMainfast.xml 中設定允許改變 : <uses-permission android:name="android.permission.change_co NFIGURATION" /> AndroidMainfast.xml 中對要攔截旋轉事件的 Activity 加入屬性 : android:configchanges="orientation"

82 畫路徑 - 從現在的範例修改 LatLng p1; // 出發點 LatLng p2; // 結束點 加入成全域 加入第一個點 if(mlocation!=null) // 第一次顯示 { // 取得速度 double speed=mlocation.getspeed()/1000*60*60; // 原單位是 m/s double altitude = mlocation.getaltitude(); p1 = new LatLng(mLocation.getLatitude(), mlocation.getlongitude()); tv_show_gps.settext( 緯度 : + formatgeo(mlocation.getlatitude()) + " 經度 :" + formatgeo(mlocation.getlongitude()) + " 海拔 :" + altitude + " m 速度 :" + formatspeed(speed) + "km/h"); }

83 public void onlocationchanged(location location) { // 取得速度 double speed=location.getspeed()/1000*60*60; // 原單位是 m/s double altitude = location.getaltitude(); tv_show_gps.settext(" 緯度 :" + formatgeo(location.getlatitude()) + " 經度 :" + formatgeo(location.getlongitude()) + " 海拔 :" + altitude + " m 速度 :" + formatspeed(speed) + "km/h"); p2 = new LatLng(location.getLatitude(), location.getlongitude()); showloaction((double)(location.getlatitude()), (double)(location.getlongitude())," 目前 GPS 座標點 ",""); p1=p2; MyDialog.dismiss(); } // 結束進度 取得結束點畫線將結束點變成出發點

84 // 顯示座標點 private void showloaction(double d,double e,string title, String snip){ LatLng CTU = new LatLng(d, e); // 取得地圖物件 map = ((SupportMapFragment) getsupportfragmentmanager().findfragmentbyid(r.id.map)).getmap( ); // 建立紅色氣球標示 if(mk!= null) mk.remove(); 加入畫線 mk = map.addmarker(new MarkerOptions().position(CTU).title(title).snippet(snip)); // 設定縮放大小是 16, 且將標示點放在正中央 //map.movecamera(cameraupdatefactory.newlatlngzoom(ctu, 16)); PolylineOptions line=new PolylineOptions().add(p1,p2).width(5).color(Color.BLUE); map.addpolyline(line); map.movecamera(cameraupdatefactory.newlatlngzoom(p2, 16)); }

建立Android新專案

建立Android新專案 Android 智 慧 型 手 機 程 式 設 計 程 式 設 計 與 應 用 班 Android Google Maps 建 國 科 技 大 學 資 管 系 饒 瑞 佶 2012/4 V1 2012/8 V2 Google Maps Reference: http://developer.android.com/resources/tutorials/views/hello-mapview.html

More information

建立Android新專案

建立Android新專案 經濟部工業局 Android 智慧型手機程式設計實務應用班 Android WebService 建國科技大學資管系 饒瑞佶 2012/4 WebService 需要 ksoap2-android-assembly-2.5.2-jar-withdependencies.jar 或 ksoap2-android-assembly-2.5.2-jar-withdependencies_timeout1.jar

More information

Android Service

Android Service Android Service- 播放音樂 建國科技大學資管系 饒瑞佶 2013/7 V1 Android Service Service 是跟 Activity 並行 一個音樂播放程式若沒使用 Service, 即使按 home 鍵畫面離開之後, 音樂還是照播 如果再執行一次程式, 新撥放的音樂會跟先前撥放的一起撥, 最後程式就會出錯 執行中的程式完全看不到! 但是, 寫成 Service 就不同了

More information

主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new

主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new ListView 自訂排版 主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new int[]{r.drawable.dog1, R.drawable.dog2,

More information

Android Fragment

Android Fragment Android Fragment 建國科技大學資管系饒瑞佶 2017/10 V1 Android 3.0 後才支援 Fragment 解決部分 App 適應螢幕大小的問題 它類似於 Activity, 可以像 Activity 可以擁有自己的版面設計, 也和 Activity 一樣有自己的生命週期 ( 具備 oncreate() oncreateview() 與 onpause() 方法 ) LifeCycle

More information

單步除錯 (1/10) 打開 Android Studio, 點選 Start a new Android Studio project 建立專案 Application name 輸入 BMI 點下 Next 2 P a g e

單步除錯 (1/10) 打開 Android Studio, 點選 Start a new Android Studio project 建立專案 Application name 輸入 BMI 點下 Next 2 P a g e Android Studio Debugging 本篇教學除了最基本的中斷點教學之外, 還有條件式中斷的教學 條件式中斷是進階的除錯技巧, 在某些特定情況中, 我們有一個函數可能會被呼叫數次, 但是我們只希望在某種條件成立時才進行中斷, 進而觀察變數的狀態 而條件式中斷這項技巧正是符合這項需求 本教學分兩部分 單步除錯 (Page2~11, 共 10) 條件式中斷點 (Page12~17, 共 6)

More information

0511-Android程式之GPS應用_專題週記4

0511-Android程式之GPS應用_專題週記4 逢甲大學通訊工程學系專題研究 Android 程式之 GPS 應用 專題週記 0511 學生姓名 陳彥儒 D0035131 廖元譽 D0077791 指導老師 楊豐瑞老師繳交日期 2014.05.11 1 匯入 GoogleMap 1.1 取得授權步驟 目前進度 取得 Google 授權鑰匙 實作程式尚未成功 1.1.1 建立個人的 keystore 1.1.2 由個人的 keystore 查詢 SHA1

More information

res/layout 目录下的 main.xml 源码 : <?xml version="1.0" encoding="utf 8"?> <TabHost android:layout_height="fill_parent" xml

res/layout 目录下的 main.xml 源码 : <?xml version=1.0 encoding=utf 8?> <TabHost android:layout_height=fill_parent xml 拓展训练 1- 界面布局 1. 界面布局的重要性做应用程序, 界面是最基本的 Andorid 的界面, 需要写在 res/layout 的 xml 里面, 一般情况下一个 xml 对应一个界面 Android 界面布局有点像写 html( 连注释代码的方式都一样 ), 要先给 Android 定框架, 然后再在框架里面放控件,Android 提供了几种框架,AbsoluteLayout,LinearLayout,

More information

Dynamic Layout in Android

Dynamic Layout in Android Dynamic Layout in Android 建國科技大學資管系 饒瑞佶 2013/5 V1 Layout 多半都透過 res/layout/xml 格式設定來達成 Android 是 OOP, 所以可以動態產生 Layout 重點是 Layout 的階層關係 (Hierarchy) 需要處理對應事件 最後一樣用 setcontentview 加入 Layout 一 加入現有 Layout 中

More information

建立Android新專案

建立Android新專案 Android 智 慧 型 手 機 程 式 設 計 Android WebService 建 國 科 技 大 學 資 管 系 饒 瑞 佶 2012/4 V1 2012/8 V2 2013/5 V3 2014/10 v4 提 醒 這 節 的 內 容 針 對 的 是 MS 的 Web Service 或 是 使 用 SOAP(Simple Object Access Protocol) 標 準 建 立

More information

untitled

untitled JavaEE+Android - 6 1.5-2 JavaEE web MIS OA ERP BOSS Android Android Google Map office HTML CSS,java Android + SQL Sever JavaWeb JavaScript/AJAX jquery Java Oracle SSH SSH EJB+JBOSS Android + 1. 2. IDE

More information

Microsoft Word zw

Microsoft Word zw 第 1 章 Android 概述 学习目标 : Android Android Android Studio Android Android APK 1.1 1. 智能手机的定义 Smartphone 2. 智能手机的发展 1973 4 3 PC IBM 1994 IBM Simon PDA PDA Zaurus OS 1996 Nokia 9000 Communicator Nokia 9000

More information

Android + NFC

Android + NFC Android + NFC 建國科技大學資管系饒瑞佶 2017/3 v1 讀取 Tag UUID Android 2.3.3 (API Level 10) 才有支援完整的 NFC 功能 只要 NFC 相容都讀的到 (NFC 或 Mifare) 建立新專案修改 AndroidManifest.xml 加入 , 如果有 NFC Tag 進入感測範圍, 本 App 也會變成可處理的

More information

Android Android Android SDK iv

Android Android Android SDK iv Android Market Google Android SDK Apple Google Microsoft b2c b 2010 Internet Android how why iii Android 240... Android Android SDK iv Android Market Google Android SDK Visual C++ Java N-tier J2EE Unix/Linux

More information

RecyclerView and CardVew

RecyclerView and CardVew RecyclerView and CardView 建國科技大學資管系饒瑞佶 2017/10 V1 CardView CardView A CardView is a ViewGroup. Like any other ViewGroup, it can be added to youractivity or Fragment using a layout XML file. To create an

More information

用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應

用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應 專題進度 老師 : 趙啟時老師 學生 : 陳建廷 2013/10/13 用手機直接傳值不透過網頁連接, 來當作搖控器控制家電 ( 電視遙控器 ) 按下按鍵發送同時會回傳值來確定是否有送出 問題 :1. 應該是使用了太多 thread 導致在傳值上有問題 2. 一次按很多次按鈕沒辦法即時反應 程式碼 : package com.example.phone; import java.util.arraylist;

More information

實作SQLiteOpenHelper類別

實作SQLiteOpenHelper類別 SQLiteOpenHelper 類別存取 SQLite 建國科技大學資管系 饒瑞佶 2013/5 V1 Android 連結資料庫 MySQL SQL Server Web Service 遠端資料庫 Internet Intranet Android SQLite 單機資料庫 Android vs. SQLite 透過 SQLiteOpenHelper 類別來操作 建立資料庫 ( 建構子 ) 建立資料表

More information

Microsoft Word - PHP7Ch01.docx

Microsoft Word - PHP7Ch01.docx PHP 01 1-6 PHP PHP HTML HTML PHP CSSJavaScript PHP PHP 1-6-1 PHP HTML PHP HTML 1. Notepad++ \ch01\hello.php 01: 02: 03: 04: 05: PHP 06:

More information

Microsoft Word - AEL CH10

Microsoft Word - AEL CH10 序 從撰寫第一本 Android 2.x 手機程式開發教戰手冊 到此本 Android 5.x App 開發教戰手冊 歷經了 Android 四大版本 (2.x, 3.x, 4.x, 5.x),Android 系統也歷經了許多重大改變 : 系統的成長與改良 : 2.x 版僅支援手機, 而且操作流暢度差強人意 3.0 版開始支援平板, 但卻不支援手機, 苦了開發者要分別熟悉 2 套 API 4.0 版系統穩定性大幅提升,

More information

1: public class MyOutputStream implements AutoCloseable { 3: public void close() throws IOException { 4: throw new IOException(); 5: } 6:

1: public class MyOutputStream implements AutoCloseable { 3: public void close() throws IOException { 4: throw new IOException(); 5: } 6: Chapter 15. Suppressed Exception CH14 Finally Block Java SE 7 try-with-resources JVM cleanup try-with-resources JVM cleanup cleanup Java SE 7 Throwable getsuppressed Throwable[] getsuppressed() Suppressed

More information

Microsoft PowerPoint - 12 特色开发.ppt [兼容模式]

Microsoft PowerPoint - 12 特色开发.ppt [兼容模式] 手 机 应 用 平 台 软 件 开 发 12 特 色 开 发 刘 宁 Email:liuning2@mail.sysu.edu.cn Android 的 传 感 器 系 统 传 感 器 系 统 综 述 传 感 器 系 统 层 次 结 构 传 感 器 系 统 的 硬 件 抽 象 层 传 感 器 系 统 的 使 用 传 感 器 系 统 综 述 传 感 器 (Sensor) 系 统 可 以 让 智 能 手

More information

Microsoft Word - 第1章 Android基本概念.docx

Microsoft Word - 第1章 Android基本概念.docx Android 系 统 下 Java 编 程 详 解 作 者 : 华 清 远 见 第 1 章 Android 基 本 概 念 本 章 简 介 本 章 主 要 介 绍 Android 基 本 概 念 方 面 的 内 容, 包 括 Android 平 台 特 性 Android 系 统 架 构 Android 开 发 框 架 和 Android 开 发 环 境 搭 建 1.1 Android 简 介 Android

More information

Lecture01_Android介绍

Lecture01_Android介绍 移动平台应用软件开发 Android 介绍 主讲 : 张齐勋 zhangqx@ss.pku.edu.cn 移动平台应用软件开发 课程建设小组 北京大学 二零一七年秋北京 Android是什么 Android不仅仅是一个操作系统 它更是一个完整的软件框 架 Android基于Linux内核 2005年Google公司收购了Android公司 Google公司选择使用Apache许可证开放Android源码

More information

Microsoft PowerPoint - Lab 2-3 Android Google Maps.ppt [相容模式]

Microsoft PowerPoint - Lab 2-3 Android Google Maps.ppt [相容模式] 車輛定位與電子地圖整合服務 定位與 Google Maps Network Optimization Lab Department of Computer Science National Chiao Tung University 1 定位與 Google Maps Lab 簡介 : 路徑軌跡記錄程式 Google Maps 程式技巧 取得目前位置經緯度 建立 Google Maps 標示目前位置

More information

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入 100 年 特 種 考 試 地 方 政 府 公 務 人 員 考 試 試 題 等 別 : 三 等 考 試 類 科 : 資 訊 處 理 科 目 : 系 統 分 析 與 設 計 一 請 參 考 下 列 旅 館 管 理 系 統 的 使 用 案 例 圖 (Use Case Diagram) 撰 寫 預 約 房 間 的 使 用 案 例 規 格 書 (Use Case Specification), 繪 出 入

More information

Android 编程基础 Android 开发教程 & 笔记 1

Android 编程基础 Android 开发教程 & 笔记 1 Android 开发教程 & 笔记 1 多式样 ProgressBar 撰写 : 地狱怒兽 联系 :zyf19870302@126.com 普通圆形 ProgressBar 该类型进度条也就是一个表示运转的过程, 例如发送短信, 连接网络等等, 表示一个过程正 在执行中 一般只要在 XML 布局中定义就可以了

More information

Microsoft Word - 01.DOC

Microsoft Word - 01.DOC 第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的

More information

预览图 : (2) 在 SelectCity.java 中增加控件, 用于绑定 select_city 文件的 ListView, TextView,EditTest 等控件 代码和注释如下 :

预览图 : (2) 在 SelectCity.java 中增加控件, 用于绑定 select_city 文件的 ListView, TextView,EditTest 等控件 代码和注释如下 : EditText 实现城市搜索 1801210778 邹宇航 摘要 : 使用 EditText 实现搜索城市的功能, 以此为依据更新 ListView 1. 效果图 : 2. 主要步骤 (1) 在 select-city.xml 布局文件中中添加 EditText 控件用作搜索框, 然后添加 ListView 控件用来显示城市名字内容 代码如下 : 预览图 : (2) 在 SelectCity.java

More information

投影片 1

投影片 1 資料庫管理程式 ( 補充教材 -Part2) 使用 ADO.NET 連結資料庫 ( 自行撰寫程式碼 以實現新增 刪除 修改等功能 ) Private Sub InsertButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InsertButton.Click ' 宣告相關的 Connection

More information

中 文 摘 要 智 慧 型 手 機 由 於 有 強 大 的 功 能, 以 及 優 渥 的 便 利 性, 還 能 與 網 路 保 持 隨 時 的 鏈 結 與 同 步 更 新, 因 此 深 受 廣 大 消 費 者 喜 愛, 當 然, 手 機 遊 戲 也 成 為 現 代 人 不 可 或 缺 的 娛 樂 之

中 文 摘 要 智 慧 型 手 機 由 於 有 強 大 的 功 能, 以 及 優 渥 的 便 利 性, 還 能 與 網 路 保 持 隨 時 的 鏈 結 與 同 步 更 新, 因 此 深 受 廣 大 消 費 者 喜 愛, 當 然, 手 機 遊 戲 也 成 為 現 代 人 不 可 或 缺 的 娛 樂 之 臺 北 市 大 安 高 級 工 業 職 業 學 校 資 訊 科 一 百 零 一 學 年 度 專 題 製 作 報 告 ------ 以 Android 製 作 ------ ----- 連 線 塔 防 遊 戲 ------ Tower defense game using Internet technology 班 級 : 資 訊 三 甲 組 別 : A9 組 組 員 : 葉 冠 麟 (9906129)

More information

2 第 章 绪 论 Internet 2.0 使 得 消 费 型 电 子 产 品 用 户 可 以 通 过 多 种 不 同 的 数 据 网 络 访 问 互 联 网 内 容 用 户 可 以 使 用 便 携 式 消 费 型 电 子 设 备, 如 智 能 手 机 触 屏 平 板 电 脑 电 子 书, 甚 至

2 第 章 绪 论 Internet 2.0 使 得 消 费 型 电 子 产 品 用 户 可 以 通 过 多 种 不 同 的 数 据 网 络 访 问 互 联 网 内 容 用 户 可 以 使 用 便 携 式 消 费 型 电 子 设 备, 如 智 能 手 机 触 屏 平 板 电 脑 电 子 书, 甚 至 . Android 是 什 么 第 章 绪 论 2 3 本 章 将 主 要 介 绍 Android 操 作 系 统, 这 些 背 景 知 识 可 以 帮 你 更 好 地 理 解 本 书 的 内 容 你 将 了 解 到, 这 一 平 台 在 如 今 以 便 携 式 消 费 型 电 子 设 备 为 基 础 的 Internet 2.0 环 境 下 是 如 何 大 显 身 手 的 这 里 所 说 的 Internet

More information

Lecture01_Android介绍

Lecture01_Android介绍 移动平台应用软件开发 Android 介绍 主讲 : 张齐勋 zhangqx@ss.pku.edu.cn 移动平台应用软件开发 课程建设小组 北京大学 二零一八年秋北京 Android 是什么 Android 不仅仅是一个操作系统, 它更是一个完整的软件框架 Android 基于 Linux 内核 2005 年 Google 公司收购了 Android 公司 Google 公司选择使用 Apache

More information

Android + Google Maps

Android + Google Maps Android + Google Maps 建國科技大學資管系饒瑞佶 2017/3 V1 建立新 Android 專案 選擇 Google Maps Activity 專案建立後 檔案 google_maps_api.xml 內有申請 API Key 的網址 最後 API KEY 填入這 申請 API Key 建立憑證 完成 API KEY 建立 專案要用的 API Key 確認資訊 將 API

More information

3.1 num = 3 ch = 'C' 2

3.1 num = 3 ch = 'C' 2 Java 1 3.1 num = 3 ch = 'C' 2 final 3.1 final : final final double PI=3.1415926; 3 3.2 4 int 3.2 (long int) (int) (short int) (byte) short sum; // sum 5 3.2 Java int long num=32967359818l; C:\java\app3_2.java:6:

More information

建模与图形思考

建模与图形思考 C03_c 基 於 軟 硬 整 合 觀 點 JNI: 从 C 调 用 Java 函 数 ( c) By 高 煥 堂 3 How-to: 基 於 軟 硬 整 合 觀 點 从 C 调 用 Java 函 数 如 果 控 制 点 摆 在 本 地 C 层, 就 会 常 常 1. 从 本 地 C 函 数 去 调 用 Java 函 数 ; 2. 从 本 地 C 函 数 去 存 取 Java 层 对 象 的 属 性

More information

Microsoft Word - Lab_B_GPS與Google Maps 簡易開發_2.doc

Microsoft Word - Lab_B_GPS與Google Maps 簡易開發_2.doc Lab _B: GPS 與 Google 地圖簡易開發 張志宏 修平科技大學資訊管理系 Email: chchang@hust.edu.tw 陳文敬 修平科技大學資訊網路技術系 Email: jameschen@hust.edu.tw 實驗器材 PC Requirement: PC with Eclipse + Android SDK and ADT for Eclipse. Windows 7/XP

More information

chp6.ppt

chp6.ppt Java 软 件 设 计 基 础 6. 异 常 处 理 编 程 时 会 遇 到 如 下 三 种 错 误 : 语 法 错 误 (syntax error) 没 有 遵 循 语 言 的 规 则, 出 现 语 法 格 式 上 的 错 误, 可 被 编 译 器 发 现 并 易 于 纠 正 ; 逻 辑 错 误 (logic error) 即 我 们 常 说 的 bug, 意 指 编 写 的 代 码 在 执 行

More information

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1

More information

使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款

使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款 JAVA 程 序 设 计 ( 肆 ) 徐 东 / 数 学 系 使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款 使 用 Java class 代 表 保 险 箱 public class SaveBox 类 名 类 类 体 实 现 封 装 性 使 用 class SaveBox 代 表 保

More information

中南大学第二届软件创新大赛

中南大学第二届软件创新大赛 3D 全 息 投 影 游 戏 平 台 参 赛 项 目 计 划 书 一 参 赛 作 品 构 思 的 创 意 与 价 值 1. 背 景 : 问 题 领 域 (1) 手 机 平 台 游 戏 发 展 火 爆 随 着 移 动 设 备 和 移 动 互 联 网 的 飞 速 发 展, 手 机 已 经 成 为 人 们 日 常 生 活 中 的 伙 伴 越 来 越 多 手 机 游 戏 APP 成 为 了 人 们 放 松

More information

untitled

untitled 4.1AOP AOP Aspect-oriented programming AOP 來說 AOP 令 理 Cross-cutting concerns Aspect Weave 理 Spring AOP 來 AOP 念 4.1.1 理 AOP AOP 見 例 來 例 錄 Logging 錄 便 來 例 行 留 錄 import java.util.logging.*; public class HelloSpeaker

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Java application Java main applet Web applet Runnable Thread CPU Thread 1 Thread 2 Thread 3 CUP Thread 1 Thread 2 Thread 3 ,,. (new) Thread (runnable) start( ) CPU (running) run ( ) blocked CPU sleep(

More information

untitled

untitled 1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override

More information

Python a p p l e b e a r c Fruit Animal a p p l e b e a r c 2-2

Python a p p l e b e a r c Fruit Animal a p p l e b e a r c 2-2 Chapter 02 變數與運算式 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.2 2.2.1 2.2.2 2.2.3 type 2.2.4 2.3 2.3.1 print 2.3.2 input 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 + 2.4.6 Python Python 2.1 2.1.1 a p p l e b e a r c 65438790

More information

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit Tomcat Web JUnit Cactus JUnit Java Cactus JUnit 26.1 JUnit Java JUnit JUnit Java JSP Servlet JUnit Java Erich Gamma Kent Beck xunit JUnit boolean JUnit Java JUnit Java JUnit Java 26.1.1 JUnit JUnit How

More information

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc References (Section 5.2) Hsuan-Tien Lin Deptartment of CSIE, NTU OOP Class, March 15-16, 2010 H.-T. Lin (NTU CSIE) References OOP 03/15-16/2010 0 / 22 Fun Time (1) What happens in memory? 1 i n t i ; 2

More information

<4D6963726F736F667420576F7264202D20BBF9D3DA416E64726F6964C6BDCCA8B5C4B5E7D7D3C5C4C2F4CFB5CDB32E646F63>

<4D6963726F736F667420576F7264202D20BBF9D3DA416E64726F6964C6BDCCA8B5C4B5E7D7D3C5C4C2F4CFB5CDB32E646F63> 基 于 Android 平 台 的 电 子 拍 卖 系 统 摘 要 本 电 子 拍 卖 系 统 其 实 就 是 一 个 电 子 商 务 平 台, 只 要 将 该 系 统 部 署 到 互 联 网 上, 客 户 都 可 以 在 该 系 统 上 发 布 想 出 售 的 商 品, 也 可 以 对 拍 卖 中 的 商 品 参 与 竞 价 整 个 过 程 无 须 人 工 干 预, 由 系 统 自 动 完 成 本

More information

目 錄 版 次 變 更 記 錄... 2 原 始 程 式 碼 類 型 之 使 用 手 冊... 3 一 安 裝 軟 體 套 件 事 前 準 備... 3 二 編 譯 流 程 說 明... 25 1

目 錄 版 次 變 更 記 錄... 2 原 始 程 式 碼 類 型 之 使 用 手 冊... 3 一 安 裝 軟 體 套 件 事 前 準 備... 3 二 編 譯 流 程 說 明... 25 1 科 技 部 自 由 軟 體 專 案 原 始 程 式 碼 使 用 手 冊 Source Code Manual of NSC Open Source Project 可 信 賴 的 App 安 全 應 用 框 架 -App 應 用 服 務 可 移 轉 性 驗 證 Trusted App Framework -Transferability Verification on App MOST 102-2218-E-011-012

More information

FileMaker 16 ODBC 和 JDBC 指南

FileMaker 16 ODBC 和 JDBC 指南 FileMaker 16 ODBC JDBC 2004-2017 FileMaker, Inc. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker FileMaker Go FileMaker, Inc. FileMaker WebDirect FileMaker Cloud FileMaker,

More information

Microsoft Word - 02.目錄.doc

Microsoft Word - 02.目錄.doc 目錄 -1- 目錄 序 準備篇 一 使用說明... 0-2 二 標示說明... 0-6 三 注意事項... 0-7 第一類 Android 基礎知識 -UI 設計及語法應用 101. 整存整付計算機... 1-2 102. 電費計算機... 1-8 103. 點餐系統... 1-18 104. 計算 BMI 值... 1-23 105. MENU 功能選單... 1-36 106. 畫廊展示...

More information

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class 踩地雷遊戲 高慧君南港高中 開啟專案 MineSweep 任務一 : 產生 30X20 個磚塊編輯 Table 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.util.arraylist; Write a description of class MyWorld

More information

epub83-1

epub83-1 C++Builder 1 C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r 1.1 1.1.1 1-1 1. 1-1 1 2. 1-1 2 A c c e s s P a r a d o x Visual FoxPro 3. / C / S 2 C + + B u i l d e r / C

More information

1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6

1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6 www.brainysoft.net 1.JasperReport ireport...4 1.1 JasperReport...4 1.2 ireport...4 2....4 2.1 JDK...4 2.1.1 JDK...4 2.1.2 JDK...5 2.1.3 JDK...5 2.2 ant...6 2.2.1 ant...6 2.2.2 ant...6 2.3 JasperReport...7

More information

《大话设计模式》第一章

《大话设计模式》第一章 第 1 章 代 码 无 错 就 是 优? 简 单 工 厂 模 式 1.1 面 试 受 挫 小 菜 今 年 计 算 机 专 业 大 四 了, 学 了 不 少 软 件 开 发 方 面 的 东 西, 也 学 着 编 了 些 小 程 序, 踌 躇 满 志, 一 心 要 找 一 个 好 单 位 当 投 递 了 无 数 份 简 历 后, 终 于 收 到 了 一 个 单 位 的 面 试 通 知, 小 菜 欣 喜

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Fortran Algol Pascal Modula-2 BCPL C Simula SmallTalk C++ Ada Java C# C Fortran 5.1 message A B 5.2 1 class Vehicle subclass Car object mycar public class Vehicle extends Object{ public int WheelNum

More information

EJB-Programming-4-cn.doc

EJB-Programming-4-cn.doc EJB (4) : (Entity Bean Value Object ) JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Session Bean J2EE Session Façade Design Pattern Session Bean Session

More information

附录J:Eclipse教程

附录J:Eclipse教程 附 录 J:Eclipse 教 程 By Y.Daniel Liang 该 帮 助 文 档 包 括 以 下 内 容 : Eclipse 入 门 选 择 透 视 图 创 建 项 目 创 建 Java 程 序 编 译 和 运 行 Java 程 序 从 命 令 行 运 行 Java Application 在 Eclipse 中 调 试 提 示 : 在 学 习 完 第 一 章 后 使 用 本 教 程 第

More information

EJB-Programming-3.PDF

EJB-Programming-3.PDF :, JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Value Object Design Pattern J2EE Design Patterns Value Object Value Object Factory J2EE EJB Test Client

More information

雲端 Cloud Computing 技術指南 運算 應用 平台與架構 10/04/15 11:55:46 INFO 10/04/15 11:55:53 INFO 10/04/15 11:55:56 INFO 10/04/15 11:56:05 INFO 10/04/15 11:56:07 INFO

雲端 Cloud Computing 技術指南 運算 應用 平台與架構 10/04/15 11:55:46 INFO 10/04/15 11:55:53 INFO 10/04/15 11:55:56 INFO 10/04/15 11:56:05 INFO 10/04/15 11:56:07 INFO CHAPTER 使用 Hadoop 打造自己的雲 8 8.3 測試 Hadoop 雲端系統 4 Nodes Hadoop Map Reduce Hadoop WordCount 4 Nodes Hadoop Map/Reduce $HADOOP_HOME /home/ hadoop/hadoop-0.20.2 wordcount echo $ mkdir wordcount $ cd wordcount

More information

目 錄 一 ANDROID 開發系統需求 作業系統 開發工具... 1 二 安裝 ANDROID 開發工具 安裝 JDK 使用 APT-GET 安裝 使用套件管理程式安裝... 9 三 ANDROID 程式撰寫... 1

目 錄 一 ANDROID 開發系統需求 作業系統 開發工具... 1 二 安裝 ANDROID 開發工具 安裝 JDK 使用 APT-GET 安裝 使用套件管理程式安裝... 9 三 ANDROID 程式撰寫... 1 Android On Linux 簡易安裝開發教學 Installing Google Android SDK 2.0.1 On Ubuntu 9.10 Desktop 目 錄 一 ANDROID 開發系統需求... 1 1. 作業系統... 1 2. 開發工具... 1 二 安裝 ANDROID 開發工具... 1 1. 安裝 JDK... 1 2. 使用 APT-GET 安裝... 2 3. 使用套件管理程式安裝...

More information

内 容 提 要 将 JAVA 开 发 环 境 迁 移 到 Linux 系 统 上 是 现 在 很 多 公 司 的 现 实 想 法, 而 在 Linux 上 配 置 JAVA 开 发 环 境 是 步 入 Linux 下 JAVA 程 序 开 发 的 第 一 步, 本 文 图 文 并 茂 地 全 程 指

内 容 提 要 将 JAVA 开 发 环 境 迁 移 到 Linux 系 统 上 是 现 在 很 多 公 司 的 现 实 想 法, 而 在 Linux 上 配 置 JAVA 开 发 环 境 是 步 入 Linux 下 JAVA 程 序 开 发 的 第 一 步, 本 文 图 文 并 茂 地 全 程 指 内 容 提 要 将 JAVA 开 发 环 境 迁 移 到 Linux 系 统 上 是 现 在 很 多 公 司 的 现 实 想 法, 而 在 Linux 上 配 置 JAVA 开 发 环 境 是 步 入 Linux 下 JAVA 程 序 开 发 的 第 一 步, 本 文 图 文 并 茂 地 全 程 指 导 你 搭 建 Linux 平 台 下 的 JAVA 开 发 环 境, 包 括 JDK 以 及 集

More information

建模与图形思考

建模与图形思考 F06_c 观摩 :ContentProvider 基於軟硬整合觀點 架构與 DB 引擎移植方法 ( c) By 高煥堂 4 通用性基类 ContentProvider 基於軟硬整合觀點 的使用范例 刚才的范例里, 我们直接使用 DataPersist 类的接口来与 SQLite 沟通 本节将替 DataPersist 配上 ContentProvider 基类, 让 Client 能透过 ContentProvider

More information

Microsoft Word - ch04三校.doc

Microsoft Word - ch04三校.doc 4-1 4-1-1 (Object) (State) (Behavior) ( ) ( ) ( method) ( properties) ( functions) 4-2 4-1-2 (Message) ( ) ( ) ( ) A B A ( ) ( ) ( YourCar) ( changegear) ( lowergear) 4-1-3 (Class) (Blueprint) 4-3 changegear

More information

Microsoft Word - 第3章.doc

Microsoft Word - 第3章.doc 第 3 章 多个用户界面的程序设计 3.1 页面的切换与传递参数值 3.1.1 传递参数组件 Intent Intent 是 Android 系统的一种运行时的绑定机制, 在应用程序运行时连接两个不同组件 在 Android 的应用程序中不管是页面切换还是传递数据或是调用外部程序都可能要用到 Intent Intent 负责对应用中某次操作的动作 动作涉及的数据 附加数据进行描述, Android

More information

Android + WebService

Android + WebService Android + Web Service 建國科技大學資管系饒瑞佶 2017/3 V1 呼叫 OpenData Web Service http://data.taipei/opendata/datalist/apiaccess?scope=resourceaquire& rid=e7c46724-3517-4ce5-844f-5a4404897b7d http://data.taipei/opendata/datalist/apiaccess?scope=resourceaquir

More information

IoC容器和Dependency Injection模式.doc

IoC容器和Dependency Injection模式.doc IoC Dependency Injection /Martin Fowler / Java Inversion of Control IoC Dependency Injection Service Locator Java J2EE open source J2EE J2EE web PicoContainer Spring Java Java OO.NET service component

More information

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0,

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, http://debut.cis.nctu.edu.tw/~chi Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, : POSITIVE_INFINITY NEGATIVE_INFINITY

More information

建立Android新專案

建立Android新專案 Android 智慧型手機程式設計 Android SDK 工具 建國科技大學資管系饒瑞佶 2012/4 V1 2012/8 V2 2013/2 V3 2013/4 V4 2014/9 V5 Why Android SDK? 所有有關 Android 開發的管理工具是 SDK 在負責, 沒有 Eclipse 也沒關係 但是把所有東西 ( 寫程式 除錯 管理 ) 放到 Eclipse, 對開發上是比較方便的

More information

幻灯片 1

幻灯片 1 Delivering accurate maps to Chinese Android users 为中国安卓用户提供准确的地图服务 Work at Mapbox includes: Android apps, demos, starter kits, documentation, support, syncing Android team with other departments, etc.

More information

國立臺灣科技大學

國立臺灣科技大學 國 立 臺 灣 科 技 大 學 一 二 年 度 下 半 年 產 業 人 才 投 資 計 畫 碩 士 學 分 班 招 生 簡 章 承 辦 單 位 : 國 立 臺 灣 科 技 大 學 推 廣 教 育 中 心 ( 國 際 大 樓 206 辦 公 室 ) 地 址 :10607 臺 北 市 大 安 區 基 隆 路 四 段 43 號 網 址 :http://cec.ntust.edu.tw 洽 詢 電 話 :(02)2730-3230

More information

untitled

untitled PowerBuilder Tips 利 PB11 Web Service 年度 2 PB Tips PB9 EAServer 5 web service PB9 EAServer 5 了 便 web service 來說 PB9 web service 力 9 PB11 release PB11 web service 力更 令.NET web service PB NVO 論 不 PB 來說 說

More information

Microsoft PowerPoint - 03 开发入门.ppt [兼容模式]

Microsoft PowerPoint - 03 开发入门.ppt [兼容模式] 手 机 应 用 平 台 软 件 开 发 3 开 发 入 门 刘 宁 Email:liuning2@mail.sysu.edu.cn 课 程 简 介 课 程 目 标 Android 开 发 准 备 工 作 开 发 包 及 工 具 安 装 创 建 HelloWorld Android 程 序 设 计 基 础 创 意 移 动 应 用 创 意 移 动 应 用 创 意 移 动 应 用 创 意 移 动 应 用

More information

麻 省 理 工 學 院 是 在 西 元 2013 年 12 月 3 日 推 出 MIT App Inventor 2 網 站, 提 供 免 費 的 雲 端 服 務, 使 用 者 可 以 透 過 瀏 覽 器 來 開 發 Android 裝 置 應 用 程 式, 該 網 站 的 網 址 為 : http

麻 省 理 工 學 院 是 在 西 元 2013 年 12 月 3 日 推 出 MIT App Inventor 2 網 站, 提 供 免 費 的 雲 端 服 務, 使 用 者 可 以 透 過 瀏 覽 器 來 開 發 Android 裝 置 應 用 程 式, 該 網 站 的 網 址 為 : http 資 訊 學 科 中 心 6 月 份 電 子 報 用 MIT App Inventor2 程 式 拼 圖 來 開 發 Android 裝 置 應 用 程 式 李 啟 龍 學 習 Android 裝 置 程 式 設 計, 可 以 不 必 學 習 較 為 艱 澀 的 Java 語 法, 只 要 使 用 拼 圖 模 式 來 組 合 程 式, 就 可 以 完 成 Android 裝 置 的 應 用 程 式 MIT

More information

投影片 1

投影片 1 Chapter 11 Google 服務應用開發 Google 服務應用開發 Google 提供了許多免費服務, 例如搜尋引擎 Google Map Google 翻譯 Google 文件 Google 日曆 GMail Google Talk Youtube 等常見的服務,Google 擁有大量的資料以及對這些資料作分析的能力, 因此可以提供更多元的服務類型 在豐富的資源下將 Google 服務與

More information

<4D6963726F736F667420506F776572506F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074>

<4D6963726F736F667420506F776572506F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074> 程 序 设 计 实 习 INFO130048 3-2.C++ 面 向 对 象 程 序 设 计 重 载 继 承 多 态 和 聚 合 复 旦 大 学 计 算 机 科 学 与 工 程 系 彭 鑫 pengxin@fudan.edu.cn 内 容 摘 要 方 法 重 载 类 的 继 承 对 象 引 用 和 拷 贝 构 造 函 数 虚 函 数 和 多 态 性 类 的 聚 集 复 旦 大 学 计 算 机 科 学

More information

OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数

OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数 OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数 复习 类的复用 组合 (composition): has-a 关系 class MyType { public int i; public double d; public char c; public void set(double

More information

投影片 1

投影片 1 Chapter 13 Android 實戰演練 線上匯率查詢 線上匯率查詢 本節範例將實作一個簡單的線上費率查詢, 利用 Url 查詢台灣銀行的即時匯率, 欲查詢的網址為 http://rate.bot.com.tw/pages/static/uip003.zh- TW.htm 此網頁中每隔幾分鐘會更新一次匯率, 所以範例程式在一開啟時會抓取此網頁並將網頁內容解析後將匯率資料取出 線上匯率查詢 台灣銀行線上即時匯率查詢

More information

JavaIO.PDF

JavaIO.PDF O u t p u t S t ream j a v a. i o. O u t p u t S t r e a m w r i t e () f l u s h () c l o s e () public abstract void write(int b) throws IOException public void write(byte[] data) throws IOException

More information

( )... 5 ( ) ( )

( )... 5 ( ) ( ) 2016 大學校院招收大陸地區學生聯合招生委員會 71005 臺南市永康區南臺街 1 號 E-mail:rusen@stust.edu.tw WEB:http://rusen.stust.edu.tw TEL:+886-6-2435163 FAX:+886-6-2435165 2 0 1 6 0 1 1 9 2016... 2... 3... 5 ( )... 5 ( )... 5 1... 6 2...

More information

新版 明解C++入門編

新版 明解C++入門編 511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,

More information

Microsoft Word - ASM SDK 說明文件

Microsoft Word - ASM SDK 說明文件 System Monitor SDK (for Android) 開發者指南說明書 1. 技術項目簡介 經由簡化的應用程式介面 (Application Programming Interface), 可 提供給 Android 應用程式開發者開發基於 System monitor 的應用程式 2. 應用範圍說明 本技術可應用於具備 Android 系統 2.3.3 以上版本的 Android 嵌入式裝

More information

ebook 86-15

ebook 86-15 15 G t k + d e l e t e _ e v e n t G n o m e G n o m e 15.1 GnomeDialog G t k + G n o m e D i a l o g 15.1.1 G n o m e D i a l o g g n o m e _ d i a l o g _ n e w ( ) G N O M E _ D I A L O G ( d i a l

More information

Java 1 Java String Date

Java 1 Java String Date JAVA SCJP Java 1 Java String Date 1Java 01 Java Java 1995 Java Java 21 Java Java 5 1-1 Java Java 1990 12 Patrick Naughton C++ C (Application Programming Interface API Library) Patrick Naughton NeXT Stealth

More information

Android 开发教程

Android 开发教程 封面 1 文件存取编程基础 文件 文件可以用来存储比使用引用更大数量的数据 Android 提供方法来读 写文件 只有本地文件可以被访问 优点 : 可以存储大容量的数据 缺点 : 文件更新或是格式改变可能会导致巨大的编程工作 文件操作 读文件 Context.openFileInput(String name) 打开一个与应用程序联系的私有文件输入流 当文件不存在时抛出 FileNotFoundException

More information

2009年3月全国计算机等级考试二级Java语言程序设计笔试试题

2009年3月全国计算机等级考试二级Java语言程序设计笔试试题 2009 年 3 月 全 国 计 算 机 等 级 考 试 笔 试 试 卷 二 级 Java 语 言 程 序 设 计 ( 考 试 时 间 90 分 钟, 满 分 100 分 ) 一 选 择 题 ( 每 题 2 分, 共 70 分 ) 下 列 各 题 A) B) C) D) 四 个 选 项 中, 只 有 一 个 选 项 是 正 确 的 请 将 正 确 选 项 填 涂 在 答 题 卡 相 应 位 置 上,

More information

<4D6963726F736F667420576F7264202D2032303135BB4FC657A4E5A4C6BEC7B34EACE3B051B77CC4B3B57BAAED2E646F6378>

<4D6963726F736F667420576F7264202D2032303135BB4FC657A4E5A4C6BEC7B34EACE3B051B77CC4B3B57BAAED2E646F6378> 澎湖馬公市西衛聚落發展與維生方式的變遷 王惠君 國立高雄師範大學地理系碩士生/文光國中教師 摘要 本研究欲了解西衛先民選址並拓墾西衛聚落的原因 並釐清西衛聚落人口 戶數增 加的影響因素 以及探討西衛聚落範圍的發展 西衛王姓開澎祖來澎湖定居時間點較晚 故僅能選擇農耕條件不太佳的西衛 同時 基於安全 選擇身為軍事防衛之地的西衛來開墾 又因生存需求 往海上發展漁業 而 西衛舊聚落僅有現在為西衛漁港的海岸為灣澳地形

More information

AL-M200 Series

AL-M200 Series NPD4754-00 TC ( ) Windows 7 1. [Start ( )] [Control Panel ()] [Network and Internet ( )] 2. [Network and Sharing Center ( )] 3. [Change adapter settings ( )] 4. 3 Windows XP 1. [Start ( )] [Control Panel

More information

题目

题目 开发 Android 应用 目的 : 帮助大家了解 Android 平台开发 作者 : 王威威 技术爱好 : linux,qt, 嵌入式开发 MSN : wangweiweicdma@hotmail.com Email : wang.weiwei1@ztenc.com.cn wangjiecdma@126.com 下载开发资源 1 下载最新的 Android SDK http://code.google.com/android/download.html

More information

Microsoft Word - A201103-528_1299547322.doc

Microsoft Word - A201103-528_1299547322.doc 5 10 15 20 25 30 基 于 Android 平 台 的 人 机 交 互 的 研 究 与 实 现 郁 亚 男 ( 北 京 邮 电 大 学 软 件 学 院, 北 京 100876) 摘 要 : 随 着 计 算 的 发 展, 计 算 变 得 越 来 越 自 由, 在 资 源 使 用 方 面 也 越 来 越 灵 活 移 动 终 端 由 于 无 线 通 信 网 络 传 输 速 率 的 提 高,

More information

4.1 AMI MQSeries API AMI MQI AMI / / AMI JavaC C++ AMI / AMI AMI - / /

4.1 AMI MQSeries API AMI MQI AMI / / AMI JavaC C++ AMI / AMI AMI - / / 4 AMI AMI AMI SC345604 89 4.1 AMI MQSeries API AMI MQI AMI / / AMI JavaC C++ AMI / AMI AMI - / / 91 41-90 41 AMI - AMI - - API MQI MQSeries MQI AMI IBM 91 MQSeries REPOSITORY AMI AMI AMI XML Windows AMI

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 310-055Big5 Title : Sun Certified Programmer for the Java 2 Platform.SE 5.0 Version : Demo 1 / 22 1. 11. public static void parse(string str)

More information

FileMaker 15 ODBC 和 JDBC 指南

FileMaker 15 ODBC 和 JDBC 指南 FileMaker 15 ODBC JDBC 2004-2016 FileMaker, Inc. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker FileMaker Go FileMaker, Inc. / FileMaker WebDirect FileMaker, Inc. FileMaker

More information

<4D6963726F736F667420576F7264202D20C8EDC9E82DCFC2CEE7CCE22D3039C9CF>

<4D6963726F736F667420576F7264202D20C8EDC9E82DCFC2CEE7CCE22D3039C9CF> 全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 考 试 2009 年 上 半 年 软 件 设 计 师 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 请 按 下 述 要 求 正 确 填 写 答 题 纸 1. 在 答 题 纸 的 指 定 位 置 填 写 你 所 在 的 省 自 治 区 直 辖 市 计 划 单 列 市 的 名 称 2. 在 答

More information

第一章 Android 简介与开发环境搭建

第一章 Android 简介与开发环境搭建 安卓开发环境与常用布局 第一章 Android 简介与开发环境搭建 本章目标 3G 的概念 Android 的改变 Android 开发环境的搭建编写第一个 Android 程序 Android 程序的目录结构 手机发展史 1. 3G 的概念 3G 全称为 :3rd Generation, 中文含义即为第三代数字通信, 是指将无线通信与国际互联网等多媒体通信结合的新一代移动通信系统 2. 符合 3G

More information

INTRODUCTION TO COM.DOC

INTRODUCTION TO COM.DOC How About COM & ActiveX Control With Visual C++ 6.0 Author: Curtis CHOU mahler@ms16.hinet.net This document can be freely release and distribute without modify. ACTIVEX CONTROLS... 3 ACTIVEX... 3 MFC ACTIVEX

More information

D C 93 2

D C 93 2 D9223468 3C 93 2 Java Java -- Java UML Java API UML MVC Eclipse API JavadocUML Omendo PSPPersonal Software Programming [6] 56 8 2587 56% Java 1 epaper(2005 ) Java C C (function) C (reusability) eat(chess1,

More information

Swing-02.pdf

Swing-02.pdf 2 J B u t t o n J T e x t F i e l d J L i s t B u t t o n T e x t F i e l d L i s t J F r a m e 21 2 2 Swing C a n v a s C o m p o n e n t J B u t t o n AWT // ToolbarFrame1.java // java.awt.button //

More information

RUN_PC連載_12_.doc

RUN_PC連載_12_.doc PowerBuilder 8 (12) PowerBuilder 8.0 PowerBuilder PowerBuilder 8 PowerBuilder 8 / IDE PowerBuilder PowerBuilder 8.0 PowerBuilder PowerBuilder PowerBuilder PowerBuilder 8.0 PowerBuilder 6 PowerBuilder 7

More information