I need to know the path of the line to the file in the resource folder, because I use the api map, which should receive the string path, and my maps should be stored in the resource folder
This is the code I'm trying:
MapView mapView = new MapView(this); mapView.setClickable(true); mapView.setBuiltInZoomControls(true); mapView.setMapFile("file:///android_asset/m1.map"); setContentView(mapView);
Something goes wrong with "file:///android_asset/m1.map" because the map is not loading.
What is the correct line path file to the m1.map file stored in my resource folder?
thank
EDIT for Dimitru: this code does not work, it fails on is.read(buffer); with an IOException
try { InputStream is = getAssets().open("m1.map"); int size = is.available(); byte[] buffer = new byte[size]; is.read(buffer); is.close(); text = new String(buffer); } catch (IOException e) {throw new RuntimeException(e);}
android android-assets assets
NullPointerException Dec 12 '11 at 13:09 2011-12-12 13:09
source share