I want to parse the some data from this page: http://www.bbc.co.uk/radio1/programmes/schedules/england/2013/03/1.json
The data I want to parse is the titles however I am
If you read the javadoc of JSONObject#get(String)
which is actually HashMap.get(String)
, it states
Returns: the value to which the specified key is mapped, or null if this map contains no mapping for the key
Your JSON does not contain a mapping for the key time
.
Edit:
If you meant title
instead of time
, take this extract of the JSON
{"schedule":{"service":{"type":"radio","key":"radio1","title":"BBC Radio 1",...
You need to first get schedule
as a JSONObject
, then service
as a JSONObject
, and then title
as a normal String
value. Apply this differently depending on the type of JSON value.
use something like JSONGen to better understand your data structures, maybe even map your data to the generated objects using google-gson library