Note that there are some explanatory texts on larger screens.

plurals
  1. POJson Parsin in android
    primarykey
    data
    text
    <p><a href="http://www.taxmann.com/TaxmannWhatsnewService/Services.aspx?service=getStatutesTabNews" rel="nofollow">http://www.taxmann.com/TaxmannWhatsnewService/Services.aspx?service=getStatutesTabNews</a></p> <p>This is my web service. I want to parse it and I want show news_id and news title. Please post, showing me how to parse it so that I can store all the values in a string. I tried but am getting <code>Exception ..</code></p> <pre><code>try { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://www.taxmann.com/TaxmannWhatsnewService/Services.aspx?service=getStatutesTabNews"); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); is = entity.getContent(); }catch(Exception e) { Log.e("log_tag", "Error in http connection"+e.toString()); } //convert response to string try { BufferedReader reader = new BufferedReader(new InputStreamReader(is,"UTF-8"),8); sb = new StringBuilder(); sb.append(reader.readLine() + "\n"); String line="0"; while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } is.close(); result=sb.toString(); }catch(Exception e) { Log.e("log_tag", "Error converting result "+e.toString()); } // String name; try { jArray = new JSONArray(result); JSONObject json_data=null; for(int i=0;i&lt;jArray.length();i++) { HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;(); json_data = jArray.getJSONObject(i); // name=json_data.getString("name"); map.put("id", String.valueOf(json_data.getString("news_id"))); map.put("title",json_data.getString("news_title")); map.put("shortdescription",json_data.getString("news_short_description")); map.put("date",json_data.getString("news_date")); mylist.add(map); } } catch(Exception e) { } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload