简体   繁体   中英

Android uninstall app vs clear all data (not only cache)

Usually when I have some weird problem when coding for android I uninstall the app or clear all data (long click on app..) in the hope to delete cache and make it work.

I would like to know what is difference between these 2 things and is there any at all. I believe that I don't need to ever uninstall app. Deleting all data makes my app fresh and new like the baby born from mother, right? This is even better than uninstall/install because this process sometimes doesn't clean al data/cache.

So if I get confirmation here, I will stop doing uninstall/install process and do only clear data, which will save me a lot of time on the long term.

Please give me some explanations, thanks!

Yes, deleting data/cache from the app settings will make it start fresh.

Uninstalling and then installing may of may not start fresh as it will depend on what you have on your Maniftst.xml file, more precisely if android:allowBackup="true" then the app will reload the data from a backup (if any).

If android:allowBackup="false" then your app will start from scratch every time you uninstall and then install it

use in the manifest file:

android:allowBackup="false"

Setting allowBackup="false" opts an application out of both backup and restore.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM