0

I am using default application preferences to store information related to my app. Basically I want to store information in preferences even if the app get deleted. Is using default preference the best way to accomplish this. Any help appreciated. This is the code I am using

//--Init
int myvar = 12;


//--SAVE Data
SharedPreferences preferences = getPreferences(MODE_PRIVATE);  
SharedPreferences.Editor editor = preferences.edit();
editor.putInt("var1", myvar);
editor.commit();


//--READ data       
myvar = preferences.getInt("var1", 0);

Thanks

Zach
  • 9,989
  • 19
  • 70
  • 107

1 Answers1

0

This information will not be saved if the app is deleted.

One option you have is to save such information to a file, but even then the user will be able to delete it.

If you try to implement some trial version, take a look here.

Community
  • 1
  • 1
MByD
  • 135,866
  • 28
  • 264
  • 277