Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Google Maps API not working with debug.keystore
    primarykey
    data
    text
    <p>I am attempting to create a MapView application following the tutorial from the Android website <a href="http://developer.android.com/guide/tutorials/views/hello-mapview.html" rel="nofollow"><strong>here</strong></a>. I have got everything set up and the map displays but with empty tiles!</p> <p>The API key I'm using is generated from the debug.keystore located in <em>"C:\Users\Pete\.android"</em> and all of the correct permissions are set up in the manifest. The maps library is also in the manifest but it still doesn't work. I have tried creating a new debug keystore and placed it in the same folder (obviously also generating a new API key) and still no luck.</p> <p><strong>(30/05/2011) Edit:</strong></p> <p><strong>Manifest.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.stringerapps.testing.gps" android:versionCode="1" android:versionName="1.0"&gt; &lt;uses-sdk android:minSdkVersion="8" /&gt; &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;activity android:name=".Home" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;!-- import the library com.google.android.maps!!! --&gt; &lt;uses-library android:name="com.google.android.maps" /&gt; &lt;!-- permissions --&gt; &lt;uses-permission android:name="android.permission.INTERNET"&gt; &lt;/uses-permission&gt; &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"&gt; &lt;/uses-permission&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p><strong>layout.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mainlayout" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="api-key-here-omitted"/&gt; &lt;/RelativeLayout&gt; </code></pre> <p><strong>Home.xml</strong></p> <pre><code>package com.stringerapps.testing.gps; import java.util.List; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.widget.LinearLayout; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapView; import com.google.android.maps.Overlay; import com.google.android.maps.OverlayItem; public class Home extends MapActivity { LinearLayout linearLayout; MapView mapView; List&lt;Overlay&gt; mapOverlays; Drawable drawable; MyItemizedOverlay itemizedOverlay; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout); mapView = (MapView) findViewById(R.id.mapview); mapView.setBuiltInZoomControls(true); mapOverlays = mapView.getOverlays(); drawable = this.getResources().getDrawable(R.drawable.androidmarker); itemizedOverlay = new MyItemizedOverlay(drawable); GeoPoint point = new GeoPoint(19240000, -99120000); OverlayItem overlayitem = new OverlayItem(point, "", ""); GeoPoint point2 = new GeoPoint(35410000, 139460000); OverlayItem overlayitem2 = new OverlayItem(point2, "", ""); itemizedOverlay.addOverlay(overlayitem); itemizedOverlay.addOverlay(overlayitem2); mapOverlays.add(itemizedOverlay); } @Override protected boolean isRouteDisplayed() { return false; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload