HttpsURLConnection isn't working in android studio <p>I'm developing an application using android studio, I'm completely new to android and this is my second application, I've searched everywhere to find a way to open an url and to read the Json content from it, these are the codes i have found, but the problem is where it arrives to "con.connect();" it says Unfortunately your application has stopped working i can't read even the string from that url, i really don't know what the problem is, so i hope you can help me solving this problem. </p> <pre><code>public String webrequest(String url1){ try { URL url = new URL(url1); HttpsURLConnection con = (HttpsURLConnection) url.openConnection(); con.connect(); if (con != null) { try { BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream(),"UTF-8")); String input; while ((input = br.readLine()) != null) { System.out.println(input); } br.close(); return input.toString(); } catch (IOException e) { e.printStackTrace(); } } } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } //return input; return ""; } </code></pre> <p>And by the way, i have got the internet permission in android manifest. Thank you for your help.</p>