user1161960
user1161960

Reputation: 90

google map was not displayed in android emulator

here is the XML file :

<com.google.android.maps.MapView
                 android:layout_width="fill_parent"
                 android:layout_height="fill_parent"
                 android:apiKey="0q7NUYm4bgzeXlqXtKYVPJDRWUJmt8Cu0gvbWMx"
                  android:id="@+id/map_view"
                 />

and Manifest file :

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
   <uses-library android:name="com.google.android.maps" />
    <activity
        android:label="@string/app_name"
        android:name=".MapsActivity" >
        <intent-filter >
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

and in the JAVA file :

 public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mapView = (MapView) findViewById(R.id.map_view);      
        mapView.setBuiltInZoomControls(true);

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

My problem is : Map is not displayed. I am facing a problem Android Emulator.

Upvotes: 0

Views: 236

Answers (2)

Aarun
Aarun

Reputation: 564

Download the following APKs

com.android.vending-1.apk

com.google.android.gms-1.apk

Install these two APK into your running (target) emulator with ADB command:

adb -e install [path-to-APK-file]

Upvotes: 0

Android
Android

Reputation: 1427

you change in manifest

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

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


<application

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

</application>

Upvotes: 2

Related Questions