1

I am trying to load google map in mapview. I have inserted google API key in main.xml.

This is my manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="My.google.mao"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET" />

<uses-sdk android:minSdkVersion="7" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".GmapActivity"
        android:theme="@android:style/Theme.NoTitleBar"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <uses-library android:name="com.google.android.maps" />
</application>

</manifest>

This is main.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/mapview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clickable="true"
    android:apiKey="Api key"/>

//Api key has been inserted

Only boxes are being loaded in mapview, can anyone solve my problem?

Andrew Marshall
  • 95,083
  • 20
  • 220
  • 214
Alok Kumar
  • 671
  • 1
  • 6
  • 5

2 Answers2

1

Most likely reason is mixing up debug key and release key, as the signitures are different the keys are different, you need to get both. There is a post on programaticaly selecting the right key

Community
  • 1
  • 1
Ifor
  • 2,825
  • 1
  • 22
  • 25
0

This problem comes in 2 situations Give these uses permissons also Acces core location, access fine location

and one more thing is you ar enot given correct API key so generate properly tryagain,

That api key will work only in your system

If you have any problem with generating api key i will help you

Reddy
  • 140
  • 1
  • 5