This question already has an answer here:
- Debugging sqlite database on the device 15 answers
I have a set of data in an SQLite database. I need to view the database on a device. How do I do that?
I have checked in ddms mode. The data in file explorer is empty.
Follow these steps
1>Download the *.jar file from here .
2>Put the *.jar file into the folder eclipse/dropins/ and Restart eclipse.
3>In the top right of eclipse, click the DDMS icon.
4>Select the proper emulator in the left panel.
5In the File Explorer tab on the main panel, go to /data/data/[YOUR.APP.NAMESPACE]/databases.
6>Underneath the DDMS icon, there should be a new blue icon of a Database light up when you select your database. Click it and you will see a Questoid Sqlite Manager tab open up to view your data.
*Note: If the database doesn't light up, it may be because your database doesn't have a *.db file extension. Be sure your database is called [DATABASE_NAME].db
*Note: if you want to use a DB without .db-Extension:
-Download this Questoid SqLiteBrowser: Download fro here.
-Unzip and put it into eclipse/dropins (not Plugins).
-Check this for more information Click here.
Using file explorer, you can locate your database file like this:
Then you can use any SQLite fronted to explore your database. I use the SQLite Manager Firefox addon. It's nice, small, and fast.
The best way to view and manage your Android app database is to use the library DatabaseManager_For_Android.
It's a single Java activity file; just add it to your source folder. You can view the tables in your app database, update, delete, insert rows to you table. Everything from inside your app.
When the development is done remove the Java file from your src folder. That's it.
You can view the 5 minute demo, Database Manager for Android SQLite Database .
If you don't want to use
and just want the database file in your SDCard, this is the solution.
copy the class DatabaseUtil.java in your project
and simply call copyDatabaseToExtStg() method from any activity in your app
this will copy the database folder at location sdcard/shanraisshan/your_database_file
For further detailed explanation check Android-Database-Viewer on Github. https://github.com/shanraisshan/Android-Database-Viewer
Although this doesn't view the database on your device directly, I've published a simple shell script for dumping databases to your local machine:
It performs two distinct methods described here:
\r
characters that some devices output to the shell.From here you can use a variety of CLI or GUI SQLite applications, such as
sqlite3
orsqlitebrowser
, to browse the contents of the database.Hope this helps you
Using Terminal First point your location where andriod sdk is loacted
then check the list of devices attached Using
and then run this command to copy the file from device to your system
You can find the database file in this path