Reputation: 37
I try to work with SQLite but I don't know what I'm doing wrong.
I've made an example to insert a records and it works but I can't see the database. I'm working with a real device.
I've found (in Internet) that the database should be in: /data/data/paquete.java.de.la.aplicacion/databases/database
But this folder seems empty. I've tried with oi File Manager application and File Explorer of Eclipse.
On the other hand, I'm sure that the records have been inserted because if I debug, I can see the them in Log Cat.
Any ideas?
Thanks in advance.
Upvotes: 0
Views: 81
Reputation: 2402
With the emulator you have root access and you can use sqlite3
to open the database from within an emulator shell. Use .dump
to dump all contents of the database.
So the commands you would have to do:
Open shell on emulator:
adb shell
Within shell:
cd /data/data/paquete.java.de.la.aplicacion/databases/databases
sqlite3 *yourdatabase.db*
Within sqlite3
.dump
Mit .exit
geht's wieder raus aus sqlite3.
Upvotes: 0
Reputation: 43738
As long as the application is built in debug mode there is no need to have the device rooted. Try
adb shell
run-as your.package.name
ls databases
Upvotes: 3
Reputation: 900
In order to see the database files on a phone or through eclipse, your device needs to be rooted. If you want to test your database to see what it looks like and if it's working otherwise, you can run your app on the emulator and see it just fine.
Upvotes: 3