currently I'm working on an android application. The data used by this app is provided by a web server. Now I want to test the app and play a bit with it using test data, cause the real data from the server changes dynamically and I'm not always able to test particular functions or to look at particular things. Two options which come in my mind are:
Store test data in a local database / file. Add a global variable like boolean useTestData and change the web server connectors such they don't contact the web server in case useTestData is set to true. Disadvantage is, that I have to modify all connectors with code, which won't be used in the released app.
Implement second web server API for testing purpose, which will provide only static test data that I need. In case the global variable is set to true, the test API will be accessed.
I think the second way is the better choice. Maybe there is some other alternative way to do so? What do you think about this?
Thanks in advance.