Simple Http server that makes simulating API easy.
- Add dependency to build.gradle:
compile 'com.byoutline.androidstubserver:stubserver:1.4.1'- Create
mockfolder in your assetes directory (src/main/assetsby default in gradle). - Put there a
config.jsonfile. - You can find
config.jsondescription at MockServer. - If you have any static content(like images or .html files) put them in
mock/staticfolder.
Now you can start server by passing it context and simulated network type:
AndroidStubServer.start(this, NetworkType.EDGE);