encrypted-userprefs icon indicating copy to clipboard operation
encrypted-userprefs copied to clipboard

Java Object can be converted to Json string and can be written to Sec…

Open ogunoz opened this issue 8 years ago • 0 comments

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);

ogunoz avatar Feb 20 '17 15:02 ogunoz