Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

browse data in Android SQLite Database

Is there a way for an Android user to browse the SQLite databases on his/her phone and view the data in the databases?

I use the SoftTrace beta program a lot. It's great but has no way that I can find to download the data it tracks to a PC.

like image 282
Justin C Avatar asked Mar 27 '10 19:03

Justin C


People also ask

How do I view data in DB browser SQLite?

To open the database in DB Browser do the following; Click on the 'open database' button in the toolbar. Navigate to where you have stored the database file on your local machine, select it and click open.

How save and retrieve data from SQLite database in Android?

We can retrieve anything from database using an object of the Cursor class. We will call a method of this class called rawQuery and it will return a resultset with the cursor pointing to the table. We can move the cursor forward and retrieve the data. This method return the total number of columns of the table.

Where does SQLite store data in Android?

The Android SDK provides dedicated APIs that allow developers to use SQLite databases in their applications. The SQLite files are generally stored on the internal storage under /data/data/<packageName>/databases.


1 Answers

The database for a specific app lives in /data/data/[packagename]/databases

The packagename is the package you define in your manifest, for instance /data/data/org.vimtips.supacount/databases/counts.db.

You can view it with adb shell and type sqlite3 /data/data/org.vimtips.supacount/databases/counts.db

Or you can pull it from the device to look at it with a third party utility, with a command like adb pull /data/data/org.vimtips.supacount/databases/counts.db ..

This assumes you have permission to view the database, which you might not have if you didn't write the app yourself... but in that case, is it actually a programming question?

like image 155
synic Avatar answered Oct 03 '22 01:10

synic