Nerd For Tech
Published in

Nerd For Tech

Database Inspector — View SQLite data

View your data stored in the database directly from your android studio using Database inspector. Much awaited feature is finally here.

Creating and managing a local database has been one of the most common and important aspects of an android application. Till now developers relied on third-party software and what not to view and manipulate data inside the database.

Finally, prayers of developers have been heard by the google and they have released the database inspector in Android studio 4.1. You cannot just view data but also query and manipulate live running data in the application.

Opening Database Inspector

To open the Database Inspector in Android Studio, select View > Tool Windows > Database Inspector from the menu bar.

Next, you need to select your device and application package which you want to debug.

Once you select the correct application process you’ll be able to see database schemas in the panel below

Database inspector will work on devices having API level 26 or higher

View Data

To browse data of the tables, click on the name of the table of which you want to view the data.
For eg in our case, we had a table named “contacts” and when we selected it, all the data in the table was shown on the right side

Live Updates

Selecting the checkbox “Live updates” will show updated data as and when it is updated from the application.

Execute SQL Queries

You can run queries by clicking the “Open new queries tab” button. You’ll see a section to type a query on the right side and a dropdown to select the database. Enter the query and click on the Run button and you’ll see the results below.

Edit data in row

One can directly edit data in android studio and it will automatically update in the device database. Just update the field that you want to by selecting it and then entering the new information. Remember to uncheck the “Live Update” checkbox before attempting to update data in a cell.

That’s it for now!!
Thanks for reading and don’t forget to share it with your fellow developers :)
This post was originally posted on
CodeTheraphy

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nandish swarup

Nandish swarup

Android | Kotlin | Full stack developer | Blogger