android - com.google.gson.JsonParseException: Failed parsing JSON source: java.io.BufferedReader to Json - perplexed with this problem -
I am trying to parse a Jason object while using GSN in the Android application, the test is very much in the emulator The systematic passage, while I am starting the actual device, the problems start, I get an exception as follows
.....: com.google.gson.JsonParseException: unsuccessful Parsing JSON source: java.io. Jason from BufferedReader @ 44848f38 ......: Print Stack Failed Failure JSON Source: Jason from java.io.BufferedReader@44848f38 .......: com.google.gson.JsonParseException: unsuccessful parsing JSON Source: Java From .io.bufferedReader @ 44848f38 to Jason .......: at com.google.gson.JsonParser.parse (JsonParser.java59) ........: In com ... xx .. Allmenus. DiningDetailDetail $ 3.run (Dineridated.Java 361) ........: done by: com.google.gson.ParseException: on row 1, "IDENTIFIER_SANS_EXPONENT> 07-29 on column 1 11: 33: 55.186: Warne / Systems. ARR (2110): One was expected: 07-29 11: 33: 55.186: Warne / Er. (2110): 07-29 11: 33: 55.186: Warns / Syllabus M.Arr (2110): & lt; DIGITS & gt; ... 07-29 11: 33: 55.186: Warne / Systems. ARR (2110): "Blank" ... 07-29 11: 33: 55.186: Warne / System.Er (2110): "Nain" .. 07-29 11: 33: 55.194: Warne / Systems. ARR (2110): "Infinity" ... 07-29 11: 33: 55.194: Warne / System ARR (2110): & bull; Bullion & gt; ... 07-29 11: 33: 55.194: Warne / System. Er (2110): & lt; Single_QUOTE_LITERAL & gt; ... 07-29 11: 33: 55.194: Warne / System. Er (2110): & lt; DOUBLE_QUOTE_LITERAL & gt; ... 07-29 11: 33: 55.202: Warne / System. Er (2110): ")]} \ '\ n" ... 07-29 11: 33: 55.210: Warne / System. Er (2110): "{" ... 07-29 11: 33: 55.210: Warne / System ARR (2110): "[... 07-29 11: 33: 55.217: Warne / System. Er (2110):" - ... ... 07-29 11: 33: 55.217: Warne / System. Er (2110) ): 07-29 11: 33: 55.217: Warne / System.Er (2110): com.google.gson.JsonParserJavacc.Generator's Exception (jasonparcejawak.java: 705) ......: at com.google. Gson.JsonParserJavacc.jj_consume_token (JsonParserJavacc.java-- 87) ......: com.google.gson.JsonParserJavacc.parse at (JsonParserJavacc.java:62) ......: com.google.gson JsonParser.java (JsonParser.java:54) .....: ... 1 and
Please suggest a solution, I am using the GSN version 1.4. The code I use
URLsource = new URL ("http: // .........); In = new bufferreader (new UNICODE reader (urlsoro OPFREME ("UTF-8")); JSE = new JasonPerser (). Pars (in); Incl. (); Jason Array Info = Jse.getAsJsonObject (). GetAsJsonArray ("info");
U / O URL as a browser
{"info": [{"restaurant_id": "" "Washington" "," "State": "DC", "Neighborhood": "Wei de France", "Campus_ID": "", "Address": "600 Maryland Avenue SW", "City": "Washington", "", "Neighborhood_north "", "Zipcode": "20024", "average_centry": "6.2 9", "chain_id": "994", "phone": "(202) 554-7870", "ISOOVISTAR": "0" "Menu_type": "1", "url": "" "logo": "" "description": "" "latitude": "38.8,86,877", "longitude": "- 77.0 , 19, 9 13 "," Properties ":" rmwa "," Review ":" y "," yelp_phone ":" 2025547870 "," reservation_id ":" "" rese "": "" "" "", "Price": "" "CROSS_STREET": "" "public_transit": "" "restaurant_description": "" "payment_methods": "", "hours": "" "next_open": "" " Restaurant_status ":" "," delivery_time ":" "," delivery_info ":" "," misc_info ":" "," "", "minimum_order": "", "minimum_order": " "" "" "" "" "," Delivery_tate ":" "," distribution_time "," delivery_charge ":" "" delivery_charge_2 ":" "" is_pickup ":" "" is_delivery ":" "" minimum_tip_amount ":" "" Minimum_tip_percent ":" "" restaurant_acco unt_id ":" "URLNAME": "\ / DC \ / Washington \ / 239256-Vie-de-France \ /", "facebook_fan_page": "" "twitter_page": "" "is_dz "": "American", "URLNAME": "American", "American", "": "", "Loyalty": "" "delivery_hours": ""}], "consonant": [{"mastercuisineid": "143", "food" Neither "}, {" mastercoozinid ":" 90 "," consonant ":" bakery & amp; "Bakery-pastry"}, {"mastercuZinid": "57", "French", "urlname": "french"}]}
"pastry", "URLName"} "Food" P> Thanks
If your JSON is on a server and you request it via HTTP request If you access, you simply do not have the entire file with the header to parse the content.
Try making an HTTP client, use getResponse.getEntity or getResponse.getContent, and then your parser on one of these.
Comments
Post a Comment