Google Maps Android API v2官網例子使用說明

1.安裝Google Play services SDK
Google Maps SDK已經做爲Google Play services SDK的一部分,因此首先要安裝Google Play services SDK,Eclipse->android sdk manager->Extra文件夾下選中google play service安裝
android

2.將Google Play services 做爲library工程導入
(1) File > Import > Android > Existing Android Code Into Workspace and click Next.(2)Browse..., enter <android-sdk-folder>/extras/google/google_play_services/libproject/google-play-services_lib, and click Finish.
(3)右擊工程文件選擇properties->Android->拖動滾動條向下直到看到is Library選擇

api

3.導入官網的maps例子工程
(1)File > Import > Android > Existing Android Code Into Workspace and click Next
app

(2)Browse..., enter <android-sdk-folder>/extras/google/google_play_services/samples/maps, and click Finish.
(3)Project > Properties, select Java Build Path, and navigate to Libraries.
(4)Select Add External Jars, include the following jar files, and click OK: + <android-sdk-folder>/extras/android/compatibility/v4/android-support-v4.jar
(5)在AndroidManifest.xml文件中添加你本身的 Google Maps Android API key.
ui

<meta-data     android:name="com.google.android.maps.v2.API_KEY"     android:value="API_KEY"/>

(6)Run > Run to test the sample app.
相關文章
相關標籤/搜索