4

I am creating an Android application and in that application I created one DB.

I'm querying the values in the DB and its working fine.

I need to know where the SQLite DB is stored in my system.

Can you give me the path, please?

Thank you!

lucian.pantelimon
  • 3,673
  • 4
  • 29
  • 46
Subha
  • 741
  • 2
  • 9
  • 23
  • I didn't see you'd already asked this question; I asked same thing and got a similar response. http://stackoverflow.com/questions/1510840/where-does-android-emulator-store-sqlite-database However, what people are noting is that the state of the emulator is saved as an image when it's shut down, so you don't have access to the actual .db file from outside of the emulator/adb. – I82Much Oct 04 '09 at 05:57

3 Answers3

6

By default, the sqlite database will be in the following directory:

/data/data/YOUR_APP_NAMESPACE/databases/YOUR_DB_NAME.db

So for example, the actual database that holds SMS messages in your phone is:

/data/data/com.android.providers.telephony/databases/mmssms.db

In the emulator you can access these files directly; when connecting to a real phone however you will need root access to access the db files directly.

The android doc gives you a quick overview: http://developer.android.com/intl/de/guide/developing/tools/adb.html

Tao
  • 13,457
  • 7
  • 65
  • 76
1

"All databases, SQLite and others, are stored on the device in /data/data/package_name/databases." here

You can use android File Explorer to view/pull the file from device.

1) Have you specified any path while you create/open the database.
In my case, I have used SQLiteDatabase.openOrCreateDatabase to create database and it requires the database path as first param.

SQLiteDatabase sqldb = SQLiteDatabase.openOrCreateDatabase(DATABASE_PATH+DATABASE_NAME, null);

2) If you are using something like this
openOrCreateDatabase("test.db", this.MODE_APPEND, null);

Your database will be at /data/data/package_name/databases

bhatt4982
  • 8,024
  • 2
  • 26
  • 18
0

for accessing your database.if your are not able to find data/data/etc..

then go to eclipse select Window>open Perespective> other >DDMS and then find data/data/package/databases/your db

Andro Selva
  • 53,910
  • 52
  • 193
  • 240