Try also adding uc.setConnectTimeout(5000);
Edit: Final solution
Use uc.connect();
before getting the response code.
Also, add the proxy configuration while opening the HttpURLConnection.
Like this :
HttpURLConnection uc = (HttpURLConnection) u.openConnection(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(myProxyHost, Integer.parseInt(myProxyPort))));