Debug/View SQLite Database using Android Debug Database

Debug/View SQLite Database using Android Debug Database

Debug/View SQLite Database using Android Debug Database allows you to view databases and shared preferences directly in your browser in a very simple way.

Android Debug Database is a powerful library for debugging databases and Shared Preferences in Android applications.

First of all I want to appreciate my friend Amit Shekhar to make this awesome and useful library. Sometimes we stuck to see SQLite database in Database Viewer from emulator or devices, but after getting this one I am used to with it. I used on daily basis to view my SQLite database from device to PC directly.

Lets have fun with Debug Database. 🙂 🙂 🙂

Android Debug Database

Android Debug Database

What can Android Debug Database do?

  • See all the databases.
  • See all the data in the shared preferences used in your application.
  • Run any sql query on the given database to update and delete your data.
  • Directly edit the database values.
  • Directly edit shared preferences.
  • Delete database rows and shared preferences.
  • Search in your data.
  • Sort data.
  • Download database.

Using Android Debug Database Library in your application

Add this to your app’s build.gradle:

debugCompile ''

Use debugCompile so that it will only compile in your debug build and not in your release apk.

That’s all, just start the application, you will see in the logcat an entry like follows :

  • D/DebugDB: Open http://XXX.XXX.X.XXX:8080 in your browser
  • You can also always get the debug address url from your code by calling the method DebugDB.getAddressLog();

Now open the provided link in your browser.


  • Your Android phone and laptop should be connected to the same Network (Wifi or LAN).
  • If you are using it over usb, run adb forward tcp:8080 tcp:8080

Note : If you want use different port other than 8080. In the app build.gradle file under buildTypes do the following change

debug { 

You will see something like this :

Android Debug Database – Seeing values


Android Debug Database - Seeing values

Android Debug Database – Seeing values

Android Debug Database – Editing Values


Working with emulator

  • Android Default Emulator: run adb forward tcp:8080 tcp:8080 and open http://localhost:8080
  • Genymotion Emulator: Enable bridge from configure virtual device (option available in genymotion)

Getting address With toast, in case you missed the address log in logcat

As this library is auto-initialize, if you want to get the address log, add the following method and call

public static void showDebugDBAddressLogToast(Context context) {
  if (BuildConfig.DEBUG) {
     try {
          Class debugDB = Class.forName("com.amitshekhar.DebugDB");
          Method getAddressLog = debugDB.getMethod("getAddressLog");
          Object value = getAddressLog.invoke(null);
          Toast.makeText(context, (String) value, Toast.LENGTH_LONG).show();
     } catch (Exception ignore) {


Is it really helpful right? The all the credit goes to my friend AMIT SHEKHAR

  • Support him by clicking the :star: button on the upper right of this page on GITHUB. :v:

Follow him on:

I love this library. Hope you will love too.

Keep Sharing… Keep Learning…

Page Views (1928)

6017 Total Views 1 Views Today
Share Love & Support:

About Pratik Butani

Pratik Butani is Enthusiastic Android Application Developer, Speaker at Google Developer Group – Rajkot, All time Learner of new things, Googler, Eager to Help IT Peoples. He also like to TEACH Android to New Learner and Share his knowledge to them. He is currently working as a Senior Android Developer at Soham ERP Solutions Pvt. Ltd. – Ahmedabad. He is working with Android Development since 2013 and now Flutter is on going.

Comment Your Suggestion or Appreciation:

Loading Facebook Comments ...

Leave a Reply

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