SQLite
Debugging database
Fri, 03/12/2010 - 02:25 | by gaborWhen I first tried to manage an sqlite database on an adroid device I was not sure about where I fail in it. Can I even insert the records into the database, or I fail only to read the data from it? So I started to search for possibilities to debug the database lifecycle.
The system stores databases in the /data/data/package_name/databases folder by default.
In a command line using the adb (Android Debug Bridge - found in the android sdk tools library) you can access the databases on a running emulator like below:
- adb -s emulator-5554 shell
- sqlite3 /data/data/package_name/databases/database_name
After this you can type normal SQL commands to test the content. For example:
- SELECT * FROM table_name;
This will list the table content (in an ugly format), or say that it does not exists.
