On an Android Device where is located SQLite database, created by Room library

Issue

Where is located an app SQLite database created by Room library on a device?

Context:
I have an app which create and use a Room database. To debug the database I would like to open it in a SQLite viewer app but I don’t know where the database is located on a testing device.

Solution

Whether you use Room, OrmLite or SQLite in Android all are located within databases folder of application package.

You can access the databases folder by following below steps.

  • View > Tool Windows > Device File Explorer

enter image description here

From Device File Explorer go to data folder in which all the application packages are stored. Make sure that Emulator or device is connected.

  • data > data

enter image description here

Then, find you application package and go to your database.

  • com.company.my > databases > yourdatabasename.db

enter image description here

You can then save your database in your computer and do anything you want with it.

enter image description here

I use SQLiteBrowser to browse the database.

Answered By – musooff

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published