title: Exception on JSON parsing
body: <p>My url is .php format: hostname/filename/topstory.php</p>
  
  <p>While parsing, I am getting following error....  </p>
  
  <pre><code>11-28 09:47:57.603: E/class com.example.jsonexample.AndroidJSONActivity(749): Failed to download file
  11-28 09:47:57.603: W/System.err(749): org.json.JSONException: End of input at character 0 of 
  11-28 09:47:57.638: W/System.err(749):  at org.json.JSONTokener.syntaxError(JSONTokener.java:446)
      11-28 09:47:57.638: W/System.err(749):  at org.json.JSONTokener.nextValue(JSONTokener.java:93)
      11-28 09:47:57.654: W/System.err(749):  at org.json.JSONArray.&lt;init&gt;(JSONArray.java:87)
      11-28 09:47:57.654: W/System.err(749):  at org.json.JSONArray.&lt;init&gt;(JSONArray.java:103)
      11-28 09:47:57.667: W/System.err(749):  at com.example.jsonexample.AndroidJSONActivity.onCreate(AndroidJSONActivity.java:34)
      11-28 09:47:57.673: W/System.err(749):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
      11-28 09:47:57.673: W/System.err(749):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
      11-28 09:47:57.673: W/System.err(749):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
      11-28 09:47:57.673: W/System.err(749):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
      11-28 09:47:57.683: W/System.err(749):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
      11-28 09:47:57.683: W/System.err(749):  at android.os.Handler.dispatchMessage(Handler.java:99)
      11-28 09:47:57.683: W/System.err(749):  at android.os.Looper.loop(Looper.java:123)
      11-28 09:47:57.698: W/System.err(749):  at android.app.ActivityThread.main(ActivityThread.java:4627)
      11-28 09:47:57.698: W/System.err(749):  at java.lang.reflect.Method.invokeNative(Native Method)
      11-28 09:47:57.698: W/System.err(749):  at java.lang.reflect.Method.invoke(Method.java:521)
      11-28 09:47:57.698: W/System.err(749):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
      11-28 09:47:57.698: W/System.err(749):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
      11-28 09:47:57.698: W/System.err(749): 
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>public class AndroidJSONActivity extends Activity {
  
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          Toast.makeText(getApplicationContext(),"sdasdsadsa231",2100).show();
          String readTwitterFeed = readTwitterFeed();
  
          try {
              JSONArray jsonArray = new JSONArray(readTwitterFeed);
              Log.i(AndroidJSONActivity.class.getName(),
                  "Number of entries " + jsonArray.length());
              for (int i = 0; i &lt; jsonArray.length(); i++) {
                JSONObject jsonObject = jsonArray.getJSONObject(i);
                Log.i(AndroidJSONActivity.class.getName(), jsonObject.getString("text"));
              }
            } catch (Exception e) {
              e.printStackTrace();
            }
  
  
  
  
      }
  
      private String readTwitterFeed() {
          Toast.makeText(getApplicationContext(),"sdasdsadsa231",3100).show();
           StringBuilder builder = new StringBuilder();
              HttpClient client = new DefaultHttpClient();
              HttpGet httpGet = new HttpGet("....../video.php");
  
              try {
  
                HttpResponse response = client.execute(httpGet);
  
                StatusLine statusLine = response.getStatusLine();
                int statusCode = statusLine.getStatusCode();
  
                if (statusCode == 200) {
                  Toast.makeText(getApplicationContext(),"sdasdsadsa",4000).show();
                  HttpEntity entity = response.getEntity();
                  InputStream content = entity.getContent();
                  BufferedReader reader = new BufferedReader(new InputStreamReader(content));
                  String line;
                  while ((line = reader.readLine()) != null) {
                    builder.append(line);
                  }
                } else {
                  Log.e(AndroidJSONActivity.class.toString(), "Failed to download file");
                }
              } catch (ClientProtocolException e) {
                e.printStackTrace();
                Toast.makeText(getApplicationContext(),"sdasdsa323424326a",4000).show();
              } catch (IOException e) {
                  Toast.makeText(getApplicationContext(),"sdasdsa323424326a",4000).show();
                e.printStackTrace();
              }
              return builder.toString();
      }
  }
  </code></pre>
  
  <p>my file...</p>
  
  <pre><code>{"view":"topstory","content":[{"story_id":"128","title":"testuser2","story_description":"
  
  testuser2&lt;\/p&gt;","story_video_file":"","story_video_link":"","images":..
  </code></pre>
  
  <p>Please observe the file, it is having a line space in between the data (after </p>
  
  <p>story_description":"  ),</p>
  
  <p>is there any problem with that space..
   Please suggest me the solution for this.... </p>