I am new to android and I am trying to handle a JSON response in respect to a request, like:
https://s.yimg.com/aq/autoc?query=YH®ion=US&lang=en-US&callback=whatever
which gives the response (which looks like a function call):
whatever({"ResultSet":{"Query":"YH","Result":[{"symbol":"YHOO","name":"Yahoo! Inc.","exch":"NAS","type":"S","exchDisp":"NASDAQ","typeDisp":"Equity"},{"symbol":"YHO.DE","name":"Yahoo! Inc.","exch":"GER","type":"S","exchDisp":"XETRA","typeDisp":"Equity"},{"symbol":"YHO.HM","name":"YAHOO","exch":"HAM","type":"S","exchDisp":"Hamburg","typeDisp":"Equity"},{"symbol":"002304.SZ","name":"YHGF","exch":"SHZ","type":"S","exchDisp":"Shenzhen","typeDisp":"Equity"},{"symbol":"Y08.SI","name":"YHI International Limited","exch":"SES","type":"S","exchDisp":"Singapore","typeDisp":"Equity"},{"symbol":"YHOO151120C00035000","name":"YHOO Nov 2015 call 35.000","exch":"OPR","type":"O","exchDisp":"OPR","typeDisp":"Option"},{"symbol":"YHOO151218C00035000","name":"YHOO Dec 2015 call 35.000","exch":"OPR","type":"O","exchDisp":"OPR","typeDisp":"Option"},{"symbol":"YHOO.MX","name":"Yahoo! Inc.","exch":"MEX","type":"S","exchDisp":"Mexico","typeDisp":"Equity"},{"symbol":"YHOO151218C00040000","name":"YHOO Dec 2015 call 40.000","exch":"OPR","type":"O","exchDisp":"OPR","typeDisp":"Option"},{"symbol":"YHO.DU","name":"YAHOO","exch":"DUS","type":"S","exchDisp":"Dusseldorf Stock Exchange","typeDisp":"Equity"}]}});
In order to handle this response, do I just strip off the characters whatever(
and the bracket )
at the end, or can I use this kind of string in a more sophisticated way. I found some infos here and here, but I am not even sure those are related with my questions.
Can I use my response in a more sophisticated way then, or should I strip the arguments from that function?