android - Preferred method of working with logical objects -
i'm having array of objects represented json string coming api server. let's suppose have movie categories , actual movies belong each category:
[ { "id": "1", "name": "action", "movies": [ { "id": "1", "name": "movie 1", "description": "movie 1 description", "other": "other..." }, { "id": "2", "name": "movie 2", "description": "movie 2 description", "other": "other..." } ] }, { "id": "2", "name": "drama", "movies": [ { "id": "3", "name": "movie 3", "description": "movie 3 description", "other": "other..." }, { "id": "4", "name": "movie 4", "description": "movie 4 description", "other": "other..." } ] } ]
the users of android app need able browse through categories/movies. of following scenarios better regarding performance of code , optimal memory usage?
assume there many channels , categories.
1. parse json string once, create arraylists of category , movie objects each category later use them populating lists.
2. create parser few methods get_total_channels, get_channel, get_category parse contents of json string return me appropriate data populate lists.
3. other suggestion?
Comments
Post a Comment