TBOTH > Android Sqlite Access

Android Sqlite Access

1) Launch the emulator (or connect your real device to your PC ). I usually launch one of my program from Eclipse for this.
2) Launch a command prompt in the android tools directory.
3) type adb shell.
This will launch an unix shell on your emulator / connected device.
4) go to the directory where your database is :
cd data/data
here you have the list of all the applications on your device
Go in your application directory ( beware, Unix is case sensitive !! )
cd com.charbs.ButtonTimer
and descend in your databases directory :
cd databases
Here you can find all your databases.
5) Launch sqlite on the database you want to check / change :
sqlite3 ButtonTimerDB?
From here, you can check what tables are present :
.tables
6) enter any SQL instruction you want :
select * from button_timer_log;

This is quite simple, but every time I need it, I don't know where to find it.


The original document is available at http://www.tboth.com/wiki/tiki-index.php?page=Android%20Sqlite%20Access