I have a hard-coded baseurl. I want to replace this hard-coded base url with the url returned from the web service I went to using the hard-coded url. I use retrofit 2 in my app.
return new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(new Utils.QualifiedTypeConverterFactory(
GsonConverterFactory.create(),
SimpleXmlConverterFactory.create()))
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.client(okHttpClient)
.build();
The Hard-coded BASE_URL looks like this:
public static String BASE_URL = "https://wstest.mesan.com";
And this is the url returning from the web service I called using this hard-coded url: "http://wsapi.mesan.com" Then changing baseurl will be used throughout the application.
How can i do this?
Any idea?