0

is there a way to find out if i've generated a right API key ?

from the same debug.keystore i've managed to get Facebook HASH Key with no problems but from some reason after generating the MD5 fingerprint and generated an API key from Google my map is still blank.. which mean i can only see grids in it with no map..

my internet connection is on, and i have no error in my LogCat.. is there some kind of debugging i can do in order to check whether my API key is correct or not ?

XML:

<?xml version="1.0" encoding="utf-8"?> <com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" android:clickable="true" android:apiKey="my_generated_key"/> 

UPDATE: when running a new Test application it works great with my api key. when i'm trying to embedded the map inside my application (inside a tab host) i get only grid view.

5
  • Check your permissions maybe? Internet permission is needed for maps to function correctly. Commented Sep 6, 2012 at 16:39
  • the internet is on and the permission granted Commented Sep 6, 2012 at 16:42
  • Did you make sure that you got the MD5 sum and not the SHA-1? Just checking Commented Sep 6, 2012 at 16:56
  • And how does your xml look? Do you have this line: android:state_enabled="true" Commented Sep 6, 2012 at 16:57
  • i'm added it to my question, and the xml editor says that android:state_enabled="true" isn't vaild in maps Commented Sep 6, 2012 at 19:26

3 Answers 3

1

You should add in your XML like this:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" 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="api key" /> </RelativeLayout> 

if you don't have a layout, you are not able to see the map.

Sign up to request clarification or add additional context in comments.

7 Comments

But i see the map layout. but no map is loaded.. how come googles "Hello Maps" use map as root layout??
In "Hello Maps" is written that you open your layout/main.xml (in every you already have layout) and add a single MAPVIEW (means that you can't have more than one mapview) as the root NODE (A node can be an element node, an attribute node, a text node,...). Node is <com.google.android.maps.MapView......../> and it must stand in layout. In "Hello Maps", nowhere is written that you should use this note as a layout, just add it to your layout.
i do understand what it says a bit different but i will give it a try and update here
Did you try it? Look at this if you still have trouble: mobiforge.com/developing/story/using-google-maps-android
yep i've tried it.. still not working... i'm starting to freak out.. there are only 2 thing need to be done in order to run the map. INTERNET permission and API key.. i've done both of them and yet my map is not loading!
|
0

Make sure you got INTERNET permission set and that your key is really MD5. Newer version of keytool returns SHA1 key instead of MD5. To get MD5 add -v to keytool options

Comments

0

If you have a gray background in your project, make sure that you have permission INTERNET in your Manifest, just before application tag. If you getting gray background on your device, make sure that you have created a new Api key with new MD5 for your application, based on your created application.keystore, which you created when you exported your app.

If you haven't done that, see this link for better explanation: One Google Maps key for all developers?

If your LogCat is fine, and you don't even have red "Couldn't get connection factory client" your map key is fine. :) But even if you had this error in LogCat, that doesn't mean anything, because it could represent some bug in Eclipse and your map will still working, no matter that, in emulator and on real device.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.