I'm a very experienced Windows programmer, but new to Android and Mobility.
Scenario: Let's say I have a list of 1,000 string items stored on the sd card, throughout the life of the app I'll want to read each item, randomly. I may read an item more than once and may alter the string and write it back.
My Question: Is it better (best practice, memory requirement) to read the items individually as needed and write back when updated, or (as I would in Windows) just load the strings into memory and write the file back when I update something.
My concerns are with the high I/O vs Memory consumption. If I access the file many times, there will be high seek and slow access, plus modifying an item would mean large writes. If I load it into memory there is a possibility that on lower end systems there will be a memory size issue?
Any experience or thoughts appreciated. How much memory does an app get?
Thanks in advance.
Scenario: Let's say I have a list of 1,000 string items stored on the sd card, throughout the life of the app I'll want to read each item, randomly. I may read an item more than once and may alter the string and write it back.
My Question: Is it better (best practice, memory requirement) to read the items individually as needed and write back when updated, or (as I would in Windows) just load the strings into memory and write the file back when I update something.
My concerns are with the high I/O vs Memory consumption. If I access the file many times, there will be high seek and slow access, plus modifying an item would mean large writes. If I load it into memory there is a possibility that on lower end systems there will be a memory size issue?
Any experience or thoughts appreciated. How much memory does an app get?
Thanks in advance.