Skip to content Skip to sidebar Skip to footer

How To Delete A File's On Uninstall The Android Application?

Possible Duplicate: How to delete files created by the application on uninstall? we have a made a streaming media player in android. in my application send a event file in every

Solution 1:

If it's stored on SD card:

If you're using API Level 8 [Android 2.2] or greater, use getExternalFilesDir() to open a File that represents the external storage directory where you should save your files. [...] If the user uninstalls your application, this directory and all its contents will be deleted.

http://developer.android.com/guide/topics/data/data-storage.html#filesExternal

Files in the directory /data/data/app.package.name (internal storage) will be removed on uninstall as mentioned in Android - Preserve or delete files created by the application on uninstall

Post a Comment for "How To Delete A File's On Uninstall The Android Application?"