Cannot see map in my mobile device

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


Sponsored Links
 ello,
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 com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;

import android.graphics.drawable.Drawable;
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. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mymap);
linearLayout = (LinearLayout) findViewById(R.id.zoomview);
mapView = (MapView) findViewById(R.id.mapview);
mZoom = (ZoomControls) mapView.getZoomControls();

linearLayout.addView(mZoom);

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

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

itemizedOverlay.addOverlay(overlayitem);
mapOverlays.add(itemizedOverlay);
}

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

}

Overlay Class file:

package com.example.hellomap;

import java.util.ArrayList;

import android.graphics.drawable.Drawable;

import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.OverlayItem;

public class mapOverlay extends ItemizedOverlay {

private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>
();

public mapOverlay(Drawable defaultMarker) {
super(boundCenterBottom(defaultMarker));
// TODO Auto-generated constructor stub
}


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

@Override
public int size() {
return mOverlays.size();
}

public void addOverlay(OverlayItem overlay) {
mOverlays.add(overlay);
populate();
}

}

Manifest File

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hellomap"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/
app_name" android:debuggable="true">
<activity android:name=".HelloMap"
android:label=&qu



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: http://code.google.com/apis/maps/signup.html

On Nov 1, 5:39pm, newbie123 <abhaysupa...@gmail.com> 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. android.provider.Settings.System.FONT_SCALE -- Does this do anything (Android 2.0)?

It's supposed to scale the size of fonts defined using the "sp" unit.
But this is not exposed to the user not really supported at the
moment.



> 

2. ADP2 now available

Hey, folks.

Just a quick note to let you all know that the ADP2 (it's the same
hardware as the Google ION and the HTC Magic) is now available. Also,
the distribution of both ADP1 and ADP2 has expanded to include 9 more
countries: Italy, South Africa, New Zealand, Brazil, Czech Republic,
Estonia, Mexico, Northern Ireland and Norway. Check out Brightstar's
press release (http://j.mp/3UUn9U) for all the details.

As before, you can get access to the buy both phones via your Android
Market publisher account.

Best,

-Jason

-- 

3. eclipse problem in AndroidManifest.xml file

4. cannot scrollTo() a webview before rending it

5. plz help me ... how to implement camera intent correctly?

6. Menu Items.

7. "Low Memory: No more background processes."