Well I’ve been trying for like 3 hours now. Using lots of apis it still doesn’t work.
I’m trying to parse
{
"id": 8029390,
"uid": "fdABNhroHsr0",
"user": {
"username": "Skrillex",
"permalink": "skrillex"
},
"uri": "/skrillex/cat-rats",
"duration": 305042,
"token": "VgA2a",
"name": "cat-rats",
"title": "CAT RATS",
"commentable": true,
"revealComments": true,
"commentUri": "/skrillex/cat-rats/comments/",
"streamUrl": "http://media.soundcloud.com/stream/fdABNhroHsr0?stream_token=VgA2a",
"waveformUrl": "http://w1.sndcdn.com/fdABNhroHsr0_m.png",
"propertiesUri": "/skrillex/cat-rats/properties/",
"statusUri": "/transcodings/fdABNhroHsr0",
"replacingUid": null,
"preprocessingReady": null
}
in to an array/list.
Any help?
I’m using Jackson from http://codehaus.org/ and so far it has lived up to all my needs.
You don’t quite deal with json as raw strings in an arraylist, but rather as POJOs, here’s a quick example with a subset of your json.
The mapper creates a Pojo object with the values filled in. Then you can use that object for anything you need.
Here are a couple of links for the Jackson project:
http://jackson.codehaus.org/
http://wiki.fasterxml.com/JacksonInFiveMinutes
The latest all in one JAR is here:
http://jackson.codehaus.org/1.9.1/jackson-all-1.9.1.jar