i am trying to read geodatabase file (.gdb) and use it to get one of its GeodatabaseFeatureTables to load it to the map. However while creating its object, it's throwing "some kind of disk I/O error occurred " exception. I think this exception is related to SQLite error. Can anyone say why this exception is being thrown?
try
{
geodatabase = new Geodatabase(sdcardPath+gdbFilePath);
}
catch(Exception e)
{
e.printStackTrace();
}
Can you share what your sdcardPath and gdbFilePath values look like?
My sd card path is /sdcard/emulated/0/
gdb file path is warnl.gdb
Both the paths are valid and they exist.
Thanks.
It's probably best to get your path in this way:
Environment.getExternalStorageDirectory().getPath() + "/warnl.gdb".
You can take a look at a local data sample to see how this is used, something like in the Local MBTiles example: https://developers.arcgis.com/android/sample-code/local-mbtiles/
Hope this helps!
Eric,
I did the same way before.
String mGeoDbfilePath = "warnl.gdb";
String sdCardPath = Environment.getExternalStorageDirectory().getPath();
geodatabase = new Geodatabase(sdCardPath+"/"+mGeoDbfilePath);
Do I have to set permissions on the gdb file?
Thanks.
No, permissions should not be a problem.
The device does have an SD card?