0

I am trying to access google map in a specific point in a android activity. My emulator is connected with internet. I also give internet permission to manifest.xml file. But my program can not connect to internet. Only show grid lines but no map. I can't find any error .Please help me out.here is my code

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    mv=(MapView)findViewById(R.id.mapView);

    LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);  
    View zoomView = mv.getZoomControls(); 

    zoomLayout.addView(zoomView, 
        new LinearLayout.LayoutParams(
            LayoutParams.WRAP_CONTENT, 
            LayoutParams.WRAP_CONTENT)); 
    mv.displayZoomControls(true);


    mc=mv.getController();
    String coordinates[] = {"1.352566007", "103.78921587"};
    double lat = Double.parseDouble(coordinates[0]);
    double lng = Double.parseDouble(coordinates[1]);

    p=new GeoPoint((int)(lat*1E6),(int)(lng*1E6));
    mc.animateTo(p);
    mc.setZoom(17); 
    mv.invalidate();

My manifest.xml

<?xml version="1.0" encoding="utf-8"?>

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

DPD
  • 143
  • 2
  • 8
  • It has to do with the debug.keystore, not with the internet connection. This has been treated a lot of times, just try to do a better search. – Cristian Apr 05 '11 at 17:41
  • I was able to see google map with this debug.keystore but in this program i am having problem. – DPD Apr 05 '11 at 17:47
  • If you get grid lines with no map then you are either using a debug api key with release apk or vice-versa. – Robby Pond Apr 05 '11 at 17:49

1 Answers1

0

You most likely need a Maps API key. If you think you already have a Maps API key and still can't figure it out, post your manifest .xml file

apesa
  • 12,163
  • 6
  • 38
  • 43