Jose Gonzalez
Jose Gonzalez

Reputation: 1478

Erase app external files on uninstall Android 2.3

I've use the Android method Context.getExternalFilesDir() and save some data from my app on a external file. So far, when I uninstall the app on an Android 4.4, this external files are being erased as well, but this is not the case for Android 2.3.

I was wondering if this is possible and if so, how would I achieve this kind of behavior in Android 2.3.

Regards Jose

Upvotes: 1

Views: 113

Answers (1)

Gabe Sechan
Gabe Sechan

Reputation: 93542

4.4 changed the behavior for the SD card. Prior to that, data on the SD card had no protections, any app could read or write anywhere. Afterwards, files and directories were protected so only the app that created them could read or write them. Because 2.3 doesn't track who owns the files, it can't delete them when uninstalling. The closest thing you could do is delete the files yourself on a regular basis.

Upvotes: 1

Related Questions