Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
98b5603
Create CONTRIBUTING.md
amitshekhariitbhu Nov 19, 2017
9cad770
Add contribution guide
amitshekhariitbhu Nov 20, 2017
3aa6430
Update README.md
amitshekhariitbhu Nov 20, 2017
317845f
Merge pull request #76 from lyz19890927/master
amitshekhariitbhu Dec 29, 2017
29c992e
Merge pull request #65 from mstarita/Development
amitshekhariitbhu Dec 29, 2017
a73ab66
Merge pull request #94 from amitshekhariitbhu/Development
amitshekhariitbhu Dec 29, 2017
7f8879a
Update desc for encrypted database
amitshekhariitbhu Dec 29, 2017
ef4ad89
Modify equals()
amitshekhariitbhu Dec 29, 2017
c6d6b0c
Remove unused import
amitshekhariitbhu Dec 29, 2017
666716d
Merge pull request #95 from amitshekhariitbhu/development
amitshekhariitbhu Jan 8, 2018
e644f3a
Bump version
amitshekhariitbhu Jan 8, 2018
e109c64
Change debugCompile to compile
amitshekhariitbhu Jan 8, 2018
34e70e3
Merge pull request #96 from amitshekhariitbhu/development
amitshekhariitbhu Jan 8, 2018
39cb044
Update build version and add room db
amitshekhariitbhu Feb 12, 2018
e2b0cab
Add example for room database
anandgaurav10 Feb 12, 2018
c0eba58
Merge pull request #101 from amitshekhariitbhu/development
amitshekhariitbhu Feb 12, 2018
1952173
Add example for inMemory room database
anandgaurav10 Feb 12, 2018
310a794
Add example for inMemory room database
anandgaurav10 Feb 12, 2018
1fc1d23
Provide database instance through interface
anandgaurav10 Feb 12, 2018
7de8194
Add support for room inMemory databases
anandgaurav10 Feb 12, 2018
98d89bd
Disable download for inMemoryDatabase
anandgaurav10 Feb 12, 2018
4fb2328
Add desc for room inMemory db and bump version
anandgaurav10 Feb 12, 2018
ee95d2d
Merge pull request #102 from amitshekhariitbhu/development
amitshekhariitbhu Feb 12, 2018
38fd1c9
Create CHANGELOG.md
amitshekhariitbhu Feb 12, 2018
c8a5862
Update CHANGELOG.md
amitshekhariitbhu Feb 12, 2018
319e25b
Use 'debugImplementation' instead 'debugCompile'
agravelot Feb 14, 2018
1ad1f79
Merge pull request #103 from Nevax07/development
amitshekhariitbhu Feb 18, 2018
64d1a95
Merge pull request #104 from amitshekhariitbhu/development
amitshekhariitbhu Feb 18, 2018
b0dda3a
Add line for debug room inMemory db
amitshekhariitbhu Feb 21, 2018
9e39cbd
Add filesystem navigation (seen from the app perspective)
Mar 28, 2018
24d9125
Merge pull request #110 from a-d-j-i/master
amitshekhariitbhu Mar 28, 2018
2437a24
Changed compile to implementation in the .gradle files
May 15, 2018
c16b147
Add check for -wal and -shm
amitshekhariitbhu Jun 23, 2018
0353d97
Update room-db version
amitshekhariitbhu Jun 23, 2018
ad1beed
Merge pull request #117 from amitshekhariitbhu/fix-room-1.1.0
amitshekhariitbhu Jun 23, 2018
73d53e5
Update to 1.0.4
amitshekhariitbhu Jun 23, 2018
f95db2f
Update changelog
amitshekhariitbhu Jun 23, 2018
79fbefb
Add support for database delete
Jul 2, 2018
d47feb0
Update README.md
amitshekhariitbhu Aug 3, 2018
99d5ae1
Merge pull request #111 from RubenGM/implementationChange
amitshekhariitbhu Jan 18, 2019
aeb8cb1
Merge pull request #123 from peanutwolf/feature_db_delete
amitshekhariitbhu Jan 18, 2019
b8e0930
Update build tool version
amitshekhariitbhu Jan 18, 2019
40a7528
Update 2016-2019
amitshekhariitbhu Jan 19, 2019
8dafa13
Update .gitignore
friederbluemle Nov 18, 2018
90df5e9
Update Gradle plugin and wrapper
friederbluemle Nov 18, 2018
7a59ab3
Update README and fix whitespace errors
friederbluemle Nov 18, 2018
1869709
Update maven and bintray plugins
friederbluemle Nov 18, 2018
5e2e916
Update test plugins
friederbluemle Nov 18, 2018
b56c5b6
Update android-database-sqlcipher to 3.5.9
friederbluemle Nov 18, 2018
f2ea830
Merge pull request #139 from friederbluemle/update-project
amitshekhariitbhu Jan 19, 2019
2cf5313
Revert Add filesystem navigation
amitshekhariitbhu Jan 19, 2019
90a2016
Add place in contact
amitshekhariitbhu Jan 19, 2019
b056ced
Create debug-db-base
amitshekhariitbhu Jan 19, 2019
4eed116
Create debug-db-encrypt
amitshekhariitbhu Jan 19, 2019
1ca9f6c
Add dbFactory
amitshekhariitbhu Jan 19, 2019
b92c8ff
Remove support lib
amitshekhariitbhu Jan 19, 2019
46df2b8
Add upload gradle for all
amitshekhariitbhu Jan 19, 2019
a552d05
Bump version to 1.0.5
amitshekhariitbhu Feb 14, 2019
1477c4a
Create sample-app for encrypt
amitshekhariitbhu Feb 15, 2019
79802ff
Create sample-app for encrypt
amitshekhariitbhu Feb 15, 2019
0adca9a
Update gradle
amitshekhariitbhu Feb 16, 2019
e35e618
Add FailOnError False for Javadoc
amitshekhariitbhu Feb 16, 2019
56a1b9d
Add info for encrypt
amitshekhariitbhu Feb 18, 2019
5864848
Update CHANGELOG.md
amitshekhariitbhu Feb 18, 2019
e2fdfb6
Merge pull request #146 from amitshekhariitbhu/update
amitshekhariitbhu Feb 18, 2019
77e3a97
Change implementation to api
amitshekhariitbhu Feb 23, 2019
1d0ef7f
Fix select query error
amitshekhariitbhu Mar 7, 2019
3a72987
Bump version to 1.0.6
amitshekhariitbhu Mar 7, 2019
484a710
Merge pull request #150 from amitshekhariitbhu/development
amitshekhariitbhu Mar 7, 2019
23eee39
Update README.md
amitshekhariitbhu Mar 5, 2020
e8428d9
Add other open source project
amitshekhariitbhu Mar 26, 2020
a5918a5
Update README.md
amitshekhariitbhu Apr 20, 2020
608a8fe
Add .github
anandgaurav10 May 28, 2022
c37788b
Update .github
amitshekhariitbhu Sep 4, 2022
63ac007
Update README.md
amitshekhariitbhu Sep 16, 2022
e989861
Update README.md
amitshekhariitbhu Nov 17, 2022
e824bf2
Update README.md
amitshekhariitbhu Nov 17, 2022
61e4b6b
Update README.md
amitshekhariitbhu Jan 18, 2023
8793047
MIgrate to Androidx
azhon Dec 12, 2023
7a382ef
upload library to maven
azhon Dec 13, 2023
16cc48d
Update README.md
amitshekhariitbhu Jul 7, 2024
f180ce3
Merge pull request #229 from azhon/development
amitshekhariitbhu Aug 18, 2024
ee03e96
Remove Maven
amitshekhariitbhu Aug 18, 2024
cf15b20
Update version
amitshekhariitbhu Aug 18, 2024
8ea60e8
Initial implementation. Not tested yet
swordfish444 Dec 14, 2025
8e42800
Update custom ui icon
swordfish444 Dec 14, 2025
40d939a
Fix JSON pretty-print + wrapped formatting
swordfish444 Dec 14, 2025
9c3dde7
Add compact sidebar configuration
swordfish444 Dec 14, 2025
aa9860c
Add config for max number of rows for json before scrollinga
swordfish444 Dec 15, 2025
74b24ab
Add order by support to sql query
swordfish444 Dec 19, 2025
ed08ab1
Add recent sql history component
swordfish444 Dec 19, 2025
8ac61d1
Fix recent queries css
swordfish444 Dec 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: [amitshekhariitbhu]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
23 changes: 15 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Android Studio generated folders
captures/
.externalNativeBuild

