Questions tagged [android-json]

JSON stands for (Java Script Object Notation). It is a simple and light-weight data interchange format that can be easily read by humans and machines.Android includes the org.json library which allow working efficiently with JSON. This provides easy parsing of JSON data and creating JSON strings

577 questions
0
votes
1 answer

Android how to parse multiple json arrays and objects from sd card

I have the following textfile into my sd card which contains json arrays and objects,i am suucessfully parse the 1st json array "data",now i have no idea how i can parse 2nd and 3rd json arrays "videos" and "images"?all the data e.g videos and…
Farhan Shah
  • 2,344
  • 7
  • 28
  • 54
0
votes
2 answers

Android error : org.apache.http.conn.ConnectTimeoutException

I am working on JSON data parsing, I am new to this as i am doing JSON parsing for the first time. I tried an example from This Link. It runs fine. But when i change the example code according to my need i got error. My changed code is as follows…
Manoj Fegde
  • 4,786
  • 15
  • 50
  • 95
0
votes
1 answer

Error parsing data org.json.jsonexception:value of i>>? of type java.lang.string cannot be converted to json object

I m getting json exception.error is like:- the code is like package info.androidhive.tabsswipe; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import org.apache.http.NameValuePair; import…
user3336646
  • 11
  • 1
  • 4
0
votes
1 answer

entity.getContentLength() returns -1

I got BufferedReader object is blank, When I debug my code i found that actually the HttpEntity object is also seems like empty. Here is my part of code: // Making HTTP request try { // defaultHttpClient DefaultHttpClient…
Rohit
  • 687
  • 5
  • 22
0
votes
0 answers

Android: JSONParser getJSONObject crash and don't throws an exception when network connection lost

I'm trying to make a TV based android application that was running on android box, but suddenly when I pull the LAN connection from it so the connection was lost the JSONParser.getJSONObject will crash and the weird one is that it does not throw any…
0
votes
1 answer

How to use POST with a JSONArray

Okay, i worked before with POST but i never had to POST Arrays. (Really) This is the POST form: { "about": "about me", "sports": [ { "id": 1, "level": 3 }, { "id": 2, "level":…
Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222
0
votes
0 answers

JSON parsing how to set navigation list in android

android JSON parsing pagination how to i do with 10 item in a list in single page and left out list item goes to another page list item this is my code public class First extends ListActivity { private ProgressDialog pDialog; // URL to get…
user3066085
  • 128
  • 1
  • 8
0
votes
3 answers

JSONObject in Android

Here i want to fetch the data from the json, but i am getting only first two objects value (25, 44) but the ids are 50,60 . I don't know whats wrong with this code. Below is my response from the server: { "product": { "25": { "training":…
user3154663
  • 291
  • 1
  • 2
  • 18
0
votes
3 answers

Parsing JSON performance

I have json with some objects in it. And only one object from json i need. So which approach will be better for speed and performance - parse only this object or parse whole document instead?
Outofdate
  • 635
  • 5
  • 16
0
votes
1 answer

Have anyone implemented Load more paging in android with JSON parser ?

I wanna implement a load more pagination in android for my listview with JSON Parser. I got one tutorial but its with XML parser from here. http://www.androidhive.info/2012/03/android-listview-with-load-more-button/ Any ideas how to do that with…
0
votes
3 answers

Android - how to format objects in JSON

I have this class: class Type{ public int id; public String name; } and I want to format object in JSON this way {[1,"superMarket"],[2,"restaurant "]} and also put data from JSON to "Type" object can some one help me…
Medo Elkamaly
  • 2,508
  • 1
  • 20
  • 15
-1
votes
1 answer

List View with Accept and Decline a request Buttons in each Row in android (Rest Api)

I am developing an Android application based on REST API remote data, in which I have made one ListView with two buttons, "Accept" and "Decline". When the user selects the "Accept" button, certain portions of the JSON property have to change to true…
-1
votes
2 answers

IndexOutOfBoundsException: Invalid index 0, size is 0. how i can solver this problem

i'm write code for OnClickListener in RecyclerView and i want put data from json. data from json its work but i cant bring the data to other activity. this is a new android studio version is 3.4.1. this code in caritenda. public void onClick(View…
-1
votes
2 answers

How to put multiple JsonObject inside JsonArray using volley library?

How to put arrayList in jsonArray on server side? try to put parameter "list": [ { "year": "2019", "amt": 6222 }, { "year": "2016", "amt": 5555 } ]}
-1
votes
1 answer

How to use multipart/form-data uploading file using Volley

One of my API use multipart/form-data to upload file and text in request body. How to code that like Postman?
sMARTheartz
  • 61
  • 1
  • 6