Hi:
We are supposed to cache textual and audio data in our application until device is booted or maximum of two days, whichever happens earlier. To get a perspective on data to be cached, note that we are to store about 200 text headers containing around 10 fields, each of length 30 bytes and about 20 sound files each about a minute long.
We are getting the textual data by parsing XMLs and then we keep them in ArrayLists. The sound files are directly written inside the app storage using File I/O (and not on SDcard or Apps Cache directory).
This application is to be run on devices running Android 1.5 or later.
I understand, and please correct me if I am wrong, that we can cache the files either on SDcard or inside the application or inside applications Cache directory.
I have the following questions regarding how do we approach Caching?
- Should we persist the textual data in applications SQLite database or should we use Java Serialization mechanism and persist the List objects(which constitute Serializable components) inside the application?
- Where should we write the text data /sound files - inside application, cache or SD card?
- Can all of these be saved to applications cache directory? How big can the cache directory grow?
- Can we specify a time span to Android Runtime for which a cache is maintained? Or would we have to do this manually?
Please help and advise.
Thanks. Note: have also asked this question here.