Andy Mark Tingey
Andy Mark Tingey

Reputation: 39

Finding SQL Database File on Android Mobile Phone

I've created an application that uses an Android SQL database. Is there any way to find this database on the Mobile Phone that the Application is installed to?

Essentially I want to then use an SQL Database Viewer to look at all the rows?

Upvotes: 0

Views: 3110

Answers (3)

FabianCook
FabianCook

Reputation: 20557

root/data/data/package/databases/database

it should be in a file like that, in the emulator you can go straight to this using the file explorer in ddms, otherwise a rooted phone and ES file explorer

Upvotes: 2

Siddharth Lele
Siddharth Lele

Reputation: 27748

A similar question has been answered here: https://stackoverflow.com/a/4556642/450534

The same answer provided there is:

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.

Upvotes: 0

Martin
Martin

Reputation: 125

if you're using the emulator you can use the adb tool in the sdk-platform folder of the android install.

something like the following:

./adb shell
#sqlite3 /data/data/com.example.package/databases/database.db

you should then be able to do your queries.

If its on a phone, then try extract the database like above and use the sqlite3 tool to query that database.

Upvotes: 0

Related Questions