@@ -75,7 +75,7 @@ You will see something like this :
7575- Android Default Emulator: run ` adb forward tcp:8080 tcp:8080 ` and open http://localhost:8080
7676- Genymotion Emulator: Enable bridge from configure virtual device (option available in genymotion)
7777
78- ### Getting address With toast, in case you missed the address log in logcat
78+ ### Getting address with toast, in case you missed the address log in logcat
7979As this library is auto-initialize, if you want to get the address log, add the following method and call
8080``` java
8181public static void showDebugDBAddressLogToast(Context context) {
@@ -92,6 +92,28 @@ public static void showDebugDBAddressLogToast(Context context) {
9292}
9393```
9494
95+ ### Adding custom database files
96+ As this library is auto-initialize, if you want to add custom database files, add the following method and call
97+ ``` java
98+ public static void setCustomDatabaseFiles(Context context) {
99+ if (BuildConfig . DEBUG ) {
100+ try {
101+ Class<?> debugDB = Class . forName(" com.amitshekhar.DebugDB" );
102+ Class [] argTypes = new Class []{HashMap . class};
103+ Method setCustomDatabaseFiles = debugDB. getMethod(" setCustomDatabaseFiles" , argTypes);
104+ HashMap<String , File > customDatabaseFiles = new HashMap<> ();
105+ // set your custom database files
106+ customDatabaseFiles. put(ExtTestDBHelper . DATABASE_NAME ,
107+ new File (context. getFilesDir() + " /" + ExtTestDBHelper . DIR_NAME +
108+ " /" + ExtTestDBHelper . DATABASE_NAME ));
109+ setCustomDatabaseFiles. invoke(null , customDatabaseFiles);
110+ } catch (Exception ignore) {
111+
112+ }
113+ }
114+ }
115+ ```
116+
95117### Find this project useful ? :heart :
96118* Support it by clicking the :star : button on the upper right of this page. :v :
97119
0 commit comments