Questions tagged [jsonreader]

114 questions
1
vote
3 answers

How to read json

I have following JSON object. {"feed":[ {"news": {"adopted_from":null,"user_id":null,"description":"this is test","id":2} }, {"news": {"adopted_from":null,"user_id":null,"description":"like unlike done","id":1} } ]} I want…
nilkash
  • 7,408
  • 32
  • 99
  • 176
1
vote
1 answer

Reading multiple parameters of JSON objects in java

Hi guys I am getting issue while reading this file can anyone suggest me how to read this file by using model name and tagline and also variant code of this model. I am new to reading in json using java , whenever I am trying to read getting this…
Avish
  • 11
  • 2
1
vote
1 answer

In ExtJS, how to define jsonreader for different json input formats?

I have an external source that generates JSON in given format. I need to use ScriptTagProxy to access that data. Format of data is (two records): { "COLUMNS":["KEDBID","EMPID","KE","SOLUTION","ATTACH_KE","ATTACH_SOLUTION"], "DATA":[ [1,36661,"While…
1
vote
2 answers

How to read a Json file under the resources folder?

In my SpringBoot application I have to read a Json file at this path src/main/resources/mock/fileName.json. I done it in this way JsonReader jsonReaderStream = new JsonReader(new…
danpir
  • 13
  • 4
1
vote
1 answer

How to read JSON file with Arrays and Objects in Java

I'm trying to read a file which is fetched from Opentdb and access data from only specific keys. I've tried all of the given methods which includes GSON and Json Simple but ended up having errors. Here's my JSON: { "response_code": 0, …
Rai Ansar
  • 11
  • 5
1
vote
1 answer

Control characters in Json causing JsonParsingException

I have this java method: public class ReadIssues { // Reads from a Json object protected JsonArray readJson() throws IOException { JsonArray issueArray = null; ClassLoader cl = Thread.currentThread().getContextClassLoader(); //…
runnerpaul
  • 5,942
  • 8
  • 49
  • 118
1
vote
1 answer

ExtJS gridPanel is not loading JSON

I was following the tutorial here: http://www.sencha.com/learn/Tutorial:Grid_PHP_SQL_Part3 But I have not been able to load my gridPanel. I've been struggling with this for quite a while now and I keep changing my code around and nothing is…
elshae
  • 539
  • 3
  • 11
  • 30
1
vote
0 answers

MalformedJsonException error

It happened when I restarted my computer. I turn on android studio, but I can't start the emulator. Information:Gradle tasks [:app:assembleDebug] Error:java.lang.RuntimeException: com.google.gson.stream.MalformedJsonException: Use…
Nasta
  • 807
  • 1
  • 6
  • 10
1
vote
1 answer

Does JsonReader in gson need to be explicitly closed

I want to do this with gson when reading from a json file: JsonReader reader = new JsonReader(new InputStreamReader( new FileInputStream(filename))); JsonParser jsonParser = new JsonParser(); return…
TerryTsao
  • 565
  • 7
  • 16
1
vote
4 answers

Java API call using JsonReader?

So I'm at lost how to do this: the goal is simply to make a call to the openweather api in java and have the result be returned on the console. I can't find any tutorials on how to do this, only on how to parse JSON data from another file... Erm is…
Mehmet
  • 95
  • 9
1
vote
0 answers

Strange case error of java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 47

I have 2 same projects that has same task, it is want to access web service from android with JsonReader, project 1 was running well and everything good there is no problem, project 2 was appearing the exception ===>…
Indra Suandi
  • 47
  • 1
  • 5
1
vote
1 answer

How to read a array value form json in java

I have following json data:- { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 …
Galet
  • 5,853
  • 21
  • 82
  • 148
1
vote
2 answers

Working with JsonReader

I'm working on android app that should read this json string: { "coord":{ "lon":145.77, "lat":-16.92 }, "weather":[ { "id":803, "main":"Clouds", "description":"broken clouds", "icon":"04n" …
Sbonelo
  • 664
  • 1
  • 9
  • 25
1
vote
1 answer

JsonReader throwing IllegalStateException

I found out that using http://ip-api.com/json is an easy way of getting the the necessary user location details. The result, for example from the site is: {"as":"AS37061 ONECOM","city":"Nairobi","country":"Kenya","countryCode":"KE","isp":"One…
Alex Kombo
  • 3,256
  • 8
  • 34
  • 67
1
vote
0 answers

How to use JsonReader for parsing this complicated json given below in android?

Here I have nested array in json response. I have given indexes response. How can I parse this response using JsonReader? I have used JsonReader because of large amount of json. I want to start from index 8 and want to go up to n indexes. How…
Aline
  • 41
  • 4