-
Notifications
You must be signed in to change notification settings - Fork 567
Android internal db path #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Just use the name of the db without any path, and it will be stored internally. Swarnamahesh reply@reply.github.com wrote: Hi, I am trying to create a database with path as default database path in android, with code as below. I get unable to open database file exception. If i give sdcard path it works perfectly, however i do not want my db available in sdcard. Is there a way to make this work internally? (I do not use dbhelper) Code: String dbPath = context.getDatabasePath(DATABASE_NAME).toString() Exception: info.guardianproject.database.sqlcipher.SQLiteException: unable to open database file Thanks & Regards, Reply to this email directly or view it on GitHub: |
Hi, Thanks for the reply, I tried the following code as well, it still gives the same exception: Exception: Code 1: Code 2: |
Have you tried our sample code? The Notepadbot sample project? These all use internal storage. Swarnamahesh reply@reply.github.com wrote: Hi, Thanks for the reply, I tried the following code as well, it still gives the same exception: Exception: Code 1: Code 2: Reply to this email directly or view it on GitHub: |
Thank you for replying. I fixed it by reviewing the code given for your helper class at : I modified my code accordingly. For future reference, here is the code I modified to make it work without helper class. String dbPath = context.getDatabasePath(DATABASE_NAME).getPath(); File dbPathFile = new File (dbPath); sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(dbPath, "password", null); |
Hi,
I am trying to create a database with path as default database path in android, with code as below. I get unable to open database file exception. If i give sdcard path it works perfectly, however i do not want my db available in sdcard. Is there a way to make this work internally? (I do not use dbhelper)
Code:
String dbPath = context.getDatabasePath(DATABASE_NAME).toString()
sqLiteDatabase = SQLiteDatabase.openOrCreateDatabase(dbPath, "password", null);
Exception:
info.guardianproject.database.sqlcipher.SQLiteException: unable to open database file
Thanks & Regards,
Swarna
The text was updated successfully, but these errors were encountered: