title: socket failed: EACCES (Permission denied) (tried adding internet permission)
body: <p>I have tried adding internet permission and almost all solutions that were previously given, but it doesn't work.</p>
  
  <pre><code>public class SignupActivity extends AsyncTask&lt;String, Void, String&gt; {
  
      private Context context;
  
      public SignupActivity(Context context) {
          this.context = context;
      }
  
      protected void onPreExecute() {
  
      }
  
      @Override
      protected String doInBackground(String... arg0) {
          String fullName = arg0[0];
          String userName = arg0[1];
          String passWord = arg0[2];
          String phoneNumber = arg0[3];
          String emailAddress = arg0[4];
  
          String link;
          String data;
          BufferedReader bufferedReader;
          String result;
  
          try {
              data = "?fullname=" + URLEncoder.encode(fullName, "UTF-8");
              data += "&amp;username=" + URLEncoder.encode(userName, "UTF-8");
              data += "&amp;password=" + URLEncoder.encode(passWord, "UTF-8");
              data += "&amp;phonenumber=" + URLEncoder.encode(phoneNumber, "UTF-8");
              data += "&amp;emailaddress=" + URLEncoder.encode(emailAddress, "UTF-8");
  
              link = "http://192.168.0.4/one/signup.php" + data;
              URL url = new URL(link);
              HttpURLConnection con = (HttpURLConnection) url.openConnection();
  
              bufferedReader = new BufferedReader(new InputStreamReader(con.getInputStream()));
              result = bufferedReader.readLine();
              Log.d("result:",result);
              return result;
          } catch (Exception e) {
              return new String("Exception123: " + e.getMessage());
          }
      }
  
      @Override
      protected void onPostExecute(String result) {
          String jsonStr = result;
          Log.d("result:",result);
          if (jsonStr != null) {
              try {
                  JSONObject jsonObj = new JSONObject(jsonStr);
                  Log.d("one","ok");
                  String query_result = jsonObj.getString("query_result");
                  if (query_result.equals("SUCCESS")) {
                      Toast.makeText(context, "Data inserted successfully. Signup successfull.", Toast.LENGTH_SHORT).show();
                  } else if (query_result.equals("FAILURE")) {
                      Toast.makeText(context, "Data could not be inserted. Signup failed.", Toast.LENGTH_SHORT).show();
                  } else {
                      Toast.makeText(context, "Couldn't connect to remote database.", Toast.LENGTH_SHORT).show();
                  }
              } catch (JSONException e) {
                  e.printStackTrace();
                  Toast.makeText(context, "Error parsing JSON data.", Toast.LENGTH_SHORT).show();
              }
          } else {
              Toast.makeText(context, "Couldn't get any JSON data.", Toast.LENGTH_SHORT).show();
          }
      }
  }
  </code></pre>
  
  <p>What else could be wrong?
  How to resolve it?</p>