I have following ArrayList in Android:
private ArrayList<Integer> Array= new ArrayList<Integer>();
It will grow over time via add()
It will approximately contain up to 50 elements.
I want to store it persistent. I was thinking of xml, sharedpreferences and DB, but I am not sure what is the best way to go.
Saving to SharedPrefs is probably the quickest.
Here is a question that shows how to marshal an array of strings into json and then store in SharedPreferences (and read them back again).
Just change the String array to an Integer array and you’re done.
How can write code to make sharedpreferences for array in android?