Sunday, July 10, 2016

uninstallation - 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.



Answer



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

C:\Console2>adb uninstall com.chessclock.android
Success

C:\Console2>adb shell ls /data/data/com.chessclock.android/
ls: /data/data/com.chessclock.android/: No such file or directory

#Reinstalled from the Market at this point


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

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.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...