Created
December 29, 2016 08:19
-
-
Save dharmakshetri/ac669bb0ea6e39a61f9fb7d0cc2c9996 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package co.apidemos.rest; | |
import retrofit2.Retrofit; | |
import retrofit2.converter.gson.GsonConverterFactory; | |
/** | |
* Created by dharma kshetri on 12/27/16. | |
*/ | |
public class APIClient { | |
public static final String STACKOVERFLOW_BASE_URL="https://api.stackexchange.com" ; | |
public static Retrofit retrofit=null; | |
// get stackoverflow client | |
public static Retrofit getStackOverFLowClient(){ | |
if(retrofit == null){ | |
retrofit=new Retrofit.Builder() | |
.baseUrl(STACKOVERFLOW_BASE_URL) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.build(); | |
} | |
return retrofit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment