MapView not working [android]

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

MapView not working [android]

Postby girshiit07 » Fri Jul 08, 2011 5:59 am

When I load my MapView application, the MapView only displays the grey grid lines.

Here is my Code:

main.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="0aOphT3vlZFVSL1HZ2Vg-RmIDhH0nPlp8e7gJrg"/>
</RelativeLayout>

Manifest File:

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

<application android:icon="@drawable/icon" android:label="@string/app_name">
<uses-library android:name="com.google.android.maps"></uses-library>
<activity android:name=".GMapsActivity"
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>
<uses-sdk android:minSdkVersion="1" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>

</manifest>


Activity:

package com.andoid.googlemaps;

import android.os.Bundle;

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

public class GMapsActivity extends MapActivity {
private MapView mapView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

/* Proxy Settings*/
System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyHost", "proxy.example.com");
System.setProperty("http.proxyPort", "8080");

setContentView(R.layout.main);
mapView=(MapView)findViewById(R.id.map_view);
mapView.setBuiltInZoomControls(true);

}

@Override
protected boolean isRouteDisplayed() {
return false;
}
}

Thanks in advance for any help...
girshiit07
Freshman
Freshman
 
Posts: 4
Joined: Fri Jun 17, 2011 7:42 am

Top

Re: MapView not working [android]

Postby abhijitphatak28 » Fri Jul 08, 2011 8:53 am

You can try enabling the map view by

mapView.setEnabled(true);

Thanks

Regards
-Abhijit
User avatar
abhijitphatak28
Senior Developer
Senior Developer
 
Posts: 102
Joined: Sat Feb 12, 2011 1:18 pm
Location: Indore

Re: MapView not working [android]

Postby girshiit07 » Fri Jul 08, 2011 10:06 am

Yes i tried ,still getting the same grey grid lines.
girshiit07
Freshman
Freshman
 
Posts: 4
Joined: Fri Jun 17, 2011 7:42 am

Re: MapView not working [android]

Postby girshiit07 » Thu Jul 14, 2011 8:28 am

After long time its worked. But still not got where was the problem actually,nothing i changed just i shared debug.keystore with my friend and its worked. Any way thanks for the reply...
girshiit07
Freshman
Freshman
 
Posts: 4
Joined: Fri Jun 17, 2011 7:42 am

Top

Return to Map Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests