Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ogunoz
Copy link

@ogunoz ogunoz commented Feb 20, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant