[ACCEPTED]-Android: Where are database files stored?-sqlite

Accepted answer
Score: 33

try getDatabasePath on ContextWrapper ( http://developer.android.com/reference/android/content/ContextWrapper.html ). If 5 you are in an Activity or Application class 4 try:

File dbFile = getDatabasePath(MY_DB_NAME);
Log.i(dbFile.getAbsolutePath());

Just assuming its in /data/data/my.package.name/databases/ is bad as there 3 is no guarantee the data has not been moved 2 to the SD card or the device/OS has just 1 decided on a different data directory.

Score: 28

If you mean you visited /data and found nothing 6 in it, and you are examining an ordinary 5 piece of Android hardware, that is expected. DDMS 4 does not have permission to browse through 3 /data.

However, at least if your app is compiled 2 in debug mode, you can use the adb pull command 1 at the console to download your file directly.

Score: 6

In debug mode you can use adb shell and browse the 2 directory content. In the shell you can 1 call sqlite3 /data/data/dev.client.android/databases/clientDB.db to analyse the DB.

More Related questions