Cannot see map in my mobile device

by newbie123 » Tue, 03 Nov 2009 06:42:04 GMT

Sponsored Links
THis is my first time deling with MapActivity and I was able to work
the MapView example , go it to compile and launched it on my device,
but I dont see it displaying any maps. It just shows the white screen
with zoom button an d the overlay drawable png image I have. can any
one tell me whats wrong.

Here's my class file MapView class file.

package com.example.hellomap;

import java.util.List;


import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.ZoomControls;

public class mymap extends MapActivity {
List<Overlay> mapOverlays;
Drawable drawable;
mapOverlay itemizedOverlay;
LinearLayout linearLayout;
MapView mapView;
ZoomControls mZoom;

/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
linearLayout = (LinearLayout) findViewById(;
mapView = (MapView) findViewById(;
mZoom = (ZoomControls) mapView.getZoomControls();


mapOverlays = mapView.getOverlays();
drawable = this.getResources().getDrawable(;
itemizedOverlay = new mapOverlay(drawable);

GeoPoint point = new GeoPoint(19240000,-99120000);
OverlayItem overlayitem = new OverlayItem(point, "", "");


protected boolean isRouteDisplayed() {
return false;


Overlay Class file:

package com.example.hellomap;

import java.util.ArrayList;



public class mapOverlay extends ItemizedOverlay {

private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>

public mapOverlay(Drawable defaultMarker) {
// TODO Auto-generated constructor stub

protected OverlayItem createItem(int arg0) {
return mOverlays.get(arg0);

public int size() {
return mOverlays.size();

public void addOverlay(OverlayItem overlay) {


Manifest File

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
<application android:icon="@drawable/icon" android:label="@string/
app_name" android:debuggable="true">
<activity android:name=".HelloMap"

Cannot see map in my mobile device

by Mike Wolfson » Tue, 03 Nov 2009 07:34:42 GMT

 ithout looking at your code.  You need a key from Google to work with
Maps (and they won't show without it).

Look at the Android Map Tutorial, and it tells you how to obtain the
key (it is free), and then you put the key in your manifest.

Here is a URL to signup as well:

On Nov 1, 5:39pm, newbie123 <> wrote:


Sponsored Links

Cannot see map in my mobile device

by Tim » Fri, 06 Nov 2009 06:45:47 GMT


Without reading your code, I'm pretty sure you haven't set your maps
api key appropriately. It goes in the main.xml layout file.


Other Threads

1. My appwidget broken Donut when keyboard slide out/in

I developed an appwidget and published on market, it works very well
on Cupcake. but after I upgrade my OS to Donut.Everytime when I slide
out/in keyboard, I will got an error:

The process android.process.acore has stopped unexpected.Please try

I have to click "force close", and wait about 3 seconds to get the
home screen. It seems my appwidget cause this error, because after I
uninstall the appwidget, the error also gone. One of my user reported
to me the same problem, he was sure it's my appwidget's problem,
because he erase all application and install one by one to test which
application cause the error, he found after he installed my appwidget,
the error occured again.

It's very strange,I checked Donut documents, seems the appwidget api
have no change.I don't know what happend when keyboard slide out/in,
does any body know why this happen?

below is the log capture from DDMS when the error occured.

10-20 22:50:28.503: DEBUG/AndroidRuntime(764): Shutting down VM

10-20 22:50:28.503: WARN/dalvikvm(764): threadid=3: thread exiting
with uncaught exception (group=0x4001da28)

10-20 22:50:28.523: ERROR/AndroidRuntime(764): Uncaught handler:
thread main exiting due to uncaught exception

10-20 22:50:28.703: ERROR/AndroidRuntime(764):
java.lang.ClassCastException: android.view.AbsSavedState$1

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at$2400(

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at$DesktopBinder.handleMessage

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at
java.lang.reflect.Method.invokeNative(Native Method)

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at$

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at

10-20 22:50:28.703: ERROR/AndroidRuntime(764):     at
dalvik.system.NativeStart.main(Native Method)

10-20 22:50:28.713: INFO/Process(81): Sending signal. PID: 764 SIG: 3

10-20 22:50:28.713: INFO/dalvikvm(764): threadid=7: reacting to signal

10-20 22:50:28.963: INFO/dalvikvm(764): Wrote stack trace to '/data/

10-20 22:50:29.313: INFO/DumpStateReceiver(81): Added state dump to 1

10-20 22:50:31.003: DEBUG/dalvikvm(81): GC freed 10815 objects /
597576 bytes in 274ms

2. Google Streetview for 2.0 emulator, to test invocation through an Intent

My apps invoke Google Streetview through an Intent (as document here:
Right now I am testing things out for Android 2.0. In the absence of a
physical device, this is through emulator testing only, for now.
I noticed the Google apps, which are needed to test the above, are
missing in  2.0. I did some poking around but couldn't find a source
to install those on the emulator (I am aware there's been some
commotion around that aspect of Android...). So I tried the Cyanogen
(sp?) route, pull Street.apk off a 1.6 device and then adb install it
in the emulator. That didn't work... Street.apk is reported as already
existing, and I cannot replace it ("failure").
BTW: I cross checked this method against Maps.apk, and that went
through OK.

Anybody got an idea how to properly install street view on the 2.0
emulator? (Did I fundamentally miss something here?)


3. Eclais SDK is out, but STILL no Arabic support in Android

4. Turn copy protection from on to off on market app?

5. Run ARM application on Qualcomm 3G

6. Slashdot: Android / Windows 7 Dual Boot Netbook Disappoints

7. Using TransitionDrawable to make a transition with 3 elements