I need to remove first entry of SharedPreferences in my Android app
I know I can use remove("key") but in this case I don’t know the key, need it to be dynamic
The reason is that I’m storing array with 10-value capacity. When SharedPreferences contains 10 instances, it removes the first and adds new.
I would store your preference as a single entry as a json list or a simple comma separated list. Thereby it is much easier to work with.
For JSON you can use the gson library (part of android 3.0+) or download it from: http://code.google.com/p/google-gson/