I need to receive data from server in JSON format in my Android app -


here json

 {   "keys": [     "10_ultimate",     "20_yemensoft"   ] } 

when hit directly in url getting correct response not android. have seen in jsonlint json format correct. getting following message:

org.json.jsonexception: unterminated array @ character 11 of [b@41c16df8

when hit url http://192.168.0.103:8080/androidrest/financial/finlist

i getting correct json response validated in jsonlint.com

{   "keys" : [ "10_ultimate", "20_yemensoft" ] } 

when try deserialize android saysorg.json.jsonexception: unterminated array @ character 11

 @override             public void onsuccess(int statuscode, header[] headers, byte[] response) {                   jsonobject jsnobj  = new jsonobject();                   string res = response.tostring();                 try {                     jsonobject json = new jsonobject(res);                     jsonarray jsnarry = json.getjsonarray("keys");                     (int = 0 ; < jsnarry.length() ; i++){                          jsnobj = jsnarry.getjsonobject(i);                     }                     log.d("jsnobj",jsnobj.tostring());                     log.d("jsnarry",jsnarry.tostring());                  } catch (jsonexception e) {                     e.printstacktrace();                 }                  log.d("the positive  are",res);              } 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -