I am writing an application that will have a JSON file which contains data that should be parsed and saved into ItemModel POJOs.
Let's assume for now I have a simple Activity that displays nothing at all - all I want my application to do is on startup parse the JSON and create the model objects (I'd like to figure out the basic architecture of these pieces before moving onto bigger/better things). I'd like to unit test this code before making any UI components to ensure my model classes are working OK.
So, the ItemModel is obviously a model object.
Where does the JSON parsing fall in terms of MVP? The library to parse the data (Gson, Jackson, or something else?) will surely require an Android Context to achieve this, so should I be parsing that information in the Activity? If yes, now the view knows about Model classes, which breaks MVP.
Also if I wanted to them persist the ItemModel/JSON data in a database, where would that be done? The database should technically be in the model - but again that requires a Context in order to work correctly...
Any thoughts? Thanks!
