开发者

Where is apps SQLite DB Stored on Android

开发者 https://www.devze.com 2023-02-01 21:49 出处:网络
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 i

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

0

精彩评论

暂无评论...
验证码 换一张
取 消