1

About 10 months ago i worked on a little project which was Google map related. To work, first I generated MD-5 and signed up to get my API key. Opened project in Google INC API-10. That time it was successful.

But recently, i found though i got permission in manifest file (Internet permission & google map) then modified in .xml file and extended MapActivity in main.java. I think with unimplemented method atleast a map should be viewed. As there is no error only map grids ase showing. those grid can be zoomed but no map. Atlast, followed a tutorial but there i found no error and the result is same. No map.

I don't know why. Thanks in advance.

package com.my.goog;

import com.google.android.maps.MapActivity;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class Map extends MapActivity 
{

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
}


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


<?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="0N81shD3frjkFeIRFawvwgY7V9g391ZqFn6YI-A"
/>


<-- manifest-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.my.goog"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="5"
android:targetSdkVersion="15" />  
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-library android:name="com.google.android.maps" />     
<activity
android:name=".Map"
android:label="@string/title_activity_map" >
<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>

`

2 Answers2

0

As Raghunandan said in his comment, you can't use an emulator with Google Maps API v2, as explained here: Running Google Maps v2 on the Android emulator

If, however, you get an error message saying:

This app won't run without Google Play Services, which are missing from your phone.

you can try the following question, where some have managed to make it work: This app won't run unless you update Google Play Services (via Bazaar)

Community
  • 1
  • 1
verybadalloc
  • 5,768
  • 2
  • 33
  • 49
0
  1. Download the following apk files.

    1.1. Google Play services apk: download the latest from https://play.google.com/store/apps/details?id=com.google.android.gms using this apk downloader website http://apps.evozi.com/apk-downloader/

    1.2. Google Play store apk: http://www.androidpolice.com/2013/08/13/download-latest-google-play-store-4-3-11-teardown/4.4.22 (You may download latest file).

  2. Install the apks Files.

    2.1. Use the following command to install the Google Play services apk on the emulator.
    [location of apk file] >adb install com.google.android.gms.apk

    2.2. Use the following command to install the Google Play store apk on the emulator. [location of apk file] >adb install com.android.vending-4.4.22.apk

    2.3. Make sure you get Success message like this.

enter image description here

  1. Restart the emulator

  2. Deploy your application

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Silambarasan Poonguti
  • 9,386
  • 4
  • 45
  • 38