On the desktop, everything works in the application. In the manifest internet access added. I use this method:
public static String request(String url) throws IOException{ URL obj = new URL(url); HttpURLConnection connection = (HttpURLConnection) obj.openConnection(); connection.setRequestMethod("GET"); BufferedReader in = new BufferedReader(new InputStreamReader (connection.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); inputLine = in.readLine(); response.append(inputLine); in.close(); String actual = response.toString().trim(); return actual; }