2

I'm trying to make a sample map app, but the map doesn't appear on screen like so:

Map on my screen

I'm following this example but I don't understand what is wrong so my map to look like this?

I've added the API key like this:

keytool -list -alias androiddebugkey -keystore debug.keystore \
        -storepass android -keypass android

All GPS and Internet permissions are added, and the device is connected to the internet.

4

5 Answers 5

6

Either:

  • you have the wrong android:apiKey, or

  • you do not have the INTERNET permission, or

  • your device or emulator does not have access to the Internet

    or, create new apikey for map and check.

2

if you are following the example that you posted, you should already have the INTERNET permission added to your code so it is either your android:apiKey or the emulator you are using does not have internet access so check that out

if is a problem with the apiKey this should sort it out http://informationideas.com/news/2008/11/06/getting-android-emulator-working-with-google-maps-api-key/

1
  • There was an problem with the apikey :)
    – Worker123
    May 9, 2012 at 11:35
0

see this complete example

also add following code to mains.xml

<com.google.android.maps.MapView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/mapview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:apiKey="----YOUR KEY----"
        android:clickable="true" />
0

You probably are signing the apk with a different certificate when debugging, than when exporting it. So you have to have two API keys from google, or you have to sign it with the same certificate, else the apikey is not generated with the correct certificate hash.

0

user the server API key instead of android API key.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.