I have a library app where I store each book as an SqliteDatabase. I save all the book dbs on sdcard. My question is if user uninstalls my app, then do all the dbs related to this app get deleted? If no, how can I achieve this?
Thanks.
Generally No actually. When you uninstall, the APK itself (/data/app/com.example.app-1.apk) and the data (sharedprefs/db/etc) in /data/data/com.example.app is removed, but only Android >= 2.2 will also delete anything from the sdcard, and only a specific directory getExternalFilesDir() (/sdcard/Android/data/com.example.app usually).
However some earlier versions of Froyo will also delete when updating an app, which makes it rather dangerous to use for persistent storage.
It depends. If you put your files on some arbitrary place on external storage (SD card), they will not be deleted after you uninstalled your app. If you used getExternalFilesDir()
(Android 2.2+) to get the directory to store your files in, they will be deleted when the app is uninstalled. On some early versions of Froyo, there is apparently a bug that deletes the files even on app upgrades, so you might want to watch out for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With