在Android中检索从GOOGLE FINANCE API URL返回的JSON数据 [英] Retrieve JSON data returned from GOOGLE FINANCE API URL in android
问题描述
我正在使用以下URL来获取任何公司的报价信息. http://finance.google.com/finance/info?client = ig& q = bom:ranbaxy
I am using the following URL to get quotes information of any company. http://finance.google.com/finance/info?client=ig&q=bom:ranbaxy
(这里是ranbaxy公司).
(here ranbaxy is the company).
下面给出了什么网站或URL返回.
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"
} ]
在以下返回的json值中
没有给出objectname或array name.我无法从该URL检索数据.
in the following returned json values objectname or array name is not given . i am unable to retrieve the data from this url.
我只想在TextView中显示每个数据.我在我正在获取值的类中扩展了AsyncTask.
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.
推荐答案
这看起来像一个json数组.使用
This looks like a json array. use
JSONArray jsar=new JSONArray(result);
然后使用for循环进行解析.另外,请查看此
Then use for loop to parse.Also, take a look at this
希望这会有所帮助
这篇关于在Android中检索从GOOGLE FINANCE API URL返回的JSON数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!