# Is the data associated with an app cleared when an app is uninstalled?

The data associated with an app which we see when we go to Applications > Manage Applications > application, is it cleared when we hit "Uninstall" or is it left untouched by the uninstaller?

The reason why I'm asking it is, I've heard from a lot of people who first hit "Clear data" and then hit "Uninstall" mostly because they're not sure so they just ensure that they get rid of the data and then uninstall!! So do one need to hit "Clear data" before uninstalling.

-
I'm quite sure it does clear the data, but I'll test in a bit. –  Matthew Read Aug 10 '11 at 20:38
–  Al E. Aug 10 '11 at 21:45

As Matthew Read noted in a comment: yes, it is. The entire data directory is simply deleted:

C:\Console2>adb shell ls /data/data/com.chessclock.android/
lib           shared_prefs

Success

ls: /data/data/com.chessclock.android/: No such file or directory

#Reinstalled from the Market at this point


The shared_prefs directory is absent in the last ls listing because I didn't launch the app, I only reinstalled it, therefore there were no preferences yet created for it (it sets defaults on the first launch). I point this out only because it illustrates that the preferences from the previous install were not retained anywhere.
This is probably obvious, but... Some apps that have the permission "Modify/delete USB storage" may use the internal memory for caches etc. and may not necessarily remove the data once the app is deleted. I've seen apps to write in not so obvious directories like /sdcard/data/[package name]/, but mostly they use /sdcard/[app name]/ which is easy to spot and delete.
Data written to the sdcard like that also won't be deleted by the Clear Data button, of course, so either way you'd need to remove it manually. Good point, though. –  eldarerathis Aug 11 '11 at 13:06