How can I read my database from DDMS

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

+6
source share
5 answers

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

Your database should be in a folder with folders

as soon as you select your database, on the top tab you will see two icons on which you can click or pull out the database

+19
source

You need to read SQLite records.

To read your SQLite records, you must run the project in your emulator and NOT on your Android device. If you want to read your SQL records in a real Android table, the process will be more complicated. Line decisions 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.

  • Download the Windows SQLite Database Browser from here
  • Install it on your computer.
  • Run the project in Eclipse only with the emulator. SHOULD NOT connect his Android tablet to the PC when you run the run.
  • After starting, go to Eclipse -Window -Open Perspective -Other and select DDMS.
  • You will see the β€œDevices” tab on the left and several tabs on the right.
  • Select the project name on the Devices tab.
  • On the tabs on the right, select Explorer. Pay attention to the folder named Data.
  • Expand the folder data and you will see another folder inside the named data.
  • Expand the new folder data and you will see several folders reflecting the package names. Select and expand the project package name. REMEMBER YOUR PROJECT MUST BE WORKING ACCORDING TO THESE FILES. Pay attention to the subfolder with the name bases. Expand this too.
  • Select the folder database and click the button to pull the file from the device. This button is located in the upper right corner. Select / create a folder on your hard drive to save the folder with its contents.
  • Launch SQLite Database Browser. Select the icon in the open folder. Locate the "Databases" folder saved on the PC in the previous step 2.10.
  • If you are in the Database Structure tab, you will see tables and columns.
  • You can select the Data Overview tab to view table data.
  • Select a table name from the table.
+7
source

If you use Eclipse and want to read the contents of sqlite directly from DDMS, without pulling it out of the database folder, you can use the questoid sqlite browser

You can download it from here .

+3
source

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

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

Or you can enter the device / emulator using

adb shell 

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

+1
source

There is a much more elegant way with this tool:

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

In the file explorer you can go to the database file and then view it, you do not need to deal with sql queries if you only want to check some values ​​in your database.

Unfortunately, there is no more active development for this.

+1
source

Source: https://habr.com/ru/post/902723/


All Articles