2013-04-24 30 views

回答

1

我最近更新可能和關注這個步驟,希望可以幫助您在短

step [1]更新您的sdk和檢查Google Play service

step [2]轉到SDK路徑就像C:\android-sdk-windows\extras\google 和導入谷歌Play業務Libray在workspace

step [3]在您的項目中添加library

step [4]在XML放像

<fragment 
     android:id="@+id/mapview" 
     android:name="com.google.android.gms.maps.SupportMapFragment" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_above="@+id/includefooter" 
     android:layout_below="@+id/relativetop" /> 

step [5]在活動像

public class YourActivi extends FragmentActivity { 
.... 
GoogleMap mapView; 

mapView = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mapview)).getMap(); 
} 

步[6]在清單

<permission 
     android:name="com.tixe.Activity.permission.MAPS_RECEIVE" 
     android:protectionLevel="signature" /> 
    <uses-feature 
     android:glEsVersion="0x00020000" 
     android:required="true" /> 
    <uses-permission android:name="YourPackage.permission.MAPS_RECEIVE" /> 
    <meta-data 
      android:name="com.google.android.maps.v2.API_KEY" 
      android:value="yourKey" /> 
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> 

還要檢查需要許可。

+0

感謝@ankitmakwana它工作並加載了地圖。 – 2013-04-24 10:38:43

相關問題