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:
Written and submitted from Home, using my 802.11g WiFi network.























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