Where is apps SQLite DB Stored on Android
I am trying to determine where on an android phone an apps SQLite 开发者_开发知识库database is stored. I am testings and need to be able to delete it and test the code for creation. On the simulator it is in /data/data/app package name/something.db but I am unable to find it on the actual phone. Does anybody know where it is stored and if it is accessable via DDMS?
Thanks
If for whatever reason, you need to access the database on the phone, you must have root access (superuser in other words) on the phone. Then you will need a file explorer that uses root permission to give you access to the system files.
If all the above exists, then you will find the application database in:
/data/data/com.yourpackage.name/databases.
Referring to this SO Answer, I was able to track down my application's DB file path using the following:
String DBPath = "//data//" + "<package name>" + "//databases//" + database_name;
JP
精彩评论