Im using Android Annotations Framework, specially for Rest Integration.
I have the following code.
An interface for Host configuration
public interface Host {
public String URL = "http://192.168.2.137";
}
And the annotated Interface for Rest communication.
@Rest(rootUrl = Host.URL, converters = { MappingJacksonHttpMessageConverter.class })
public interface RestClient {
@Get("/entities.json")
Entity[] allEntities();
}
and my question is, Why the value for annotation attribute Rest.rootUrl must be a constant expression? and how can i use a String resource for Rest.rootUrl ?
I wish to do something like
@EBean
public class Host{
@StringRes
String URL;
}
But is impossible with the RestClient interface.
The idea is to handle a localized rest application, suppose distinct URLs by language
http://en.myapp.com
http://es.myapp.com
I know that an Java Interface must have final properties, but, there are a way to handle a localized rootUrl value?
Thanks.