An easy way to mock an API response using Retrofit, OkHttp, and Interceptor

Photo by Alvaro Reyes on Unsplash

Many times, Android developers need to start implementing features even when the backend is not ready yet. An easier way is to ask the backend developer to create the API service and just send fake content for the sake of it. The underlying notion is that we are not backend developers and it is not our responsibility to provide the endpoint.

--

--

Senior Program Manager at Diconium • Dev Advocate • Talks about Tech, DevRel, Soft skills, Careerintech & Partnerships • Co-Organizer @DevRelMunich

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Wahib Ul Haq

Senior Program Manager at Diconium • Dev Advocate • Talks about Tech, DevRel, Soft skills, Careerintech & Partnerships • Co-Organizer @DevRelMunich