How to view the tables and data of a SQLite database in an Android app at debug runtime?
You can follow the instructions below:
1) Expand the project code in the file Gradle
2) Redirect terminal port
3) Output on Browser: SQLLite tables
1) Android Gradle-> Gradle expand
In the Android app below
Gradle Scripts-> build.gradle
The following entry in the block dependencies {..} add
//-----< debug:
sqlite >------
|
2) Android Studio -> Terminal
Redirect the USB port
Entering in Android Studio -> Terminal
adb forward tcp:8080 tcp:8080 |
* If the adb command is not recognized, you have to add it to the Windows 10 -> Environment Variables -> PSPath
Result of the terminal server
C:\_Daten\Desktop\VS_Projects\Android\demo\Demo06_Database01>adb forward tcp:8080 tcp:8080 * daemon not running. starting it now at tcp:5037 * * daemon started successfully * |
3) Android Studio-> Logcat
In the search enter debugdb
2018-09-28 19:07:53.962 6664-6664/com.codedocu.demo06_database01 D/DebugDB: Open http://192.168.178.23:8080 in your browser |
Then under loccat
2018-09-28 19:07:53.962 6664-6664/? D/DebugDB: Open http://192.168.178.23:8080 in your browser 2018-09-28 19:33:40.346 8111-8111/com.codedocu.demo06_database01 D/DebugDB: Open http://192.168.178.23:8080 in your browser |
4) Browser http: xxxx: 8080
SQLite tables
If you click on the link in the Android Terminal, Google Chrome Browser will automatically start and the website of the Android smartphone will open
Here is the Android Debug Database
[Lnk "http://192.168.178.23:8080" /]
Under Tables you will find the tables that you have stored in the current database.
The Sqlite database is automatically displayed, which is loaded to the debug process.