3636### Using Android Debug Database Library in your application
3737Add this to your app's build.gradle
3838``` groovy
39- debugCompile 'com.amitshekhar.android:debug-db:1.0.2 '
39+ debugCompile 'com.amitshekhar.android:debug-db:1.0.3 '
4040```
4141
4242Use ` debugCompile ` so that it will only compile in your debug build and not in your release build.
@@ -95,7 +95,7 @@ public static void showDebugDBAddressLogToast(Context context) {
9595```
9696
9797### Adding custom database files
98- As this library is auto-initialize, if you want to add custom database files, add the following method and call
98+ As this library is auto-initialize, if you want to debug custom database files, add the following method and call
9999``` java
100100public static void setCustomDatabaseFiles(Context context) {
101101 if (BuildConfig . DEBUG ) {
@@ -116,6 +116,26 @@ public static void setCustomDatabaseFiles(Context context) {
116116}
117117```
118118
119+ ### Adding InMemory Room databases
120+ As this library is auto-initialize, if you want to debug inMemory Room databases, add the following method and call
121+ ``` java
122+ public static void setInMemoryRoomDatabases(SupportSQLiteDatabase . .. database) {
123+ if (BuildConfig . DEBUG ) {
124+ try {
125+ Class<?> debugDB = Class . forName(" com.amitshekhar.DebugDB" );
126+ Class [] argTypes = new Class []{HashMap . class};
127+ HashMap<String , SupportSQLiteDatabase > inMemoryDatabases = new HashMap<> ();
128+ // set your inMemory databases
129+ inMemoryDatabases. put(" InMemoryOne.db" , database[0 ]);
130+ Method setRoomInMemoryDatabase = debugDB. getMethod(" setInMemoryRoomDatabases" , argTypes);
131+ setRoomInMemoryDatabase. invoke(null , inMemoryDatabases);
132+ } catch (Exception ignore) {
133+
134+ }
135+ }
136+ }
137+ ```
138+
119139### Find this project useful ? :heart :
120140* Support it by clicking the :star : button on the upper right of this page. :v :
121141
0 commit comments