Something like this will do: Configuration config = DatabaseManager.createConfigurationFileAndroid( "/sdcard/Android/data/app.package.name/files/test.udb", getApplicationContext() ); Connection conn = DatabaseManager.connect( config ); I tried this but i get this error "com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-954]: The database '/data/data/Tejash.Agni/goroute.udb' was not found" where goroute is my file name and tejash.agni is package in which database is stored
(16 Apr '12, 14:06)
Tejasvi
Replies hidden
File paths in the Android file system are case-sensitive. Could that be the problem?
(16 Apr '12, 14:15)
Andy Quick
2
You indicated that you were interested in accessing the database on an SDCard. The error you report looks like an internal file storage reference. A reference to an SDCard location will look more like: /mnt/sdcard/Android/data/com.sybase.repro/files/database.udb I generally use the following approach in code: String dbPath = getApplicationContext().getExternalFilesDir(null) + "/database.udb"; For internal storage, the code I use looks like: String dbPath = getApplicationContext().getFilesDir() + "/database.udb"; and the resulting directory looks like: /data/data/com.sybase.repro/files/database.udb
(16 Apr '12, 15:05)
Chris Keating
|