I am looking for the smartest (and most effective) way to implement the following project:
I want to develop an app that accesses to about 100 different sport exercises. The exercises are available in an xml-file. The access to the exercises can be in different ways on different activities:
- show all
- show only exercises of a special category
- mark as favorite and show favorites
- show details of an exercise
- sort
- etc.
Loading the xml-file and creating the exercise-objects is already working and its not problem. But I think about the most effective way to implement things like that. Thinking about RAM and performance...
- Parsing the xml-file once the app is started, creating the 100 objects and dealing with them during the app is running (of course ensure to reload the data if the objects where cleaned up by the garbage collector in the meantime). Is this possible and recommended? How can such a central point, where I can pick up the objects in all activities, look like? Can I find an example anywhere?
- Parsing the xml-file every time an activity (that is using the exercises in any way) is created?
- completely different way?
Maybe someone can give me a keyword.