Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>if you still not get your result you can use below code .</p> <pre><code>static InputStream is = null; static JSONObject jObj = null; static JSONArray jsonArray=null; static String json = ""; mJsonArray=getJSONFromUrl(url); try{ JSONObject mJsonObject=null; for(int i =0;i&lt;mJsonArray.length();i++){ if(!mJsonArray.isNull(i)){ HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;(); mJsonObject=mJsonArray.getJSONObject(i); map.put("title",mJsonObject.getString("news_title")); map.put("shortdescription",mJsonObject.getString("news_short_description")); map.put("date",mJsonObject.getString("news_date")); //add you map in to list } } }catch(JSONException jexc){ jexc.printStackTrace(); } public JSONArray getJSONFromUrl(String url) { // Making HTTP request try { // defaultHttpClient DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(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(); } catch (Exception e) { Log.e("Buffer Error", "Error converting result " + e.toString()); } // try parse the string to a JSON object try { jsonArray =new JSONArray(json); } catch (JSONException e) { Log.e("JSON Parser", "Error parsing data " + e.toString()); } // return JSON String return jsonArray; } </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.
    1. This table or related slice is empty.
    1. VO
      singulars
      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