开发者

Does uninstalling of an android app delete the database stored on sdcard?

I have a library app where I store 开发者_如何学Goeach 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.


answer is Yes.. everything is removed.. including SharedPreference and db.. You need not implement it by yourself.. for more red this.. http://developer.android.com/guide/topics/data/data-storage.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