publicclassMainActivityextendsActivity{ @OverridepublicvoidonCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //important! set your user agent to prevent getting banned from the osm servers org.osmdroid.tileprovider.constants.OpenStreetMapTileProviderConstants.setUserAgentValue(BuildConfig.APPLICATION_ID);
this.mLocationOverlay = new MyLocationNewOverlay(context, new GpsMyLocationProvider(context),mMapView); this.mLocationOverlay.enableMyLocation(); mMapView.getOverlays().add(this.mLocationOverlay);
map.setTileSource(new XYTileSource("YOUR MAP SOURCE", 0, 18, 256, ".jpg", new String[] {})); //.... map.setUseDataConnection(false); //optional, but a good way to prevent loading from the network and test your zip loading.