Я также могу предложить использовать универсальный lib для абстракции локального хранилища.
Вот вам пример:
Используйте этот Android lib: https://github.com/wareninja/generic-store-for-android
import com.wareninja.opensource.genericstore.GenericStore;
// step.1: transfer data fromt able into GenericStore (aka cache)
String objKey = "mytable01";
int storeType = GenericStore.TYPE_SHAREDPREF;
//keep in mind that you can also use GenericStore.TYPE_MEMDISKCACHE
// which will store on disk cache, which can be faster and better for memory allocation
LinkedHashMap<String, Object> dataMap = new LinkedHashMap<String, Object>();
// fill in all the data from you table, e.g.
dataMap.put("row1", "val1");
GenericStore.saveObject(storeType, objKey, dataMap, mContext);
// now everything is on stored/cached
// step.2: get data back
dataMap = (LinkedHashMap<String, Object>) GenericStore.getObject(storeType, objKey, mContext);
...
Социальное кодирование @ Aspiro TV