The string is like so:
[{"Id":287,"Name":"aaaaaaaa","ProjectType":"GP"}, ... snip ...]
This STRING is not JSON yet since it is a string even though it was served up as JSON.
I am trying to convert that to a structure that I can work with in my Java app.
Can somebody help me out here. The examples I’ve found so far didn’t work out for me. Basically, I was hoping to be able to iterate over the Dictionaries that are within the List.
My latest attempt to convert the string into a json, was this:
JSONObject data = new JSONObject(json_string);
This, however, returned null.
Thank you.
look at using the Gson Lib – it’s very good at handling this sort of thing. If you implement it using generics you can create a set of serializers which would let you import data very nicely from mobile APIs. If you want more info on example implementations let me know
Source:
http://code.google.com/p/google-gson/
documentation:
https://sites.google.com/site/gson/gson-user-guide