How to use an Openstreetmap file in Android application

412 views Asked by At

I have a customized map file "map.osm", how I can use that file to create an Android Openstreet map navigator App? And where I need to import that file in my eclipse project folder?

Please let me know the process to load a map. At present I have done this,

public class MainActivity extends Activity  {
    private MapView m_mapView;
    private int MAP_DEFAULT_ZOOM = 15;
    private double MAP_DEFAULT_LATITUDE = 38.535350;
    private double MAP_DEFAULT_LONGITUDE = -121.753807;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);     
        setContentView(R.layout.osm_map);
        m_mapView = (MapView) findViewById(R.id.mapview);
        m_mapView.setBuiltInZoomControls(true);
        m_mapView.setMultiTouchControls(true);
        m_mapView.setClickable(true);
        m_mapView.setUseDataConnection(false);
        m_mapView.getController().setZoom(MAP_DEFAULT_ZOOM);
        m_mapView.getController().setCenter(
            new GeoPoint(MAP_DEFAULT_LATITUDE, MAP_DEFAULT_LONGITUDE));
        m_mapView.setTileSource(TileSourceFactory.MAPNIK);      
        //setContentView(R.layout.activity_main);
    }

So I don't how to load map in to that. Please help. Now I'm getting blank map. enter image description here

0

There are 0 answers