我从 themoviedb API 收到以下 JSON 响应:
\n{\n "popularity":1640.159,\n "vote_count":32,\n "video":false,\n "poster_path":"\\/9Rj8l6gElLpRL7Kj17iZhrT5Zuw.jpg",\n "id":734309,\n "adult":false,\n "backdrop_path":"\\/7fvdg211A2L0mHddvzyArRuRalp.jpg",\n "original_language":"en",\n "original_title":"Santana",\n "genre_ids":[\n 28\n ],\n "title":"Santana",\n "vote_average":6.3,\n "overview":"Two brothers \xe2\x80\x94 one a narcotics agent and the other a general \xe2\x80\x94 finally discover the identity of the drug lord who murdered their parents decades ago. They may kill each other before capturing the bad guys.",\n "release_date":"2020-08-28"\n }\nRun Code Online (Sandbox Code Playgroud)\n我必须使用poster_path但我无法理解它,因为它只是图像名称而不是任何路径。我不知道如何从这个poster_path字符串中获取图像。
请帮我!当我将网址粘贴到 Google 上时,我什么也没得到。
\n{
"stocks":{
"0":{
"name":"Torn City Stock Exchange",
"acronym":"TCSE",
"director":"None",
"current_price":10018.747,
"market_cap":0,
"total_shares":0,
"available_shares":0,
"forecast":"Average",
"demand":"High"
},
"1":{
"name":"Torn City and Shanghai Banking Corporation",
"acronym":"TSBC",
"director":"Mr. Gareth Davies",
"current_price":529.863,
"market_cap":4300246833486,
"total_shares":8115771121,
"available_shares":0,
"forecast":"Average",
"demand":"High",
"benefit":{
"requirement":4000000,
"description":"Entitled to receive occasional dividends"
}
},
"2":{
"name":"Torn City Investment Banking",
"acronym":"TCB",
"director":"Mr. Paul Davies",
"current_price":502.819,
"market_cap":5771083717274,
"total_shares":11477457529,
"available_shares":1539811799,
"forecast":"Average",
"demand":"Average",
"benefit":{
"requirement":1500000,
"description":"Entitled to receive improved interest rates"
}
}
}
Run Code Online (Sandbox Code Playgroud)
如何使用键值对遍历所有项目?我想提取名称、首字母缩略词、总份额、available_shares 和需求。请帮忙!我正在使用 java 创建一个 android 应用程序,但我被困在这里。