0

I have the following:

try {
    InetAddress.getByName(Constants.CORE_API_SERVER).isReachable(5000);
} catch (IOException e) {
    Log.d("RegisterUUID", Constants.CORE_API_SERVER + " is NOT reachable");
}

The URL is:

public static final String CORE_API_SERVER = "api.something.com";

The problem I'm running into is when I try to access this url, I get the following message:

10-26 11:27:39.159 30689-30746/com.something.app D/RegisterUUID: IOException: java.net.MalformedURLException: Protocol not found: api.something.com/application/registerUUID

I understand this error...but when I go to add the http:// to the url...all of a sudden the address is not reachable. It is, however, reachable through a browser at http://api.something.com

Am I missing something?

dxhans5
  • 127
  • 1
  • 12
  • "Am I missing something?" -- well, you are missing the code that generates that error message, so we cannot help you with that code. Please provide a [minimal, complete, and verifiable example](http://stackoverflow.com/help/mcve) demonstrating your problem. – CommonsWare Oct 26 '15 at 17:32
  • It's all there. If I do an ...isReachable() call on api.something.com, I get an error message saying I'm missing the Protocol. If I add http:// to http://api.something.com, ...isReachable() fails. – dxhans5 Oct 27 '15 at 01:32

0 Answers0