Oh Danny Boy
Oh Danny Boy

Reputation: 4887

How to delete cached Android database?

I had a database being loaded up at application startup. I made some changes to the DB, deleted the app from the emulator (wipe user data), and deleted it from my phone. Cleaned the project from the menu. However, when I run it, the old DB is still there. I am testing this notion by pulling the file in DDMS and opening it up in SQLite Explorer.

How can I remove this old cache?

Upvotes: 1

Views: 1367

Answers (2)

WindsurferOak
WindsurferOak

Reputation: 4907

If you're using eclipse you can do the following, in addition to what Michele has proposed:

  • Go to the DDMS page in eclipse
  • Find the "file explorer" tab.
  • Browse your way to /data/data/[Your App's Name]/databases/
  • Select the database
  • Delete

Also, each emulator will have its own database, so if you have set-up different emulators (for different screen densities for example), you would have to delete the database for each one of them.

Upvotes: 1

Michele
Michele

Reputation: 6131

The Database is located under /data/data/[apk-package-name]/databases/

You can connect to the shell of the emulator and try to delete the databases inside this path

$ adb -s emulator-5554 shell

Upvotes: 1

Related Questions