I have an Array with integer values. It will grow over time. It will have approximately up to 50 values.
I want to store the array persistent and thus I thought about storing it in SharedPreferences.
I know that no complex types can be stored in it, but I also heard about to serialise the Array and then store it in SharedPreferences.
Can someone give me a hint or even better sample code how to do that?
I have an Array with integer values. It will grow over time. It will
Share
Not very efficient way, but will get the job done:
Then later you can retrieve these values by grabbing the KEY_COUNT value from the prefs, then filling your empty array with
values2[i] = getInt(KEY_VAL_PREFIX + i, 0)calls.