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:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • email
  • LinkedIn
  • Live
  • MisterWong
  • MySpace
  • Netvibes
  • NewsVine
  • PDF
  • Reddit
  • RSS
  • Scoopeo
  • Slashdot
  • StumbleUpon
  • Technorati
  • Tumblr
  • Twitter
  • Yahoo! Bookmarks
  • Yigg
This entry was posted in LBS and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>