Android - Maps not showing

I want to show google maps in an android app. show that I am doing the basic step as follows:

AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" /> 

maps.xml

 <view android:id="@+id/mv" class="com.google.android.maps.MapView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:clickable="true" android:apiKey="0cNoErXkpZDlKvCYr_OFj5xZD39-***********" /> 

and this can display the class method, import and onCreate

 import com.google.android.maps.GeoPoint; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import android.os.Bundle; 

onCreate () method for map classes

  public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.maps); mapView = (MapView)findViewById(R.id.mv); mapView.setSatellite(false); mapView.setTraffic(false); mapView.setBuiltInZoomControls(true); int maxZoom = mapView.getMaxZoomLevel(); int initZoom = maxZoom-2; mapControl = mapView.getController(); mapControl.setZoom(initZoom); latE6 = (int) (lat*1e6); lonE6 = (int) (lon*1e6); gp = new GeoPoint(latE6, lonE6); mapControl.animateTo(gp); overlayButton = (Button)findViewById(R.id.doOverlay); 

but why didn’t my card show, I only see a grid without maps, and when I try to read logcat, I see this error with yellow color

 Recycling dispatcher android_maps_conflict_a voidance.com.google.googlenav.datarequest.DataRequestDispatcher@ 40563470 

Please help me. thanks mate

+1
source share
2 answers

Are you sure your API key is correct? When the API key does not match, it displays a grid instead of a map.

Running the application from Eclipse directly on the emulator / the actual phone requires a different key, and then when you first create the .apk file and run it on the device.

+1
source

-If you have internet through a proxy, you will get a grid. -Use the default debug key store to generate the API key and try.

+1
source

All Articles