Android Retrofit Design Patterns
I usually use singleton pattern with following structure : first define ServiceHelper like following : public class ServiceHelper { private static final String ENDPOINT = “http://test.com”; private static OkHttpClient httpClient = new OkHttpClient(); private static ServiceHelper instance = new ServiceHelper(); private IPlusService service; private ServiceHelper() { Retrofit retrofit = createAdapter().build(); service = retrofit.create(IPlusService.class); } public … Read more