Search code examples
androidandroid-room

View contents of database created with Room Persistence Library


Is there any easier way to see the contents of database created with Room Persistence Library in Android Studio?


Solution

  • Database Inspector Officially Support in Android Studio

    Previouslly, Database Inspector start to include in Android Studio 4.1 canary channel, now it is already build in with the latest version of Android Studio Arctic Fox.

    Now, Database Inspector is under the App Inspection Tab. You have to choose your connected device, then need to choose package name that you want to inspect for database.

    In the left side, show the available tables and need to double click to see table details, and it will be show in the right side.enter image description here.

    Option 1

    You can use Android-Debug-Database, and you can CRUD of your data from a browser, and then you can see your Preference data from a browser.

    Option 2

    If you don't want to use from Browser and you have to check other files,need to check your data changes, use a Genymotion Emulator.So you have to root your emulator.Try to Root your emulator, plz see in https://stackoverflow.com/a/44039429/2772552. Let me know if you are not OK.