title: org.json.JSONException: Expected ':' after <key
body: <p>Friends. I have download a sample JSON parsing project from <a href="http://www.androidhive.info/2012/01/android-json-parsing-tutorial/" rel="nofollow noreferrer">AndroidHive</a>. </p>
  
  <p>code is:</p>
  
  <pre><code>// Making HTTP request
  try {
  // defaultHttpClient
  DefaultHttpClient httpClient = new DefaultHttpClient();
  HttpGet httpPost = new HttpGet(url);
  HttpResponse httpResponse = httpClient.execute(httpPost);
  HttpEntity httpEntity = httpResponse.getEntity();
  
  is = httpEntity.getContent();
  } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
  } catch (ClientProtocolException e) {
      e.printStackTrace();
  } catch (IOException e) {
      e.printStackTrace();
  }
  try {
      BufferedReader reader = new BufferedReader(new InputStreamReader(is, "iso-8859-1"), 8);
  StringBuilder sb = new StringBuilder();
  String line = null;
  while ((line = reader.readLine()) != null) {
          sb.append(line + "\n");
  }
  is.close();
  json = sb.toString(); //json is String variable.
  Log.i("String Builder", json);
  } catch (Exception e) {
      Log.e("Buffer Error", "Error converting result " + e.toString());
  }
  // try parse the string to a JSON object
  try {
       jObj = new JSONObject(json);
  } catch (JSONException e) {
      Log.e("JSON Parser", "Error parsing data " + e.toString());
  }
  </code></pre>
  
  <p>while running, it throws <code>java.lang.string cannot be converted to JSONObject</code> exception.
  So after searching solution for this problem I changed</p>
  
  <pre><code>     jObj = new JSONObject(json);
  </code></pre>
  
  <p>this line as </p>
  
  <pre><code>    jObj = new JSONObject("{" + json + "}");
  </code></pre>
  
  <p>this line by the instructin given <a href="https://stackoverflow.com/questions/10267910/jsonexception-value-of-type-java-lang-string-cannot-be-converted-to-jsonobject">here</a>. After this my logcat shows the following error.</p>
  
  <pre><code>03-28 16:24:23.722: E/JSON Parser(1516): Error parsing data org.json.JSONException: Expected ':' after &lt;!DOCTYPE at character 12 of {&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;
  03-28 16:24:23.722: E/JSON Parser(1516): &lt;HTML dir=ltr&gt;&lt;HEAD&gt;&lt;TITLE&gt;The page cannot be displayed&lt;/TITLE&gt;
  03-28 16:24:23.722: E/JSON Parser(1516): &lt;STYLE id=L_defaultr_1&gt;A:link {
  03-28 16:24:23.722: E/JSON Parser(1516):    FONT: 8pt/11pt verdana; COLOR: #ff0000
  03-28 16:24:23.722: E/JSON Parser(1516): }
  03-28 16:24:23.722: E/JSON Parser(1516): A:visited {
  03-28 16:24:23.722: E/JSON Parser(1516):    FONT: 8pt/11pt verdana; COLOR: #4e4e4e
  03-28 16:24:23.722: E/JSON Parser(1516): }
  03-28 16:24:23.722: E/JSON Parser(1516): &lt;/STYLE&gt;
  03-28 16:24:23.722: E/JSON Parser(1516): &lt;META content=NOINDEX name=ROBOTS&gt;
  03-28 16:24:23.722: E/JSON Parser(1516): &lt;META http-equiv=Content-Type content="text-html; charset=UTF-8"&gt;
  03-28 16:24:23.722: E/JSON Parser(1516): &lt;META content="MSHTML 5.50.4522.1800" name=GENERATOR&gt;&lt;/HEAD&gt;
  03-28 16:24:23.722: E/JSON Parser(1516): &lt;BODY bgColor=#ffffff&gt;
  03-28 16:24:23.722: E/JSON Parser(1516): &lt;TABLE cellSpacing=5 cellPadding=3 width=410&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):   &lt;TBODY&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):   &lt;TR&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):     &lt;TD vAlign=center align=left width=360&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):       &lt;H1 id=L_defaultr_2 style="FONT: 13pt/15pt verdana; COLOR: #000000"&gt;&lt;ID id=L_defaultr_3&gt;&lt;!--Problem--&gt;The page cannot be displayed
  03-28 16:24:23.722: E/JSON Parser(1516): &lt;/ID&gt;&lt;/H1&gt;&lt;/TD&gt;&lt;/TR&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):   &lt;TR&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):     &lt;TD width=400 colSpan=2&gt;&lt;FONT id=L_defaultr_4
  03-28 16:24:23.722: E/JSON Parser(1516):       style="FONT: 8pt/11pt verdana; COLOR: #000000"&gt;&lt;ID id=L_defaultr_5&gt;&lt;B&gt;Explanation: &lt;/B&gt;There is a problem with the page you are trying to reach and it cannot be displayed.&lt;/ID&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):   &lt;TR&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):     &lt;TD width=400 colSpan=2&gt;&lt;FONT id=L_defaultr_6 
  03-28 16:24:23.722: E/JSON Parser(1516):       style="FONT: 8pt/11pt verdana; COLOR: #000000"&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):       &lt;HR color=#c0c0c0 noShade&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):       &lt;P id=L_defaultr_7&gt;&lt;B&gt;Try the following:&lt;/B&gt;&lt;/P&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):       &lt;UL&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):         &lt;LI id=L_defaultr_8&gt;&lt;B&gt;Refresh page:&lt;/B&gt; Search for the page again by clicking the Refresh button. The timeout may have occurred due to Internet congestion.
  03-28 16:24:23.722: E/JSON Parser(1516): &lt;LI id=L_defaultr_9&gt;&lt;B&gt;Check spelling:&lt;/B&gt; Check that you typed the Web page address correctly. The address may have been mistyped.
  03-28 16:24:23.722: E/JSON Parser(1516): &lt;LI id=L_defaultr_10&gt;&lt;B&gt;Access from a link:&lt;/B&gt; If there is a link to the page you are looking for, try accessing the page from that link.
  03-28 16:24:23.722: E/JSON Parser(1516):       &lt;/UL&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):       &lt;HR color=#c0c0c0 noShade&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):       &lt;P id=L_defaultr_11&gt;Technical Information (for support personnel)&lt;/P&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):       &lt;UL&gt;
  03-28 16:24:23.722: E/JSON Parser(1516):         &lt;LI id=L_defaultr_12&gt;Error Code: 403 Forbidden. The ISA Server denied the specified Uniform Resource Locator (URL). (12202)
  03-28 16:24:23.722: E/JSON Parser(1516):         &lt;/UL&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;
  03-28 16:24:23.722: E/JSON Parser(1516): }
  </code></pre>
  
  <p>I have searched lot friends. But I cant resolve this problem. 
  So please help me.</p>
  
  <p>Note: I am working behind ISA server</p>
  
  <p>My Url is: <a href="http://api.androidhive.info/contacts/" rel="nofollow noreferrer">http://api.androidhive.info/contacts/</a></p>
  
  <p>My log.i("String builder",json) returns the following.</p>
  
  <pre><code>03-28 16:43:41.903: I/String Builder(1543): &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;
  03-28 16:43:41.903: I/String Builder(1543): &lt;HTML dir=ltr&gt;&lt;HEAD&gt;&lt;TITLE&gt;The page cannot be displayed&lt;/TITLE&gt;
  03-28 16:43:41.903: I/String Builder(1543): &lt;STYLE id=L_defaultr_1&gt;A:link {
  03-28 16:43:41.903: I/String Builder(1543):     FONT: 8pt/11pt verdana; COLOR: #ff0000
  03-28 16:43:41.903: I/String Builder(1543): }
  03-28 16:43:41.903: I/String Builder(1543): A:visited {
  03-28 16:43:41.903: I/String Builder(1543):     FONT: 8pt/11pt verdana; COLOR: #4e4e4e
  03-28 16:43:41.903: I/String Builder(1543): }
  03-28 16:43:41.903: I/String Builder(1543): &lt;/STYLE&gt;
  03-28 16:43:41.903: I/String Builder(1543): &lt;META content=NOINDEX name=ROBOTS&gt;
  03-28 16:43:41.903: I/String Builder(1543): &lt;META http-equiv=Content-Type content="text-html; charset=UTF-8"&gt;
  03-28 16:43:41.903: I/String Builder(1543): &lt;META content="MSHTML 5.50.4522.1800" name=GENERATOR&gt;&lt;/HEAD&gt;
  03-28 16:43:41.903: I/String Builder(1543): &lt;BODY bgColor=#ffffff&gt;
  03-28 16:43:41.903: I/String Builder(1543): &lt;TABLE cellSpacing=5 cellPadding=3 width=410&gt;
  03-28 16:43:41.903: I/String Builder(1543):   &lt;TBODY&gt;
  03-28 16:43:41.903: I/String Builder(1543):   &lt;TR&gt;
  03-28 16:43:41.903: I/String Builder(1543):     &lt;TD vAlign=center align=left width=360&gt;
  03-28 16:43:41.903: I/String Builder(1543):       &lt;H1 id=L_defaultr_2 style="FONT: 13pt/15pt verdana; COLOR: #000000"&gt;&lt;ID id=L_defaultr_3&gt;&lt;!--Problem--&gt;The page cannot be displayed
  03-28 16:43:41.903: I/String Builder(1543): &lt;/ID&gt;&lt;/H1&gt;&lt;/TD&gt;&lt;/TR&gt;
  03-28 16:43:41.903: I/String Builder(1543):   &lt;TR&gt;
  03-28 16:43:41.903: I/String Builder(1543):     &lt;TD width=400 colSpan=2&gt;&lt;FONT id=L_defaultr_4
  03-28 16:43:41.903: I/String Builder(1543):       style="FONT: 8pt/11pt verdana; COLOR: #000000"&gt;&lt;ID id=L_defaultr_5&gt;&lt;B&gt;Explanation: &lt;/B&gt;There is a problem with the page you are trying to reach and it cannot be displayed.&lt;/ID&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;
  03-28 16:43:41.903: I/String Builder(1543):   &lt;TR&gt;
  03-28 16:43:41.903: I/String Builder(1543):     &lt;TD width=400 colSpan=2&gt;&lt;FONT id=L_defaultr_6 
  03-28 16:43:41.903: I/String Builder(1543):       style="FONT: 8pt/11pt verdana; COLOR: #000000"&gt;
  03-28 16:43:41.903: I/String Builder(1543):       &lt;HR color=#c0c0c0 noShade&gt;
  03-28 16:43:41.903: I/String Builder(1543):       &lt;P id=L_defaultr_7&gt;&lt;B&gt;Try the following:&lt;/B&gt;&lt;/P&gt;
  03-28 16:43:41.903: I/String Builder(1543):       &lt;UL&gt;
  03-28 16:43:41.903: I/String Builder(1543):         &lt;LI id=L_defaultr_8&gt;&lt;B&gt;Refresh page:&lt;/B&gt; Search for the page again by clicking the Refresh button. The timeout may have occurred due to Internet congestion.
  03-28 16:43:41.903: I/String Builder(1543): &lt;LI id=L_defaultr_9&gt;&lt;B&gt;Check spelling:&lt;/B&gt; Check that you typed the Web page address correctly. The address may have been mistyped.
  03-28 16:43:41.903: I/String Builder(1543): &lt;LI id=L_defaultr_10&gt;&lt;B&gt;Access from a link:&lt;/B&gt; If there is a link to the page you are looking for, try accessing the page from that link.
  03-28 16:43:41.903: I/String Builder(1543):       &lt;/UL&gt;
  03-28 16:43:41.903: I/String Builder(1543):       &lt;HR color=#c0c0c0 noShade&gt;
  03-28 16:43:41.903: I/String Builder(1543):       &lt;P id=L_defaultr_11&gt;Technical Information (for support personnel)&lt;/P&gt;
  03-28 16:43:41.903: I/String Builder(1543):       &lt;UL&gt;
  03-28 16:43:41.903: I/String Builder(1543):         &lt;LI id=L_defaultr_12&gt;Error Code: 403 Forbidden. The ISA Server denied the specified Uniform Resource Locator (URL). (12202)
  03-28 16:43:41.903: I/String Builder(1543):         &lt;/UL&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>