I need to know the string path to a file on assets folder, because I'm using a map API that needs to receive a string path, and my maps must be stored on assets 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 is going wrong with "file:///android_asset/m1.map"
because the map is not being loaded.
Which is the correct string path file to the file m1.map stored on my assets folder?
Thanks
EDIT for Dimitru: This code doesn't works, it fails on is.read(buffer);
with 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);}