Android Debug Database

Android Debug Database

Android Debug Database is a powerful library for debugging databases and shared preferences in Android applications

Android Debug Database allows you to view databases and shared preferences directly in your browser in a very simple way

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 the shared preferences.
  • Directly add a row in the database.
  • Directly add a key-value in the shared preferences.
  • Delete database rows and shared preferences.
  • Search in your data.
  • Sort data.
  • Download database.
  • Debug Room inMemory database.

All these features work without rooting your device -> No need of rooted device

Check out another awesome library for fast and simple networking in Android

Using Android Debug Database Library in your application

Add this to your app’s build.gradle

Using the Android Debug Database with encrypted database

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

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.

Important:

  • 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

You will see something like this :

Seeing values

Editing values

Working with emulator

  • Android Default Emulator: Run the command in the terminal – 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 (we have to do like this to avoid build error in release build as this library will not be included in the release build) using reflection.

Adding custom database files

As this library is auto-initialize, if you want to debug custom database files, add the following method and call

Adding InMemory Room databases

As this library is auto-initialize, if you want to debug inMemory Room databases, add the following method and call

Find this project useful ? ❤️

  • Support it by clicking the ⭐️ button on the upper right of this page. ✌️

TODO

  • Simplify emulator issue Issue Link
  • And of course many more features and bug fixes.

Check out Mindorks awesome open source projects here

Contact – Let’s become friends

License

Contributing to Android Debug Database

All pull requests are welcome, make sure to follow the contribution guidelines when you submit pull request.

496 total views, 1 views today

(Visited 105 times, 1 visits today)

You May Also Like

About the Author: Android Developer

This is Mohammad I am Android Application Developer. I am the founder of Android Tutorial Online blog. I am programming lover and professional blogger from India. I spend most of my time doing programming and helping other programmers. This Android tutorial online blog for learning and share Android code.
My Chatbot
Powered by Replace Me