@@ -0,0 +1,2833 @@
+package com.hellosanket.sol;%0A%0Aimport android.content.Context;%0Aimport android.content.SharedPreferences;%0A%0Aimport java.util.Objects;%0A%0A/**%0A * Created by sanket on 5/23/16.%0A */%0Apublic class DataWrapper %7B%0A%0A    public static void saveInt(final Context context,%0A                       final String db,%0A                       final String key,%0A                       final int value) %7B%0A        SharedPreferences pref = context%0A                .getApplicationContext()%0A                .getSharedPreferences(db, context.MODE_PRIVATE);%0A%0A        SharedPreferences.Editor ed = pref.edit();%0A        ed.putInt(key, value);%0A        ed.commit();%0A    %7D%0A%0A    public static int readInt(final Context context,%0A                              final String db,%0A                              final String key,%0A                              final int default_value) %7B%0A        SharedPreferences pref = context%0A                .getApplicationContext()%0A                .getSharedPreferences(db, context.MODE_PRIVATE);%0A        return pref.getInt(key, default_value);%0A    %7D%0A%0A    public static void saveString(final Context context,%0A                               final String db,%0A                               final String key,%0A                               final String value) %7B%0A        SharedPreferences pref = context%0A                .getApplicationContext()%0A                .getSharedPreferences(db, context.MODE_PRIVATE);%0A%0A        SharedPreferences.Editor ed = pref.edit();%0A        ed.putString(key, value);%0A        ed.commit();%0A    %7D%0A%0A    public static String readString(final Context context,%0A                              final String db,%0A                              final String key,%0A                              final String default_value) %7B%0A        SharedPreferences pref = context%0A                .getApplicationContext()%0A                .getSharedPreferences(db, context.MODE_PRIVATE);%0A        return pref.getString(key, default_value);%0A    %7D%0A%0A    public static void savelong(final Context context,%0A                                  final String db,%0A                                  final String key,%0A                                  final long value) %7B%0A        SharedPreferences pref = context%0A                .getApplicationContext()%0A                .getSharedPreferences(db, context.MODE_PRIVATE);%0A%0A        SharedPreferences.Editor ed = pref.edit();%0A        ed.putLong(key, value);%0A        ed.commit();%0A    %7D%0A%0A    public static long readlong(final Context context,%0A                                    final String db,%0A                                    final String key,%0A                                    final long default_value) %7B%0A        SharedPreferences pref = context%0A                .getApplicationContext()%0A                .getSharedPreferences(db, context.MODE_PRIVATE);%0A        return pref.getLong(key, default_value);%0A    %7D%0A%0A%0A%7D%0A

add a wrapper to do shared pref read/write