Reinstalls the application to remove SQLiteDatabase or SharedPreferences

I wanted to know if reinstalling the application removes SQLiteDatabase or SharedPreferences in Android. Also under what circumstances is he removed. The application will be downloaded from the server and installed. If it is deleted, what should I do to make a backup and restore it again?

Please, help...

+4
source share
3 answers

No ... The database and SharedPreferences will not be deleted if you reinstall the application. They are deleted when some delete it or clear data from the device settings menu ...

+10

( ) , . , , .

Android Debug Bridge , -r (adb install your.apk/adb install -r your.apk)

+5

SharedPreferences SQLiteDatabase ,

  • .
  • ( ).

SharedPreferences SQLiteDatabase, , BackupAgentHelper . SharedPreferenceBackupHelper SharedPreferences SQLiteDatabase ( ). , .

:

BackupAgentHelper
SharedPreferenceHelper ( , )

, . , :) .

+1

Source: https://habr.com/ru/post/1525790/


All Articles