I have a very specific Android HTC Rezound issue and I'm hoping someone may have a solution.
While using the HTC Rezound AND connected to a 4g network I recieve an unknown host exception error when attempting to connect to our servers using HttpURLConnection. The strange thing about this issue is that if the phone is on Wi-Fi or 3g the connections to the server work perfectly. Only 4g has the issue. I beleive the issue stems from the servers TTL (Time to Live), which is set to 0 seconds. Unfortunetly, changing the TTL is not an option and a work around is needed.
As a test I hard coded the IP address of the host name and attempted to connect using that and it worked fine. Now, hard coding the IP address is not a real solution as the servers are using a DNS level round robin load balancer. I tried to programmatically retreive the IP address using InitAddress:
InetAddress inet = InetAddress.getByName(url.getHost());
String ipAddress = inet.getHostAddress();
Unfurtunately, this workaround also returns an Unknown host exception as well.
I also attempted to change the Java's internal DNS Cache by using:
System.setProperty("networkaddress.cache.ttl" , "100");
But this too did not work.
Any other suggestions or solutions would be greatly appreciated!
Thank you.