I am trying to get MapsDemo project that is shipped with Google add-ons to work. For that I got MD5 fingerprint of the default debug certificate and using that I generated MAPS API KEY and used it in the layout file. In the manifest file I have added all the permissions that are required by it. My manifest file looks like
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-sdk android:minSdkVersion="3" />
<application android:label="@string/activity_sample_code"
android:icon="@drawable/app_sample_code" >
<uses-library android:name="com.google.android.maps" />
<activity android:name="com.example.android.apis.MapsDemo" android:label="MapsDemo">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER"></category>
<action android:name="android.intent.action.MAIN"></action>
</intent-filter>
</activity>
<!-- ************************************* -->
<!-- VIEW/WIDGET PACKAGE SAMPLES -->
<!-- **********开发者_运维百科*************************** -->
<activity android:name="com.example.android.apis.view.MapViewDemo" android:label="MapView">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name="com.example.android.apis.view.MapViewCompassDemo" android:label="MapView and Compass">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
My maps layout file looks like
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0msDghc7PL9izft4M7VdAxRREci8JIZeBEULPvw"
/>
</LinearLayout>
But after all this, all I see is a blank gid screen. No maps are shown. Please help me in resolving this issue. What am i doing wrong here??
This I think google maps api v1 an it is already deprecated. It is now V2 visit https://developers.google.com/maps/documentation/android/ for the api documentation.
Also you can try this quick start guide https://docs.google.com/document/pub?id=19nQzvKP-CVLd7_VrpwnHfl-AE9fjbJySowONZZtNHzw
Enjoy. :-)
精彩评论