Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 973281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:15:21+00:00 2026-05-16T03:15:21+00:00

I am trying to parse a json object using gson in Android application ,the

  • 0

I am trying to parse a json object using gson in Android application ,the test passed quite gracefully in emulator ,while i used the actual device ,the problems started
I am getting the exception as follows

.....: com.google.gson.JsonParseException: Failed parsing JSON source: java.io.BufferedReader@44848f38 to Json
......: print stack Failed parsing JSON source: java.io.BufferedReader@44848f38 to Json
.......:com.google.gson.JsonParseException: Failed parsing JSON source: java.io.BufferedReader@44848f38 to Json
.......:    at com.google.gson.JsonParser.parse(JsonParser.java:59)
........:    at com...xx..allmenus.DiningDetail$3.run(DiningDetail.java:361)
........: Caused by: com.google.gson.ParseException: Encountered " <IDENTIFIER_SANS_EXPONENT> "HTTP "" at line 1, column 1.
07-29 11:33:55.186: WARN/System.err(2110): Was expecting one of:
07-29 11:33:55.186: WARN/System.err(2110):     <EOF> 
07-29 11:33:55.186: WARN/System.err(2110):     <DIGITS> ...
07-29 11:33:55.186: WARN/System.err(2110):     "null" ...
07-29 11:33:55.186: WARN/System.err(2110):     "NaN" ...
07-29 11:33:55.194: WARN/System.err(2110):     "Infinity" ...
07-29 11:33:55.194: WARN/System.err(2110):     <BOOLEAN> ...
07-29 11:33:55.194: WARN/System.err(2110):     <SINGLE_QUOTE_LITERAL> ...
07-29 11:33:55.194: WARN/System.err(2110):     <DOUBLE_QUOTE_LITERAL> ...
07-29 11:33:55.202: WARN/System.err(2110):     ")]}\'\n" ...
07-29 11:33:55.210: WARN/System.err(2110):     "{" ...
07-29 11:33:55.210: WARN/System.err(2110):     "[" ...
07-29 11:33:55.217: WARN/System.err(2110):     "-" ...
07-29 11:33:55.217: WARN/System.err(2110):     
07-29 11:33:55.217: WARN/System.err(2110):     at   com.google.gson.JsonParserJavacc.generateParseException(JsonParserJavacc.java:705)
......:   at com.google.gson.JsonParserJavacc.jj_consume_token(JsonParserJavacc.java:587)
......:     at com.google.gson.JsonParserJavacc.parse(JsonParserJavacc.java:62)
......:    at com.google.gson.JsonParser.parse(JsonParser.java:54)
.....:     ... 1 more

Please suggest a solution ,I am using gson 1.4 version.The code i use is

            URLsource = new URL("http://.........);
      in = new BufferedReader(new UnicodeReader(URLsource.openStream(), "UTF-8"));
       jse = new JsonParser().parse(in);
    in.close(); 
            JsonArray info = jse.getAsJsonObject().getAsJsonArray("info");

the o/p of the url as in the browser is

    {"info":[{"restaurant_id":"","name":"Vie de France","campus_id":"","address":"600 Maryland Ave SW","city":"WASHINGTON","state":"DC","neighborhood":"","neighborhood_urlname":"","zipcode":"20024","average_entree":"6.29","chain_id":"994","phone":"(202) 554-7870","is_voicestar":"0","menu_type":"1","url":"","logo":"","details":"","latitude":"38.886877","longitude":"-77.019913","properties":"rmwa","reviews":"y","yelp_phone":"2025547870","reservation_id":"","reservation_url":"","price":"","cross_street":"","public_transit":"","restaurant_description":"","payment_methods":"","hours":"","next_open":"","restaurant_status":"","is_preorder":"","citysearch_hours":" ","minimum_order":"","minimum_order_2":"","delivery_rate":"","delivery_time":"","delivery_info":"","misc_info":"","delivery_charge":"","delivery_charge_2":"","is_pickup":"","is_delivery":"","minimum_tip_amount":"","minimum_tip_percent":"","restaurant_account_id":"","urlname":"\/dc\/washington\/239256-vie-de-france\/","facebook_fan_page":"","twitter_page":"","is_dz":"0","loyalty":"","delivery_hours":""}],"cuisines":[{"mastercuisineid":"143","cuisine":"American","urlname":"american"},{"mastercuisineid":"90","cuisine":"Bakery & Pastries","urlname":"bakery-pastries"},{"mastercuisineid":"57","cuisine":"French","urlname":"french"}]}

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:15:22+00:00Added an answer on May 16, 2026 at 3:15 am

    If your JSON is on a server and you access it through an HTTP request, you need to parse only the content, not the whole file with the headers.
    Try doing an HTTP client, use getResponse.getEntity or getResponse.getContent, and then your parser on one of these.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 501k
  • Answers 501k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I am afraid that I do not fully understand what… May 16, 2026 at 2:08 pm
  • Editorial Team
    Editorial Team added an answer Yes. The function you pass to the keypress method is… May 16, 2026 at 2:08 pm
  • Editorial Team
    Editorial Team added an answer You could try opening the PDF inside of an iFrame.… May 16, 2026 at 2:08 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am trying to convert some xml into a json object using PHP. This
I'm trying to parse some JSON using the JSon.Net library. The documentation seems a
I'm trying to parse an array of JSON objects into an array of strings
I'm trying to parse the rows in a table that I generate using Javascript
I'm trying to parse the JSON returned from SocialMention. Here's an example of what
I'm getting this error (see title) while trying to parse an XML file in
I am currently trying to use AJAX in my application via jRails. I am
I'm trying to parse the title from the following webpage: http://kid37.blogger.de/stories/1670573/ When I use
I'm trying to parse a section of a large file with Java's Scanner library,
I am trying to grab some data via JSONP. Using Firebug, I am able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.