Skip to content

Simple library to persist typed objects and primitive values in SharedPreferences using Google Gson.

License

Notifications You must be signed in to change notification settings

cavarzan/gson-preferences-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gson-preferences-storage

Simple library to persist typed objects and primitive values in SharedPreferences using Google Gson.

Usage:


  // Default Storage object, package-named SharedPreferences and Simple Gson
  Storage storage = Storage.create(context);

  // Default Storage object, SharedPreferences loaded from your name and Simple Gson
  Storage storage = Storage.create(context, "My Shared Preferences Name");

  // Default Storage object, SharedPreferences loaded from your name and Simple Gson
  Storage storage = Storage.create(sharedPreferencesInstance, gsonInstance);

  After initialization, you can use in your code calling:
  Storage storage = Storage.get();

  It's recommended to create the Storage object inside your application class, and use it as singleton inside the application.

About

Simple library to persist typed objects and primitive values in SharedPreferences using Google Gson.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages