Select to view content in your preferred language

Exception while reading geodatabase file

3125
5
09-04-2015 12:49 PM
rahulkumar4
New Contributor

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(); 
}
0 Kudos
5 Replies
EricBader
Regular Contributor II

Can you share what your sdcardPath and gdbFilePath values look like?

0 Kudos
rahulkumar4
New Contributor

My sd card path is /sdcard/emulated/0/

gdb file path is warnl.gdb

Both the paths are valid and they exist.

0 Kudos
EricBader
Regular Contributor II

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!

0 Kudos
rahulkumar4
New Contributor

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.

0 Kudos
EricBader
Regular Contributor II

No, permissions should not be a problem.

The device does have an SD card?

0 Kudos