title: org.json.JSONException: End of input at character 0 of, android
body: <p>I am implementing an android app and trying to make a register and login screens. my app is connected to a server, here is the part my code that makes error:</p>
  
  <pre><code>public void onResponse(String response) {
              Log.d(TAG, "Register Response: " + response.toString());
              hideDialog();
  
              try {
                  JSONObject jObj = new JSONObject(response);
                  boolean error = jObj.getBoolean("error");
                  if (!error)
                  {
                      // User successfully stored in MySQL
                      // Now store the user in sqlite
                      String uid = jObj.getString("uid");
  
                      JSONObject user = jObj.getJSONObject("user");
                      String name = user.getString("name");
                      String email = user.getString("email");
                      String created_at = user
                              .getString("created_at");
  
                      // Inserting row in users table
                      db.addUser(name, email, uid, created_at);
  
                      Toast.makeText(getApplicationContext(), "User successfully registered. Try login now!", Toast.LENGTH_LONG).show();
  
                      // Launch login activity
                      Intent intent = new Intent(
                              RegisterActivity.this,
                              LoginActivity.class);
                      startActivity(intent);
                      finish();
                  } else
                  {
  
                      // Error occurred in registration. Get the error
                      // message
                      String errorMsg = jObj.getString("error_msg");
                      Toast.makeText(getApplicationContext(), errorMsg, Toast.LENGTH_LONG).show();
                      Log.d("Debug", errorMsg);
  
                  }
              } catch (JSONException e) {
                  e.printStackTrace();
              }
  
          }
      }, new Response.ErrorListener() {
  
          @Override
          public void onErrorResponse(VolleyError error) {
              Log.e(TAG, "Registration Error: " + error.toString());
              Toast.makeText(getApplicationContext(),
                      error.getMessage(), Toast.LENGTH_LONG).show();
              hideDialog();
          }
      }) {
  </code></pre>
  
  <p>and here is my error:
  org.json.JSONException: End of input at character 0 of.
  actually I have seen similar questions in this site but i was not be able to solve my problem</p>
  
  <p>UPDATE:
  this is my logcat content, and there is nothing in front of response:</p>
  
  <pre><code> 1576-1576/com.example.neshat.androidhive2 D/RegisterActivity﹕ Register Response:
  12-21 09:43:08.820    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ org.json.JSONException: End of input at character 0 of
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at org.json.JSONTokener.syntaxError(JSONTokener.java:450)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at org.json.JSONTokener.nextValue(JSONTokener.java:97)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at org.json.JSONObject.&lt;init&gt;(JSONObject.java:156)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at org.json.JSONObject.&lt;init&gt;(JSONObject.java:173)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at com.example.neshat.androidhive2.RegisterActivity$3.onResponse(RegisterActivity.java:124)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at com.example.neshat.androidhive2.RegisterActivity$3.onResponse(RegisterActivity.java:116)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:60)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:30)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:99)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:739)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:95)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at android.os.Looper.loop(Looper.java:135)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5221)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at java.lang.reflect.Method.invoke(Native Method)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:372)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
  12-21 09:43:08.824    1576-1576/com.example.neshat.androidhive2 W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
  </code></pre>