All Projects β†’ amitshekhariitbhu β†’ Android Debug Database

amitshekhariitbhu / Android Debug Database

Licence: apache-2.0
A library for debugging android databases and shared preferences - Make Debugging Great Again

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to Android Debug Database

PowerPreference
πŸ’Ύ A Powerful library to control and simplify the usage of shared preference in Android.
Stars: ✭ 95 (-98.8%)
Mutual labels:  debugging, sharedpreferences, debug, android-debug-database, room-persistence-library, room-database
Android Remote Debugger
A library for remote logging, database debugging, shared preferences and network requests
Stars: ✭ 132 (-98.34%)
Mutual labels:  database, debugging, debug, sharedpreferences
Android Mvvm Architecture
This repository contains a detailed sample app that implements MVVM architecture using Dagger2, Room, RxJava2, FastAndroidNetworking and PlaceholderView
Stars: ✭ 2,720 (-65.77%)
Mutual labels:  database, room, android-debug-database, mindorks
Roomasset
A helper library to help using Room with existing pre-populated database [DEPRECATED].
Stars: ✭ 138 (-98.26%)
Mutual labels:  database, sqlite, room
Iosdebugdatabase
make it easy to debug databases in iOS applications iOS debug database
Stars: ✭ 219 (-97.24%)
Mutual labels:  database, sqlite, debug
Quiz-App
A Quiz Android application πŸ“± built using Java ♨️ and showing best practices of πŸ› οΈ Room
Stars: ✭ 33 (-99.58%)
Mutual labels:  sharedpreferences, sqlite, room-persistence-library
Nano Sql
Universal database layer for the client, server & mobile devices. It's like Lego for databases.
Stars: ✭ 717 (-90.98%)
Mutual labels:  database, sqlite
Bugsnag Laravel
Bugsnag notifier for the Laravel PHP framework. Monitor and report Laravel errors.
Stars: ✭ 746 (-90.61%)
Mutual labels:  debugging, debug
Posts Mvvm Daggerhilt Dynamic Feature Rxjava3 Flow Sample
Posts Api sample with Kotlin RxJava3/Coroutines Flow, Clean Architecture, Offline first/last with Room + Retrofit2, Dagger Hilt, Dynamic Feature Modules, Static Code Analysis, Gradle DSL, MockK+ MockWebServer with Test Driven Development including Api and Database tests
Stars: ✭ 41 (-99.48%)
Mutual labels:  room, room-persistence-library
Chronophore
Desktop app for tracking student sign-ins in a tutoring center.
Stars: ✭ 6 (-99.92%)
Mutual labels:  database, sqlite
Android Kotlin Mvp Architecture
This repository contains a detailed sample app that implements MVP architecture in Kotlin using Dagger2, Room, RxJava2, FastAndroidNetworking and PlaceholderView
Stars: ✭ 615 (-92.26%)
Mutual labels:  database, room
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 7,712 (-2.94%)
Mutual labels:  database, sqlite
Base Mvvm
App built to showcase basic Android View components like ViewPager, RecyclerView(homogeneous and heterogeneous items), NavigationDrawer, Animated Vector Drawables, Collapsing Toolbar Layout etc. housed in a MVVM architecture
Stars: ✭ 18 (-99.77%)
Mutual labels:  room, room-persistence-library
Node In Debugging
γ€ŠNode.js θ°ƒθ―•ζŒ‡ε—γ€‹
Stars: ✭ 6,139 (-22.74%)
Mutual labels:  debugging, debug
Node Sqlite
SQLite client for Node.js applications with SQL-based migrations API written in Typescript
Stars: ✭ 642 (-91.92%)
Mutual labels:  database, sqlite
Bugsnag Android
Bugsnag crash monitoring and reporting tool for Android apps
Stars: ✭ 990 (-87.54%)
Mutual labels:  debugging, debug
Easydb
Easy-to-use PDO wrapper for PHP projects.
Stars: ✭ 624 (-92.15%)
Mutual labels:  database, sqlite
Bookshelf
A simple Node.js ORM for PostgreSQL, MySQL and SQLite3 built on top of Knex.js
Stars: ✭ 6,252 (-21.32%)
Mutual labels:  database, sqlite
Android Architecture Components Kotlin
Clean code App with Kotlin and Android Architecture Components
Stars: ✭ 23 (-99.71%)
Mutual labels:  room, room-persistence-library
Unitydbgdraw
DbgDraw is an API that provides the ability to render various 2D and 3D shapes for visual debugging purposes.
Stars: ✭ 20 (-99.75%)
Mutual labels:  debugging, debug

Android Debug Database

Mindorks Mindorks Community Mindorks Android Store API Download Open Source Love License

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 our other Open Source Projects

Using Android Debug Database Library in your application

Add this to your app's build.gradle

debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'

Using the Android Debug Database with encrypted database

debugImplementation 'com.amitshekhar.android:debug-db-encrypt:1.0.6'

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

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 :

  • 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

debug {
    resValue("string", "PORT_NUMBER", "8081")
}

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.

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

       }
    }
}

Adding custom database files

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

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, Pair<File, String>> customDatabaseFiles = new HashMap<>();
            // set your custom database files
            customDatabaseFiles.put(ExtTestDBHelper.DATABASE_NAME,
                    new Pair<>(new File(context.getFilesDir() + "/" + ExtTestDBHelper.DIR_NAME +
                                                    "/" + ExtTestDBHelper.DATABASE_NAME), ""));
            setCustomDatabaseFiles.invoke(null, customDatabaseFiles);
        } catch (Exception ignore) {

        }
    }
}

Adding InMemory Room databases

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

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 ? ❀️

  • 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

   Copyright (C) 2019 Amit Shekhar
   Copyright (C) 2011 Android Open Source Project

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   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.

Contributing to Android Debug Database

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].