user1132265
user1132265

Reputation: 37

Google Map not showing in android Emulator

I am trying to show Google map in android emulator but there's only gray grids. Following are my manifest, XML and activity code. Also I am getting error that Couldn't get connection factory client.

Here is my Manifest I have included internet permission:

?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.maptry"
android:versionCode="1"
android:versionName="1.0" >

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

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <uses-library android:name="com.google.android.maps" />
    <activity
        android:name=".Maap_tryActivity"
        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>

</manifest>

XML LAYOUT

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

  <com.google.android.maps.MapView
             android:id="@+id/mapview"
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
             android:clickable="true"
             android:enabled="true"
             android:apiKey="0l4sCTTyRmXTNo7k8DREHvEaLar2UmHGwnhZVHQ"
             />
</LinearLayout>

Activity:

package com.android.maptry;

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

import android.os.Bundle;

public class Maap_tryActivity extends MapActivity {
/** Called when the activity is first created. */
@Override
 public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.main);
     MapView mapView = (MapView) findViewById(R.id.mapview);
     mapView.setBuiltInZoomControls(true);
    }

@Override
protected boolean isRouteDisplayed() {
    // TODO Auto-generated method stub
    return false;
}
}

Please help me on this.

Upvotes: 1

Views: 5192

Answers (2)

Shishir Shetty
Shishir Shetty

Reputation: 2049

Refer to this link:

Probably the best lick for Google Maps in Android:

http://mobiforge.com/developing/story/using-google-maps-android

Follow its initial tutorials carefully for signing keystore.

Upvotes: 1

Fergers
Fergers

Reputation: 583

Have you signed your own keystore to get a api key? Because if you didnt to that (the right way) then it only shows a grid of the map.

More info here

Upvotes: 1

Related Questions