问题
I am using the following URL to get quotes information of any company. http://finance.google.com/finance/info?client=ig&q=bom:ranbaxy
(here ranbaxy is the company).
what website or url returns is given below.
[ {
"id": "672832" ,
"t" : "500359" ,
"e" : "BOM" ,
"l" : "859.90" ,
"l_fix" : "859.90" ,
"l_cur" : "Rs.859.90" ,
"s": "0" ,
"ltt":"3:50PM GMT+5:30" ,
"lt" : "Apr 1, 3:50PM GMT+5:30" ,
"lt_dts" : "2015-04-01T15:50:23Z" ,
"c" : "" ,
"c_fix" : "" ,
"cp" : "" ,
"cp_fix" : "" ,
"ccol" : "" ,
"pcls_fix" : "859.9"
} ]
in the following returned json values objectname or array name is not given . i am unable to retrieve the data from this url.
i just want to show each data in TextView. i have extended AsyncTask in the class where i am getting the values.
need the solution for it. thanks in Advance.
回答1:
This looks like a json array. use
JSONArray jsar=new JSONArray(result);
Then use for loop to parse.Also, take a look at this
Hope this helps
来源:https://stackoverflow.com/questions/32825589/retrieve-json-data-returned-from-google-finance-api-url-in-android