encrypted-userprefs
encrypted-userprefs copied to clipboard
Java Object can be converted to Json string and can be written to Sec…
Hey, The conversion between JSON string and Java Objects are easy using com.google.gson.Gson. I added two methods to your class that make saving and getting Java Objects to your SecurePreferences possible. // Usage // Put SecurePreferences preferences = new SecurePreferences(context, "my-preferences", "SometopSecretKey1235", true); preferences.put("someKey", anObject); // Get AnObject anObject = preferences.getObject("someKey", AnObject.class);