Android Google Maps
-
Upload
byron-ewing -
Category
Documents
-
view
76 -
download
0
description
Transcript of Android Google Maps
Google Maps
• 取得 Google Map API
Step1: 先進入 JDK 目錄
Google Maps
• 透過 keytool.exe 建立認證指紋• 需要 debug_keystore 路徑
Google Maps• debug_keystore 路徑
Google Maps• 輸入 keytool –list –alias androiddebugkey –keystore
“C:\Documents and Settings\Administrator\.android\debug.keystore” –storepass android –keypass android
Google Maps
• 產生認證指紋
Google Maps
• 進入 Google Map API Key 申請頁面• http://code.google.com/intl/zh-Tw/android/
add-ons/google-apis/maps-api-signup.html
輸入認證指紋碼
Google Maps
• 進入 Google Map API Key 申請頁面• http://code.google.com/intl/zh-Tw/android/
add-ons/google-apis/maps-api-signup.html
Google Maps
• 產生出 API 金鑰
<com.google.android.maps.MapView android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="0O7bGO2vQxBc90bpYbJ8PnSjJapePPkrSGRvP3A" />
0O7bGO2vQxBc90bpYbJ8PnSjJapePPkrSGRvP3A
加入 main.xml
Google Maps
main.xml
Google Maps• 建立新專案 : HelloMaps
沒有 Google APIs target
Google Maps• 如果沒有 Google APIs target• 請選擇 Available packages 進行安裝
Google Maps• 安裝完 Google APIs target 畫面
Google Maps
• 建立新專案 : HelloMaps
顯示 Google Maps 地圖
改成 MapActivity
加入
加入
Google Maps
• AVD 也要對應具備 Google APIs 功能
Google Maps• 增加 <uses-permission
android:name="android.permission.INTERNET" />• 在 <application> 裡頭增加 <uses-library
android:name="com.google.android.maps" /> 資訊
Google Maps
不用註冊 Google Maps API 也可以使用 Intent
利用 Intent 玩 Google Maps
• 建立新專案 : IntentMaps
顯示 Google Maps 地圖
利用 Intent 玩 Google Maps
• AVD 也要對應具備 Google APIs 功能
利用 Intent 玩 Google Maps
• 增加 <uses-permission android:name="android.permission.INTERNET" />
利用 Intent 玩 Google Maps
更多 Google Maps
• 更多 Google Maps