6

In android how can I read database which is in DDMS? I want to see the data of my database which is stored in DDMS can I do this?

skynet
  • 9,898
  • 5
  • 43
  • 52
user1061793
  • 1,047
  • 8
  • 19
  • 27
  • 1
    What do you mean by database in DDMS? Do you mean database in AVD? Look at file exploerer in DDMS where you can pull or push a file. – Tae-Sung Shin Nov 30 '11 at 04:46

5 Answers5

19

DDMS--> file explorer-->data--> data--> your package name-->databases

Your database should be inside databases folder

once you select your database, you will see two icons on the upper tab wherein you can push or pull the database

Romain Guidoux
  • 2,943
  • 4
  • 28
  • 48
Pratik Bhat
  • 7,166
  • 2
  • 35
  • 57
7

You need to read SQLite records.

In order to read your SQLite records you must run the project in your emulator and NOT in Android Device. If you want to read your SQL records in the actual Android table the process is more complicated. Solutions on line suggest that the only way to achieve is to “root” the device. This is a no-no process if you do not know what you are doing.

  1. Download the Windows SQLite Database Browser from here
  2. Install it at your PC.
  3. Run the project in Eclipse using the emulator only. DO NOT have connected it your android tablet in your PC when you do the run.
  4. After the run go to Eclipse –Window –Open Perspective –Other and Select DDMS.
  5. You will see a Devices tab to the left and several tabs to the right.
  6. Select from the Devices tab the project name.
  7. From the tabs in the right select the File Explorer. Notice a folder named Data.
  8. Expand the folder data and you will see another folder inside named data also.
  9. Expand the new folder data and you will see a number of folders reflecting the package names. Select and expand the project package name. REMEMBER YOUR PROJECT MUST BE RUNNING IN ORDER TO SEE THOSE FILES. Notice a subfolder with the name databases. Expand that too.
  10. Select the folder databases and click the button pull a file from a device. This button is located at the top right corner. Select/create a folder in your hard drive to save the folder with its content.
  11. Start SQLite Database Browser. Select icon open folder. Find the Databases folder you saved in your PC at the previous step 2.10.
  12. If you are in the tab Database structure you will see the tables and columns.
  13. You can select the Browse Data tab to see the table’s data.
  14. Select from the Table scroll the table name.
Cory Klein
  • 51,188
  • 43
  • 183
  • 243
3

If you are using Eclipse and wanting to read the contents of the sqlite directly from the DDMS without pulling it out from the databases folder, you can use questoid sqlite browser

You can download it from here also.

Lalit Poptani
  • 67,150
  • 23
  • 161
  • 242
1

There is a much simpler an more elegant way using this tool:

http://www.coderzheaven.com/2011/04/18/sqlitemanager-plugin-for-eclipse/

In the file explorer you can navigate to the database file and then browse through it, no need to deal with sql queries if you only want to check some values in you database.

Unfortunately there doesn't seem to be any more active development for it.

1

The best option is to use Motodev Studio. It allows you to connect to the database on the emulator/devices and do sql queries and so on.

Otherwise you can also download the database to your developer machine and then connect to it and query it.

Or you can log in to the device/emulator with

adb shell

and use sqlite3 to connect and execute queries on the command line.

Manfred Moser
  • 29,539
  • 13
  • 92
  • 123