Skip to content

Use sharedpreference to store objects and lists in a simplified approach

Notifications You must be signed in to change notification settings

perusudroid/ObjectPrefPro

Repository files navigation

ObjectPrefPro

Why to go with Local database to save lists? Here is the simplified approach of using SharedPrefences to save Lists and Objects.

Usage

Save List to Pref

 SharedPref.setSharedList("userList", userList); 

Save Object to Pref

SharedPref.getInstance().setSharedValue("User", user);

Get List from Pref

   List<User> mList = SharedPref.getSharedList("userList",User[].class);

Get Object from Pref

   User mUser = (User) SharedPref.getObject("User", User.class);

Watch the video

About

Use sharedpreference to store objects and lists in a simplified approach

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages