Some domain names can contain something like '.abcdef" (and more...) (sample : ws.mobile.mycompany instead of ws.mobile.mycompany.com)
But in Android 4.x.x, the setApiDomain causes a freeze with such domain name.
public Builder setApiDomain(String domain){
if (domain==null) mApiDomain = "10.0.2.2";
if(Patterns.IP_ADDRESS.matcher(domain).matches()||
Patterns.DOMAIN_NAME.matcher(domain).matches()){
mApiDomain = domain;
} else {
throw new RuntimeException("Invalid host name: "+domain+". Hint: don't specify protocol (eg. http) or path");
}
return this;
}
The issue is Patterns.DOMAIN_NAME.matcher(domain).matches() : the Patterns.DOMAIN_NAME is more limited in Android 4.x.x
Here are the source code from Android:
I tried to use a new method to force the API Domain without check, it works fine:
public Builder setApiDomainWithoutCheck(String domain){
mApiDomain = domain;
return this;
}
Some domain names can contain something like '.abcdef" (and more...) (sample : ws.mobile.mycompany instead of ws.mobile.mycompany.com)
But in Android 4.x.x, the setApiDomain causes a freeze with such domain name.
The issue is Patterns.DOMAIN_NAME.matcher(domain).matches() : the Patterns.DOMAIN_NAME is more limited in Android 4.x.x
Here are the source code from Android:
I tried to use a new method to force the API Domain without check, it works fine: