How to view the sqlite database in android development

One, use the App Inspection of AS to view

Advantages and disadvantages

  • Advantages: can be viewed in real time, easy to operate
  • Cons: Can't view offline

Precautions

This method is the easiest to use. To make the database display need to meet the following points

  • sqlite data is not in closed state
  • The program must be running
  • The corresponding device and package name are correctly selected

insert image description here

 

Second, the AS plug-in SimpleSqliteBrower view

Advantages and disadvantages

  • Advantages: real-time viewing is more convenient and easy to operate
  • Disadvantages: You need to find the file first when opening the project, and it is more cumbersome to start using

operation method

Download the SimpleSqliteBrower plugin

insert image description here


Find the database file, double click

  1. Click Device File Exploer on the right sidebar of AS
  2. Find the corresponding database according to "data/data/application package name/database/database name", double-click to view

insert image description here

insert image description here

insert image description here

Export db file, use DB Browser (SQLite) software to view

Advantages and disadvantages

  • Pros: Can be viewed normally
  • Disadvantages: It cannot be viewed in real time, and a save-as operation is required for each viewing, and the viewing process is cumbersome and inconvenient

export file

1. Find the db file according to the above method, then right click and save it to the desktop

2.

insert image description here

2. Use DB Browser to view

insert image description here

insert image description here

insert image description here

—————————————————
Reprinted: https://blog.csdn.net/qq_49511057/article/details/128690910

Guess you like

Origin blog.csdn.net/weixin_42602900/article/details/131172322