I’ve just got my first SQLite database up and running but to reproduce it I wanted a quick way to clear the db file (so I can call my openOrCreateDatabase method again)
First question: I see all over the web /data/data/PKG/databases/ but where exactly is this stored on a windows machine? It doesn’t appear to be in my local project folder because when I do a simple git status, no *.db file is listed after the create is successful.
Also if I wanted to clear this is it a simple delete and the emulator will know to re create this? If not how can I clear it from the emulator? (thinking iPhone here where you had to delete and re-push the app to the simulator to clear this out and have the db re-created)
It’s stored inside the emulator, not on your machine (at least, not in a place that is easily accessible). Just remove it using
adb:You can also choose the “Wipe user data” option when launching the emulator AVD, or you can uninstall the application to wipe all data for just that one app:
Finally, you can also just clear user data for a given application without uninstalling it, by going to Settings > Applications > Manage Applications… Select your application, then click the “Clear Data” button.