# IntelliJ project files
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.idea/

# Misc
.DS_Store
/build
/captures
.externalNativeBuild
/.idea
94 changes: 94 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
Change Log
==========

Version 1.0.6 *(2019-03-07)*
----------------------------

* Fix: Fix query error
* Fix: Fix DebugDb class not found error


Version 1.0.5 *(2019-02-18)*
----------------------------

* Reduce size by taking out encrypted database library as a separate module
* New: Add support for database delete
* Changed compile to implementation
* Fix: Minor bug fixes


Version 1.0.4 *(2018-06-23)*
----------------------------

* Fix: Fix issue of Room Database


Version 1.0.3 *(2018-02-12)*
----------------------------

* New: Add support for debugging inMemory Room Database
* Add example for Room Database


Version 1.0.2 *(2018-01-08)*
----------------------------

* New: Add SqlCipher support
* New: List table name in non case sensitive alphabetical order


Version 1.0.1 *(2017-06-23)*
----------------------------

* New: Add insert row feature
* New: Add custom database files support
* New: Add method for checking isServerRunning
* New: Add pragma support
* Fix: Minor bug fixes


Version 1.0.0 *(2017-02-08)*
----------------------------

* New: Add support for editing database directly
* New: Delete rows directly
* New: Delete Shared Pref
* New: Edit shared preferences directly
* New: Add standard code for checking databases files
* New: Complete offline support
* Refactor library code


