Skip to content

Instantly share code, notes, and snippets.

@codenameone
Created February 29, 2016 12:49
Show Gist options
  • Save codenameone/fc7693ef69108e90057c to your computer and use it in GitHub Desktop.
Save codenameone/fc7693ef69108e90057c to your computer and use it in GitHub Desktop.
Sample code for the Codename One Preferences API
// save a token to storage
Preferences.set("token", myToken);
// get the token from storage or null if it isn't there
String token = Preferences.get("token", null);
@codenameone
Copy link
Author

Sample usage of the Preferences class.

From the Codename One project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment