public static void setSharedPreferencesString(String APP_SAVE_NAME, Context context, String key, String value) {
SharedPreferences sp = context.getSharedPreferences(APP_SAVE_NAME, context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putString(key,value);
editor.commit();
}
public static String getSharedPreferencesString(String APP_SAVE_NAME, Context context, String key) {
SharedPreferences sp = context.getSharedPreferences(APP_SAVE_NAME, context.MODE_PRIVATE);
return sp.getString(key, "");
}
params
set(저장될 xml파일명, context, 키, 값)
get(저장된 xml파일명, context, 키)
단일저장은 이렇게 하시고
여러건 저장하시려면 JSONObject로 String형식으로 쭉 밀어넣으시고
꺼낼때 obj.get(key) 이런식으로 obj를 retrun시키시면 될거같습니다
아니면 그냥 Array형식으로 넣고 꺼내고 하셔도 되고요