JSON Parsing Exception in Android -


i have following problem: have json file on server try parse in android. following error message:

06-13 19:24:39.025: e/json parser(17169): error parsing data org.json.jsonexception: value  of type java.lang.string cannot converted jsonobject

here json file:

    { "settings":[   {      "rss":"true",      "rss_feed":"http://test.com/rss.rss"   } ],  "map_locations":[   {      "title":"büro toronto",      "address":"123 younge street toronto"   },   {      "title":"büro new york",      "address":"time square new york"   } ] } 

and code:

        jsonparser jparser = new jsonparser();          jsonobject json = jparser.getjsonfromurl(settings_url);          try {             jsonobject c = json.getjsonarray("settings").getjsonobject(0);              rss = c.getboolean("rss");              jsonarray jmap = json.getjsonarray("map_locations");             (int = 0; < jmap.length(); i++) {                 jsonobject c2 = jmap.getjsonobject(i);                  string map_title = c2.getstring("title");                 string map_address = c2.getstring("address");                  maplisttitle.add(map_title);                 maplistaddress.add(map_address);             }              url_to_rssfeed = c.getstring("rss_feed");         } catch (jsonexception e) {             e.printstacktrace();         } catch (nullpointerexception e) {             e.printstacktrace();         } 

thanks in advance!

the strange thing didn't change (at knowdledge) , did work before. if need more information let me know!

wow ok found answer... had change

bufferedreader reader = new bufferedreader(new inputstreamreader(                     is, "iso-8859-1"), 8); 

to

to bufferedreader reader = new bufferedreader(new inputstreamreader(                     is, "utf-8"), 8); 

strange enought did work few hours before same settings.

but alot help!


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -