Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens to resources when Android upgrade version of an application

My application comes with assets resources (a lot), raw resources (a few) and some other objects created by the user when using the app (including SharedPreferences).

I can't manage to understand what happens to all these resources when I install a new version of the app. Are those overridden or do they stay in the previous state (if so how can I change it) ?

like image 201
Arcyno Avatar asked Dec 05 '25 14:12

Arcyno


1 Answers

The SharedPreferences are xml files that are not bundled within the APK but are generated ones the app is installed and you use the SharedPreferences APIs. These files are created within the data folder of your app and are private to the app (unless you specified otherwise). They remain untouched during updates of the app. The only ways to remove/overwrite them is by one of the following:

a) The user un/reinstalls the app

b) The user clears the Storage (app data) from within the app settings page within the system settings

c) you remove them via the SharedPreferences apis or via the backup/restore APIs

Resources are delivered with your apk (or app bundle). Basically everything within the res/ folder. So all styles, strings, drawables, assets, etc. are replaced with the contents of the res folder of the new APK after the installation.

like image 75
peshkira Avatar answered Dec 08 '25 06:12

peshkira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!