title: Volley library won't connect to Server
body: <p>I am trying to retrieve a <code>JSONObject</code> from database but I found out that the request don't even make it to the Server. I checked the <code>Apache Access Log</code> to confirm this. The URL is valid and when I access it via a web browser, it return the expect JSONObject. The exception error show <code>null</code> by the Volley library.</p>
  
  <pre><code> private void GetSchInfo(){
  
      showDialog();
  
      // making fresh volley request and getting json
      JsonObjectRequest jsonReq = new JsonObjectRequest(Request.Method.GET,
              URL_SchInfo, null, new Response.Listener&lt;JSONObject&gt;() {
  
          @Override
          public void onResponse(JSONObject response) {
  
  
              try{
  
                  spinnerClass.setVisibility(View.VISIBLE);
                  spinnerSch.setVisibility(View.VISIBLE);
                  spinnerDept.setVisibility(View.VISIBLE);
                  btnRegClass.setVisibility(View.VISIBLE);
                  txtClassMsg.setVisibility(View.VISIBLE);
                  btnRefresh.setVisibility(View.GONE);
  
                  JSONArray schools = response.getJSONArray("sch_info");
                  JSONArray departments = response.getJSONArray("dept_info");
  
                  for (int i = 0; i &lt; schools.length(); i++){
                      JSONObject schObj = (JSONObject)schools.get(i);
                      SchInfo sch = new SchInfo(schObj.getString("school_id"), schObj.getString("school_name"));
                      schoolList.add(sch);
                  }
  
                  for (int j = 0; j &lt; departments.length(); j++){
                      JSONObject deptObj = (JSONObject)departments.get(j);
                      DeptItem dept = new DeptItem(deptObj.getString("department_id"), deptObj.getString("department_name"));
                      deptList.add(dept);
                  }
  
  
                  //populate
                  //populateInfo();
  
              }catch(JSONException e){
                 Log.e(TAG, "JSON Error: " + e.getMessage());
                  e.printStackTrace();
                  spinnerClass.setVisibility(View.GONE);
                  txtClassMsg.setVisibility(View.GONE);
                  spinnerSch.setVisibility(View.GONE);
                  spinnerDept.setVisibility(View.GONE);
                  btnRegClass.setVisibility(View.GONE);
                  btnRefresh.setVisibility(View.VISIBLE);
  
               }
  
              hideDialog();
          }
      }, new Response.ErrorListener() {
  
          @Override
          public void onErrorResponse(VolleyError error) {
              String body;
  
                  if (error.networkResponse.data !=null){
                  try {
                      body = new String(error.networkResponse.data, "UTF-8");
                  }catch (UnsupportedEncodingException e){
                      e.printStackTrace();
                  }
              }
  
            Log.e("Error: ",   error.getCause()  +"&gt;&gt;" + error.getMessage());
              Log.e(TAG, "JSON Error: " + error.getMessage() );
              hideDialog();
              spinnerClass.setVisibility(View.GONE);
              spinnerSch.setVisibility(View.GONE);
              spinnerDept.setVisibility(View.GONE);
              btnRegClass.setVisibility(View.GONE);
              txtClassMsg.setVisibility(View.GONE);
              btnRefresh.setVisibility(View.VISIBLE);
          }
      });
  
      // Adding request to volley request queue
      AppController.getInstance().addToRequestQueue(jsonReq);
  }
  </code></pre>
  
  <p>How do I solve this?</p>
  
  <p><strong>Note</strong>
  The server is on my local machine, I connect via hotspot with something like <code>http://192.164.***.***</code>.</p>