i need to store a variable in phone memory, and later get that variable to show it.
Please, give me some information or anything to search. Thanks
static SharedPreferences settings;
static SharedPreferences.Editor editor;
settings = this.getPreferences(MODE_WORLD_WRITEABLE);
editor = settings.edit();
editor.putString("Variablenname_1", "1");
editor.commit();
if you want so get the value use:
String val = settings.getString("Variablenname_1", "0");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With