• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps where SQlite DB getting stored Path?

Hi All,

I am new to android.I am trying to create a Database using SQlite.
Its working fine.I am able to create table, insert data, and delete table.
But actually where in my system the .db file is getting stored.
If i call the getPath() method then its giving me the path as
"/data/data/my package name/databases/database_Name"
But where exactly it is stored?

Please help me!!!


Thanks & Regards,
Ajit
 
It is stored exactly there. If you do a 'ls General Dev Discussions, How to, Guides and FAQ - Android Forums' in adb shell, you'll see it.

Hi meskiukas,

Thanks for your reply!

But I am unable to find out that folder in my system.
Even I have search my entire system and still not found.
Where is /data/data/<package_name>/databases folder present in the system? I want to navigate to that folder and want to see the .db file created by the application.

Please help me...

Thanks & Regards,
Ajit
 
That's the absolute path on the device. Use you "adb shell" to access the device and then "cd /data/data/<package_name>/databases" to get to that folder. Use the "ls" command to list the files there and "sqlite3" (plus the database name) to access it. You might want to try this on the emulator before the actual device because there are usually no extra snags to run into.
 
Thanks for your reply!

Yes, I am trying to see the .db file in emulator.Is it possible?
If possible then how?Please help me...

Thanks &Regards,
Ajit
 
Thanks for your reply!

Yes, I am trying to see the .db file in emulator.Is it possible?
If possible then how?Please help me...

Thanks &Regards,
Ajit

The /data/ folder and all its subdirectories are only accessible by a rooted phone (Well... that isn't entirely true, but for the sake of simplicity we will stick with it).

In order to view its contents, you must use the adb shell to gain temporary root access and, like stated above, list the files using 'ls' and read the datbase using 'SQLite3'.

The link that was posted earlier in the thread (a couple times actually) will explain everything you need to know.
 
Back
Top Bottom