Reputation: 761
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!
Upvotes: 4
Views: 1724
Reputation: 1
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
Upvotes: 0
Reputation: 13996
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
Upvotes: 6
Reputation: 8054
"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
Upvotes: 1