Somewhat related to the above. Regarding retrofit....
# squarelibraries
c
Somewhat related to the above. Regarding retrofit. I have an app that gets the top 10 repos from github, but when I am on a plane for example... I have no network connection. And so retrofit/network connections don't work. In order to solve this and to keep me developing even while on a plane with no network I came up with 3 solutions and was wondering if there was any clear winner in terms of what I should do. 1. Have a runtime feature flag/dep injection to switch out the "repository" layer so I don't use the retrofit service, and instead return a hardcoded List<GithubRepo> 2. Have a runtime feature flag/dep injection to switch out the RealRetrofitService with FakeRetrofitService and so the retrofit interface stays the same, we just return some hardcoded values. 3. Use some kind of mockhttp server and some hardcoded json files so that I can basically pretend to move from production/staging environment to a "localhost" of sorts and just serve the pre-determined responses. I think all 3 have pros/cons, but the last one has the benefit of testing the most components, like our json serialization for example. I don't work on any big teams and so I'm curious if there's a defacto way that larger teams have solved this type of problem already.