In this tutorial, we will show you how to browse android emulator SQLite database.
You need these tools! Trust me, if you not able to browse data that you have saved you will spend a lot of time and killing your brain cell to debug line by line. That is a nightmare :).
How to browse Android Emulator SQLite Database
There are 2 ways to browse SQLite database in Android Emulator
- View from the eclipse with a plugin tool.
- Pull data out from eclipse and view data with SQLite database Browser, (There are some other tools also can view the database like SQLiteSpy.)
- View from the eclipse with a plugin tool
- Download com.questiod.sqlitemanager.jar and save into “X:\…\eclipse\dropins” folder, Eclipse update manager will install any jar in this directory, if you like to uninstall it just simply delete the jar file.
- Restart Eclipse.
- Navigate menu to Windows>Show View>Other>Questiod SQLite Manager
- Find the DDMS icon, and click on it. The SQLite manager tools should be installed and it will look like below
- So, Let’s try it!
- In this tutorial,
We will use com.android.providers.email database that available in the emulator as testing target and it’s locate in data/data/com.android.providers.email/databases/EmailProvider.db. Click on the File Explorer. You should see something like this. Please take note you need a “db” extension file or else the tool will not enabled.
- Click on the Open File in SQLite Manager… icon
You will see the image like below for viewing all tables and data.
Click on the Browse Data tabs, and choose a table named android_metadata, you will see data in this table.
- Pull data out from eclipse and view it with SQLite database Browser.
Click on DDMS icon. Icon in the highlight circle is for import file from and to emulator, the left icon is export and right icon is for export. Click on the left icon to save it to the desktop.
Use SQLite Browser, Click Open Existing Database file and then select EmailProvider.db from where you save in step 1.
- And you will see image like below. This tool allow you to insert, update data and write query in Execute SQL tab.
1. When you create your database, please make sure create with “db” extension. i.e. instinctcoder.db.
2. Personally, I preffered the 2nd method as it allows you to insert, update data and select data.
3. During development, sometimes you need to run in debug mode(F11) in order to get latest data.