Android #000: How to create a Mapview


To create a MapView within Android you onle have to use the MapView object. You can go through the code and see how it works. For the user interface hou need to have en element with the corresponing ID.

The Class:

package com.joesonic;
import android.app.Activity;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
public class MapsMini extends MapActivity {
/** Called when the activity is first created. */
private MapView mapview;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
mapview = (MapView)findViewById(R.id.mapview);
}
}

The Result:

neues-bild-3.png

Written and submitted from Home, using my 802.11g WiFi network.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Live
  • NewsVine
  • Reddit
  • StumbleUpon
  • Technorati
  • TwitThis
  • BlinkList
  • Blue Dot
  • Fleck
  • Internetmedia
  • Ma.gnolia
  • MisterWong
  • description
  • Slashdot
  • Yigg
  • E-mail this story to a friend!

0 Responses to “Android #000: How to create a Mapview”


  1. No Comments

Leave a Reply