Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting JSON values from URL in android
    primarykey
    data
    text
    <p>In my application i am trying to retrieve the values from a JSON URL. In the URL there is a point where I am not able to parser the values.. I have tried alot to find the solution but I haven't got any..</p> <p>In the URL the values that I want to parse is the values of <strong>tag_users</strong>...</p> <p>I am attaching the code where I am trying to parser the values so, please help me in finding the solution...</p> <p>////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</p> <pre><code>String url = "http://flutterr.pnf-sites.info/api/messageshow/2"; JsonParser jParser = new JsonParser(); JSONObject json = jParser.getJSONfromUrl(url); try { JSONArray messageshow = json.getJSONArray("messageshow"); userList.clear(); for(int i=0; i&lt;messageshow.length();i++) { JSONObject msg = messageshow.getJSONObject(i); message_id = msg.getString("message_id"); message = msg.getString("message"); message_pic = msg.getString("message_pic"); uid = msg.getString("uid"); created = msg.getString("created"); username = msg.getString("username"); first_name = msg.getString("first_name"); last_name = msg.getString("last_name"); profile_pic = msg.getString("profile_pic"); total_likes = msg.getString("total_likes"); JSONObject tag_user = msg.getJSONObject("tag_user"); message = tag_user.getJSONObject("tags").getString("message"); if(message != "false") tag_uid = tag_user.getJSONObject("tags").getString("tag_uid"); Log.v("uid", tag_uid); HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;(); map.put("message_id", message_id); map.put("message", message); map.put("message_pic", message_pic); map.put("uid", uid); map.put("created", created); map.put("username", username); map.put("first_name", first_name); map.put("last_name", last_name); map.put("profile_pic", profile_pic); map.put("total_likes", total_likes); userList.add(map); } } catch(JSONException e) { Log.e("Error", e.toString()); } </code></pre> <p>////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</p> <p>Please help me in letting me know that how can I parser the values of <strong>tag_uid, tag_uname, tag_fname and tag_lname</strong>...</p>
    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.
 

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