• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Plz HELP!! Google Maps still display a GREY GRID in Android Emulator

hakerjack

Lurker
Oct 24, 2010
6
0
So I've read dozens of similar post on the web but none of them solve my problem. I just simply followed the tutorial on Android official website that creating a GoogleMap view, but I failed to display the map in the emulator but grey grids and blocks instead. I'm using my own Google API key in this case; the zoom function works fine, just I can't get the real map data through my code.

The following are my code and I highlight the lines you might think are essential for working correctly in this case.

main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0IX_ldMXFYCnjfT6q6CTGLcjvij7PsIX_E3ZW8A"
/>
</RelativeLayout>


AndroidMainfest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.learn2develop.GoogleMaps"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">

<uses-library android:name="com.google.android.maps" />

<activity android:name=".MapsActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>

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


</manifest>


MapsActivity.java
package net.learn2develop.GoogleMaps;

import android.os.Bundle;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;


public class MapsActivity extends MapActivity {
/** Called when the activity is first created. */

MapView mapView;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

mapView = (MapView) findViewById(R.id.mapView);
mapView.setBuiltInZoomControls(true);

}

@Override
protected boolean isRouteDisplayed() {
return false;
}

}

I found the default debug keystore eclipse is using is the one being auto-generated, not the one I used for acquiring my API key. Is that might be the problem?

Anyone who runs into the same problem before please helps me out!
 
Try to generate the md5 by keytool from your java jdk...
run cmd->keytool
-list -alias androiddebugkey -keystore "Location of the keystore" -storepass android -keypass android

My friend have the same problem with u because he wrong inserting api key...

Hope this help u bro

Hi dioni87, I believe I did generate the md5 by using the keytool under java/jdk***/bin folder, and I have my keystore file ("which named ".keystore" by default) located under my workspace folder. Is that a matter of where you keep your keystore file at?

Also could you explain those command at above you suggested me to type in? I'm not really good at command prompt...

Thanks!
 
Upvote 0
My friend is also experiencing the same problem with you, and I told him to repeat the decision-md5 fingerprint with the way above, and the result map appears.

If the application runs well on emulator but it does not appear on the map means the map was not referring to the google well ...

sorry if my language a bit difficult to understand
 
Upvote 0
My friend is also experiencing the same problem with you, and I told him to repeat the decision-md5 fingerprint with the way above, and the result map appears.

If the application runs well on emulator but it does not appear on the map means the map was not referring to the google well ...

sorry if my language a bit difficult to understand

Thanks, I can understand, and I solved the problem by using the Google debug key and it worked. Since I design my application for the research and won't go for release it is fine for me to use the debug key. I'll probably try the way you suggested some day. Thank you!:)
 
Upvote 0
i had it ,too.
this is my cmd prompt&#65306;c:\Program Files\Java\jdk1.6.0_24\bin>keytool -list -alias androiddebugkey -keystore "C:\Users\y\.android\debug.keystore" -storepass android -keypass android
i also got the fingerprint(md5) and went to the website (which is asking for Android Maps API Key) to receive the api key.
but it still appers grid without the map!!!
Does anyone know how to let the map appear?i'm so confused about it. thank you!
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones