gitmyhub

Android-Debug-Database

Java ★ 8.7k updated 4mo ago

A library for debugging android databases and shared preferences - Make Debugging Great Again

A one-line Android library that starts a local web server in debug builds so you can view, query, and edit your app's SQLite databases and settings in a browser, no root access or special tools required.

JavaAndroidSQLsetup: easycomplexity 2/5

Android Debug Database is a Java library that lets Android developers view and edit their app's local database and settings through a web browser while the app is running. Normally, inspecting what's stored in an Android app's database requires special tools, a rooted device, or digging through developer menus. This library removes that friction.

After adding one line to your project's build configuration, the library starts a small local web server when you launch the app in debug mode. It prints the server address to the log output. You open that address in a browser on the same Wi-Fi network, and you get a view of all the databases and app settings (called shared preferences) that the app uses.

From the browser interface you can read all stored data, run SQL queries to search or filter records, edit values directly, add new rows or settings entries, delete records, sort and search through the data, and download the entire database file. No rooted device is needed.

The library is built specifically for debug builds. When you use the recommended debugImplementation dependency setting, it is automatically excluded from production builds, so it does not ship to end users. If you need to debug an encrypted database, a separate variant of the library handles that with a password provided through the build configuration.

The library also works with Android emulators via a port-forwarding command. Additional setup code lets you expose custom database file paths and in-memory Room databases, which are databases that exist only in RAM and are normally harder to inspect. The library auto-initializes on app start with no extra code required.

Where it fits