Hi dear, I have the same problem. Following my code
Manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.maps"
android:versionCode="1"
android:versionName="1.0.0">
<application android:icon="@drawable/icon" android:label="@string/
app_name">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".AndroidGoogleMap"
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-permission
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="android.permission.INTERNET"></uses-permission>
<uses-permission
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-
permission>
</manifest>
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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
android:id="@+id/mapview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="test" />
</LinearLayout>
Class Activy
public class AndroidGoogleMap extends MapActivity {
private MapView mapView;
private MapController mc;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mapView = (MapView) findViewById(R.id.mapview1);
mc = mapView.getController();
String coordinates[] = {"40.747778", "-73.985556"};
double lat = Double.parseDouble(coordinates[0]);
double lng = Double.parseDouble(coordinates[1]);
// GeoPoint p = new GeoPoint((int) (lat * 1E6), (int) (lng *
1E6));
//
// mc.animateTo(p);
mc.setZoom(17);
mapView.setSatellite(true);
//mapView.setStreetView(true);
mapView.invalidate();
//mapView.preLoad();
}
@Override
protected boolean isRouteDisplayed() {
return false;
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_3:
mc.zoomIn();
break;
case KeyEvent.KEYCODE_1:
mc.zoomOut();
break;
}
return super.onKeyDown(keyCode, event);
}
}
Someone could help me?
On 9 set, 05:58, ade <[EMAIL PROTECTED]> wrote:
> Thanks! Permission was the culprit.
>
> On Sep 9, 1:45 am, "Mark Murphy" <[EMAIL PROTECTED]> wrote:
>
> > > How do you resolvemapsthat shows only blank white screen (and grey
> > > grids.) ? For your info I am not behind any proxy, and my firewall's
> > > log shows nothing is blocked. I can access web pages and the Google
> > >Mapsthat comes in the emulator, but somehow cant show any map on my
> > > test application.
>
> > > Is there any documentation / getting started on map ? Thank you.
>
> > You need the INTERNET permission in your application. You might also need
> > ACCESS_COARSE_LOCATION -- I forget off the top of my head.
>
> > Try that and see if it helps.
>
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > _The Busy Coder's Guide to Android Development_ Version 1.2 Published!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---