Cristian says here : your application data will remain when the user installs updates.
But it must be with the same package name to detect as an update to the previous application.
EboMike's Android User Warning that updating an application could result in data loss from an old version of the application? He speaks:
Quite frankly, data loss due to an update is unacceptable.
Edit
Usually , SharedPreferences (as well as other user data) will be saved during the update process, but sometimes due to some "unknown" problem, the data may be lost, and I think this is not under your control. So, you can just believe that SharedPreferences will be saved ( see here ).
So, if you want to avoid cleaning user data during the upgrade, you need to save the main data in external storage (it can be removable storage media such as an SD card or internal non-removable storage.), And not privately for your App.Or, by at least remove data backups for the user before updating. Then, when you first launch your (updated) application, check if there is a backup file in the external storage or not.
If you like to know what you need / can happen when updating the application? , for this there was no good description. This is complex and relative with Android Security , Application signing , copy protection and other topics. I mean, if you change the state of your application in any of the above fields, it will lead to a different result.
For example, if you CHANGED COPY PROTECTION FROM ON to OFF OR OFF to ON , your application will be updated, but all your general settings will be lost, access to files will be impossible and ....
You, although you must take care of the conditions, invoke the new application being considered as an update for the previous application (see Things That Cannot Change ).
You should also take care of your code, this may be due to the deletion of your database data (see updating the application with SQLite preinstalled ).
But ultimately, if you be careful, you can say:
The update process replaces only the apk file (and therefore, what is in it for drawables examples, ...) and does not change the databases, sharedpreferences and any other files created at run time (perhaps in this case, a new application is installed with UID equal to the UID of the previous application).
You can see these pages for more details:
Reference!? Updating our application on the market deletes saved SharedPreferences.
Copy protection in the market completely interrupts access to files after updating
Can someone explain the process of updating the application?