Version 0.5.0 *(2017-01-21)*
----------------------------

* New: Export DB
* New: Method to get DB version
* Fix: Fix proguard issue and other minor issues


Version 0.4.0 *(2016-11-29)*
----------------------------

* Optimizations
* Fix: Fix few minor bugs


Version 0.3.0 *(2016-11-23)*
----------------------------

* New: Add support for custom port
* Fix: Fix few minor bugs


Version 0.2.0 *(2016-11-17)*
----------------------------

* New: Add method for getting address
* Fix: Fix few minor bugs


Version 0.1.0 *(2016-11-16)*
----------------------------

Initial release.
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Contributing

1. Fork it!
2. Checkout the development branch: `git checkout development`
3. Create your feature branch: `git checkout -b my-new-feature`
4. Add your changes to the index: `git add .`
5. Commit your changes: `git commit -m 'Add some feature'`
6. Push to the branch: `git push origin my-new-feature`
7. Submit a pull request against the `development` branch
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
147 changes: 110 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@

# Android Debug Database

[![Mindorks](https://img.shields.io/badge/mindorks-opensource-blue.svg)](https://mindorks.com/open-source-projects)
[![Mindorks Community](https://img.shields.io/badge/join-community-blue.svg)](https://mindorks.com/join-community)
[![Android Weekly](https://img.shields.io/badge/Android%20Weekly-%23233-blue.svg)](http://androidweekly.net/issues/issue-233)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Android%20Debug%20Database-blue.svg?style=flat)](http://android-arsenal.com/details/1/4667)
[![API](https://img.shields.io/badge/API-9%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=9)
[![Download](https://api.bintray.com/packages/amitshekhariitbhu/maven/debug-db/images/download.svg) ](https://bintray.com/amitshekhariitbhu/maven/debug-db/_latestVersion)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://opensource.org/licenses/Apache-2.0)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/amitshekhariitbhu/Android-Debug-Database/blob/master/LICENSE)
## Android Debug Database is a powerful library for debugging databases and shared preferences in Android applications

## 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.
### 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.
Expand All @@ -27,19 +19,66 @@
* 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
## About me

Hi, I am Amit Shekhar, Co-Founder @ [Outcome School](https://outcomeschool.com) • IIT 2010-14 • I have taught and mentored many developers, and their efforts landed them high-paying tech jobs, helped many tech companies in solving their unique problems, and created many open-source libraries being used by top companies. I am passionate about sharing knowledge through open-source, blogs, and videos.

### Check out another awesome library for fast and simple networking in Android.
* [Fast Android Networking Library](https://github.com/amitshekhariitbhu/Fast-Android-Networking)
You can connect with me on:

- [Twitter](https://twitter.com/amitiitbhu)
- [YouTube](https://www.youtube.com/@amitshekhar)
- [LinkedIn](https://www.linkedin.com/in/amit-shekhar-iitbhu)
- [GitHub](https://github.com/amitshekhariitbhu)

## [Outcome School Blog](https://outcomeschool.com/blog) - High-quality content to learn Android concepts.

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

### Using Android Debug Database Library in your application
Add this to your app's build.gradle

Add this in your `settings.gradle`:
```groovy
maven { url 'https://jitpack.io' }
```

If you are using `settings.gradle.kts`, add the following:
```kotlin
maven { setUrl("https://jitpack.io") }
```

Add this in your `build.gradle`
```groovy
debugCompile 'com.amitshekhar.android:debug-db:1.0.1'
debugImplementation 'com.github.amitshekhariitbhu.Android-Debug-Database:debug-db:1.0.7'
```

Use `debugCompile` so that it will only compile in your debug build and not in your release build.
If you are using `build.gradle.kts`, add the following:
```kotlin
debugImplementation("com.github.amitshekhariitbhu.Android-Debug-Database:debug-db:1.0.7")
```

Using the Android Debug Database with encrypted database

Add this in your `build.gradle`
```groovy
debugImplementation 'com.github.amitshekhariitbhu.Android-Debug-Database:debug-db-encrypt:1.0.7'
```

If you are using `build.gradle.kts`, add the following:
```kotlin
debugImplementation("com.github.amitshekhariitbhu.Android-Debug-Database:debug-db-encrypt:1.0.7")
```

And to provide the password for the DB, you should add this in the Gradle:
DB_PASSWORD_{VARIABLE}, if for example, PERSON is the database name: DB_PASSWORD_PERSON
```groovy
debug {
resValue("string", "DB_PASSWORD_PERSON", "password")
}
```

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 :

Expand All @@ -49,11 +88,14 @@ That’s all, just start the application, you will see in the logcat an entry li

Now open the provided link in your browser.

Tip: Use the "Customize UI" link next to "Run Query" to adjust table layout (stored only 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.
* 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

```groovy
Expand All @@ -62,23 +104,25 @@ debug {
}
```




You will see something like this :

### Seeing values

<img src=https://raw.githubusercontent.com/amitshekhariitbhu/Android-Debug-Database/master/assets/debugdb.png >

### Editing values

<img src=https://raw.githubusercontent.com/amitshekhariitbhu/Android-Debug-Database/master/assets/debugdb_edit.png >

### 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)

* 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)

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.

```java
public static void showDebugDBAddressLogToast(Context context) {
if (BuildConfig.DEBUG) {
Expand All @@ -95,19 +139,21 @@ public static void showDebugDBAddressLogToast(Context context) {
```

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

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

```java
public static void setCustomDatabaseFiles(Context context) {
if (BuildConfig.DEBUG) {
try {
Class<?> debugDB = Class.forName("com.amitshekhar.DebugDB");
Class[] argTypes = new Class[]{HashMap.class};
Method setCustomDatabaseFiles = debugDB.getMethod("setCustomDatabaseFiles", argTypes);
HashMap<String, File> customDatabaseFiles = new HashMap<>();
HashMap<String, Pair<File, String>> customDatabaseFiles = new HashMap<>();
// set your custom database files
customDatabaseFiles.put(ExtTestDBHelper.DATABASE_NAME,
new File(context.getFilesDir() + "/" + ExtTestDBHelper.DIR_NAME +
"/" + ExtTestDBHelper.DATABASE_NAME));
new Pair<>(new File(context.getFilesDir() + "/" + ExtTestDBHelper.DIR_NAME +
"/" + ExtTestDBHelper.DATABASE_NAME), ""));
setCustomDatabaseFiles.invoke(null, customDatabaseFiles);
} catch (Exception ignore) {

Expand All @@ -116,25 +162,50 @@ public static void setCustomDatabaseFiles(Context context) {
}
```

### Adding InMemory Room databases

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

```java
public static void setInMemoryRoomDatabases(SupportSQLiteDatabase... database) {
if (BuildConfig.DEBUG) {
try {
Class<?> debugDB = Class.forName("com.amitshekhar.DebugDB");
Class[] argTypes = new Class[]{HashMap.class};
HashMap<String, SupportSQLiteDatabase> inMemoryDatabases = new HashMap<>();
// set your inMemory databases
inMemoryDatabases.put("InMemoryOne.db", database[0]);
Method setRoomInMemoryDatabase = debugDB.getMethod("setInMemoryRoomDatabases", argTypes);
setRoomInMemoryDatabase.invoke(null, inMemoryDatabases);
} catch (Exception ignore) {

}
}
}
```

### Find this project useful ? :heart:

* Support it by clicking the :star: button on the upper right of this page. :v:

### TODO

* Simplify emulator issue [Issue Link](https://github.com/amitshekhariitbhu/Android-Debug-Database/issues/6)
* And of course many more features and bug fixes.

### [Check out Mindorks awesome open source projects here](https://mindorks.com/open-source-projects)
You can connect with me on:

### Contact - Let's become friends
- [Twitter](https://twitter.com/amitiitbhu)
- [Github](https://github.com/amitshekhariitbhu)
- [Medium](https://medium.com/@amitshekhar)
- [LinkedIn](https://www.linkedin.com/in/amit-shekhar-iitbhu)
- [GitHub](https://github.com/amitshekhariitbhu)
- [Facebook](https://www.facebook.com/amit.shekhar.iitbhu)

[**Read all of our blogs here.**](https://outcomeschool.com/blog)

### License

```
Copyright (C) 2016 Amit Shekhar
Copyright (C) 2011 Android Open Source Project
Copyright (C) 2024 Amit Shekhar

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -150,4 +221,6 @@ public static void setCustomDatabaseFiles(Context context) {
```

### Contributing to Android Debug Database
Just make pull request. You're in!

All pull requests are welcome, make sure to follow the [contribution guidelines](CONTRIBUTING.md)
when you submit pull request.
Loading