views:

106

answers:

3

If a user uninstalls an app from his phone, which data is explicitly deleted?

I know that preferences are deleted. What about files on the sd card and about databases created by this app?

If the data on the sd card is not deleted how can I avoid cluttering the users phone if I write larger amounts of data, like images on the sd card?

+1  A: 

In my experience...and I will gladly be corrected.

Databases and files residing in com.example.youapp get deleted. As for the SD-CARD I doubt they will get deleted. What if your app created pictures, then all their pictures would be deleted when the user uninstalled.

As for handling deleting this stuff on uninstall...that is a good question. There may be some sort of handler you can invoke when your app gets uninstalled to help do some extra stuff. Somewhere in the Manifest sounds like it might be a candidate.

jax
+4  A: 

This was previously addressed here, too:

http://stackoverflow.com/questions/1989931/android-delete-app-associated-files-from-external-storage-on-uninstall

Based on that, it looks like files written to the sdcard are not able to be deleted upon application removal.

If this is the case, it seems like a pretty major oversight in the architecture.

ydant
A: 

It depends on how the app was written. Since Android is open source, you cannot predict how the developer decided to handle it. You might get an answer here which begins "most aps...", but do not trust any which begins "all apps...".

If in doubt, try to contact the app author (help/about may have an email address) or examione the SD card contents on your PC.

But don't sell your Android without a factory reset, otherwise the new owner might be posting here asking "I just installed a new app and it seems to have someone else's data - why is that?"

Mawg
Yeah tanks :) I'm the developer ;)
Janusz