I have a string in res/strings.xml
<string name="clientId">dfgljkwm51</string>
I want to use the string inside my retrofit interface class:
public class RetrofitInterfaces {
public interface GetAlbum{
@Headers("Authorization: Client-ID " + clientId) //Want to use the String valye here.
@GET
Call<Feed> listRepos(@Url String url);
}
}
This is how im using the retrofit call:
private void makeNetworkCall(String url) {
RetrofitInterfaces.GetAlbum service = RetrofitClientInstance.getRetrofitInstance()
.create(RetrofitInterfaces.GetAlbum.class);
Call<Feed> call = service.listRepos(url);
call.enqueue(new Callback<Feed>() {
. . .
}
How do I pass this value into my Retrofit interfaces class so that I can use the value in the headers?