There is a working code to connect to the server. You must set a timeout. urlconnection.setConnectTimeout () does not plow.
URL url_groups = new URL("http://yarmiit.ru/index.php?name=ASU&op=apk&show_news"); urlConnection = (HttpURLConnection) url_groups.openConnection(); urlConnection.setRequestMethod("GET"); urlConnection.connect(); InputStream inputStream = urlConnection.getInputStream(); StringBuilder buffer = new StringBuilder(); reader = new BufferedReader(new InputStreamReader(inputStream)); String line; while ((line = reader.readLine()) != null) { buffer.append(line); } resultJson = buffer.toString();