An API Im using in my Android application is opening a SQLite database
file:

    public AndroidSQLiteDataStore() throws SQLiteException {
        Logger logger = LoggerFactory.getDefaultInstance();
        logger.information(TAG, "OPEN CONNECTION TO DATABASE " +
DB_PATH);
        try {
            this.db = SQLiteDatabase.openDatabase(DB_PATH, null,
SQLiteDatabase.CREATE_IF_NECESSARY | SQLiteDatabase.OPEN_READWRITE);
        } catch (SQLiteException e) {
            logger.error(TAG, e.toString());
            throw e;
        }
    }

where DB_PATH is a static string such as "/data/data/packagename/
databases/data.db". (packagename matches what Im using for the package
name in the manifest). The open fails but its not clear to me why that
is.

The adb log looks like this:

I/AndroidSQLLiteDataStore(29640): OPEN CONNECTION TO DATABASE /data/
data/packagename/databases/data.db

E/Database(29640): sqlite3_open_v2("/data/data/packagename/databases/
locker.db", &handle, 6, NULL) failed

E/AndroidSQLLiteDataStore(29640):
android.database.sqlite.SQLiteException: unable to open database file


Is my path incorrect or are there some permissions I must grant my
application to allow it to open/create a databases? Any ideas?




--

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to