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. on the status ba

Hi All:

I have successfully ported wifi on the target device. And it could
But I found the notification icon on the status bar is always the same
icon. It doesn't change status depending on the singal strength of
wireless AP.
Could somebody tell me if it's normal or I should change code to let
it work?

Thanks a lot.

Best Regards,

2. SlideME: Looking for Volunteers to Write


At SlideME, we are going to be starting up an Android/Mobile news and
articles section. Looking for people with inside connections, technical
people who want to write technical articles, as well as people who want to
review content and/or hardware. One area I'd love to have covered is the
underlying wireless infrastructure (GPRS, proxies, SMS) and how it relates
to Android development.

The focus will be on the mobile developer audience so it's got to be
hard-core writing, no fluff and/or speculation. If you want to write in
languages other than English, that's cool, we can set that up. If
interested, just drop me an e-mail.

This is a community site so just looking for volunteers; this will give you
good visibility as a writer in the mobile space and an avenue for hooking
into the community and getting feedback. If you do content reviews, we will
be pushing them out to SAM, our mobile client, giving you broader



3. Class Cast Exception after classLoader.loadClass() and newInstance!

4. Dynamic Forms UI

5. mediaplayer alsa and opencore , no sound

6. Where can I put the map for gps?

7. Buffer data playing