@Override
	public void onCreate(final Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		// Setup base map
		final RelativeLayout rl = new RelativeLayout(this);

		mMapView = new MapView(this);
		mMapView.setTilesScaledToDpi(true);
		rl.addView(mMapView, new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,
				LayoutParams.FILL_PARENT));

		// zoom to the netherlands
		mMapView.getController().setZoom(7.);
		mMapView.getController().setCenter(new GeoPoint(51.5, 5.4));

		// Add tiles layer with custom tile source
		final MapTileProviderBasic tileProvider = new MapTileProviderBasic(getApplicationContext());
		final ITileSource tileSource = new XYTileSource("FietsRegionaal",  3, 18, 256, ".png",
				new String[] { "http://overlay.openstreetmap.nl/openfietskaart-rcn/" });
		tileProvider.setTileSource(tileSource);
		tileProvider.getTileRequestCompleteHandlers().add(mMapView.getTileRequestCompleteHandler());
		final TilesOverlay tilesOverlay = new TilesOverlay(tileProvider, this.getBaseContext());
		tilesOverlay.setLoadingBackgroundColor(Color.TRANSPARENT);
		mMapView.getOverlays().add(tilesOverlay);

		this.setContentView(rl);
	}
@ Override public void onCreate ( final Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; final RelativeLayout rl = new RelativeLayout ( this ) ; mMapView = new MapView ( this ) ; mMapView . setTilesScaledToDpi ( true ) ; rl . addView ( mMapView , new RelativeLayout . LayoutParams ( LayoutParams . FILL_PARENT , LayoutParams . FILL_PARENT ) ) ; mMapView . getController ( ) . setZoom ( 7. ) ; mMapView . getController ( ) . setCenter ( new GeoPoint ( 51.5 , 5.4 ) ) ; final MapTileProviderBasic tileProvider = new MapTileProviderBasic ( getApplicationContext ( ) ) ; final ITileSource tileSource = new XYTileSource ( "FietsRegionaal" , 3 , 18 , 256 , ".png" , new String [ ] { "http://overlay.openstreetmap.nl/openfietskaart-rcn/" } ) ; tileProvider . setTileSource ( tileSource ) ; tileProvider . getTileRequestCompleteHandlers ( ) . add ( mMapView . getTileRequestCompleteHandler ( ) ) ; final TilesOverlay tilesOverlay = new TilesOverlay ( tileProvider , this . getBaseContext ( ) ) ; tilesOverlay . setLoadingBackgroundColor ( Color . TRANSPARENT ) ; mMapView . getOverlays ( ) . add ( tilesOverlay ) ; this . setContentView ( rl ) ; }
Called when the activity is first created.