Use Android-Debug-Database to view the App Database in the browser.
Usage reference:Http://www.jianshu.com/p/89ccae3e590b
Source Code address:Https://github.com/amitshekhariitbhu/Android-Debug-Database
Features:
Add dependency:
Add the following code in your build. gradle:
1 debugCompile 'com. amitshekhar. android: debug-db: 1.0.0'
OK. Now you do not need any other code.
Usage:
1>Run the program directly under the Debug 'app' without filling in any code. Check the logcat with this line:
1 D/DebugDB: Open http://xxx.xxx.xxx.xxx: 8080
Click to open the address link on the webpage.
2>Add the following code to the project file:
1 DebugDB. getAddressLog ();
Then Run the program in the Run 'app '. Check the logcat line as follows:
1 D/DebugDB: Open http://xxx.xxx.xxx.xxx: 8080
Click to open the address link on the webpage.
Note:
1>Use a port other than 8080. In the build. gradle file in buildTypes, make the following changes:
1 debug {2 resValue( “ string ” , “ PORT_NUMBER ” , “ 8081 ” )3 }
2>When the Android device is used to test the App:
Android phones and computers should be connected to the same network (Wifi or LAN ).
3>When using a simulator to test the App:
Android default simulator: Run adb forward tcp: 8080 tcp: 8080 and enable http: // localhost: 8080.
Genymotion Emulator: Enable bridging from the configured Virtual Device (options available in genymotion ).