views:

1077

answers:

4

Hi,

I am new to Android and i would like to know if there's any tool to see databases (.db) tables and data into these tables.

Thanks in advance. Best Regards. Josema.

+2  A: 

Emulator/device instances store SQLite3 databases in the folder /data/data//databases/.

Taken from Android Debug Bridge

Inside Eclipse while the emulator is running, go to Window -> Show View -> Other.. -> Android -> File Explorer to locate the data folder that contains the databases.

Anthony Forloney
A: 

firefox has a plugin for sqlite db's. that's a start. a great start by the way :)

KevinDTimm
+1  A: 

sqlite database browser could also be helpful, though you need to pull a copy of the database from the device as explained before and work on that copy that can be restored later on.

alt text

dtmilano
+1  A: 

There is a tool (sqlite3) installed on the phone itself. You should be able to do this if you have ADB installed on your machine & your phone is connected or currently being emulated.

Find the database files:

adb shell find /data -name *.db
/data/data/com.google.android.apps.maps/databases/search_history.db
/data/data/com.qo.android.htc/databases/webview.db
/data/data/com.qo.android.htc/databases/webviewCache.db
/data/data/com.layar/databases/layar.db
...

Open a database using the sqlite tool:

C:\> adb shell 
# sqlite3 /data/data/com.google.android.youtube/databases/history.db

SQLite version 3.5.9
Enter ".help" for instructions
sqlite> .tables
android_metadata  suggestions

sqlite> .schema suggestions
CREATE TABLE suggestions (_id INTEGER PRIMARY KEY,display1 TEXT UNIQUE ON CONFLICT REPLACE,display2 TEXT,query TEXT,date LONG);

sqlite> select * from suggestions;
2|randy pausch last lecture|Results for "randy pausch last lecture"|randy pausch last lecture|1264159994987
C4H5As