iT邦幫忙

0

Android Studio 筆記─Google Map Api

麗麗 2017-02-17 17:22:4532724 瀏覽

1.開起Android Studio 建立新的專案
http://ithelp.ithome.com.tw/upload/images/20170217/20104541dvpkDM3HZJ.jpg
2.建立專案的時候請選擇google map的Activity
http://ithelp.ithome.com.tw/upload/images/20170217/20104541eg3TB4jZ0r.jpg
3.建立完成,先找google_maps_api.xml
http://ithelp.ithome.com.tw/upload/images/20170217/20104541HZ9HxammDi.jpg
4.看到上面的網址後直接複製貼到瀏覽器上
黃筆圈起來的部分,請原諒我畫的很亂QWQ,電腦課時間不足QAQ
http://ithelp.ithome.com.tw/upload/images/20170217/20104541LZTIBjcNDz.jpg
5.連上網頁後如果還沒建立過專案的可以選擇建立專案,有建立過的可以選擇之前建立的專案
http://ithelp.ithome.com.tw/upload/images/20170217/20104541NQmC9IrLSR.jpg
6.直接案建立google就會幫你自動建立好
http://ithelp.ithome.com.tw/upload/images/20170217/20104541CNJjYcksW6.jpg
7.建立api金鑰
http://ithelp.ithome.com.tw/upload/images/20170217/20104541JRQFm7gZzm.jpg
8.出現建立好的畫面後,按限制金鑰
http://ithelp.ithome.com.tw/upload/images/20170217/201045415wkJf3rdn4.jpg
9.金鑰限制點Android 應用程式
http://ithelp.ithome.com.tw/upload/images/20170217/20104541YSb4Mk0J2L.jpg
10.一般google會幫你自動填好套件名稱和SHA-1 憑證指紋
若沒有顯示,在google_maps_api.xml中可以找到,
看到這一行「 You can also add your credentials to an existing key, using this line:」
「套件名稱」(圖片中黃色的部分)就是「;」後的com.example.*****.maptest 每個人的名稱會依自己當初建立專案時有所改變
「SHA-1 憑證指紋」(圖片中綠色的部分)就是「;」前面的「D3:1F:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:D7:35」
http://ithelp.ithome.com.tw/upload/images/20170217/20104541apcUiTjbdC.jpg
11.複製下來貼到網頁上面就可以了
http://ithelp.ithome.com.tw/upload/images/20170217/20104541L0EzZZzr7Y.jpg
12.完成後將API金鑰複製下來(圖片中紫色的部分)
http://ithelp.ithome.com.tw/upload/images/20170217/20104541JhqQRd9bNy.jpg
13.看到google_maps_api.xml的這行「 YOUR_KEY_HERE」
http://ithelp.ithome.com.tw/upload/images/20170217/20104541WUW8OkxOp4.jpg
將「YOUR_KEY_HERE」刪除,貼上剛剛複製的API金鑰就完成了!:))
http://ithelp.ithome.com.tw/upload/images/20170217/20104541pNx8X1PdY7.jpg


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言