How to View Android SQLite Database on Emulator

Everybody should be very curious about what is inside the Android SQLite Database. Many people ask about can we view android sqlite database structure and tables? In the short answer is yes, we able to view the database table and records in our computer. In this post, I will give you all the steps to view Android SQLite Database from android emulator in your personal computer. For the last result, you can just select what database that you wanna to see.

Pre-requisites

1. Android Emulator

There have many android emulator in the market. I recommend you to use Genymotion because it has a very good performance and easy to use it. Besides, HAXM emulator has been upgraded by Google, it is much more better, you can just download it from Android Studio IDE SDK Manager.

2. Sample Android SQLite Project that you wish to see the database.

You can get sample SQLite project from this link SQLite Database Example.

Install DB Browser for SQLite

In your internet browser enter the link http://sqlitebrowser.org/ to download the DB browser for SQLite. There are many version of DB browser, If you are the windows user download windows.exe.

View Android SQLite Database 1

After downloaded the DB browser for SQLite. Click the installer and install in your computer.

Run Your Android Emulator

Open Android Studio IDE and run your emulator for example I will open Genymotion emulator.

(Note : If you are first time to run your SQLite project, you must run the SQLite project to generate the database file in your emulator.)

Open Android Device Monitor

In the Android Studio toolbar, select Tools > Android > Android Device Monitor.  It will poop up a dialog box to call you close debug, just click yes to proceed.

View Android SQLite Database 2

Choose the Android Emulator that connected in your computer

When open the Android Device Monitor (DDMS), select the emulator that you connected in your computer from the left side section. After that, choose the folder in the right side section. Follow this path data/data/package name ( eg com.example.questdot.sqliteexample). You will see db file inside the databases folder.

View Android SQLite Database 3

Save .db file in your computer

Choose the db file that you wanna to save and click the save icon to save the file in your computer.

View Android SQLite Database 4

Open DB browser for SQLite

Open your DB browser for SQLite, from the toolbar click File > Open Database to open the db file.

Browse Data and View Android SQLite Database

Congratulation now you can view the database table and structure in the DB browser. In the Tab section, Database Structure can view the database name , field name and type. While Browse Data, can view what database had been record in the selected table.

Mission Done

Yeah…. you just learn how to view android sqlite database on your emulator. Its is very easy for all beginners.

(Visited 2,881 times, 1 visits today)
Advertisements

Yong Loon Ng

Ng Yong Loon, better known as Kristofer is a software engineer and computer scientist who doubles up as an entrepreneur.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *