1 post / 0 new
Last post
Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:
Utilities - JSONParser

Many web-based APIs return data in JSON format.  MoSync doesn't come with an API for managing this data, but these classes can be used.

You have to create a JSONListener class, implementing events raised by the JSON processor.  To start a JSON process, create a new instance of the JSONParser, and pass the JSON as a string.

String temp = "{\"glossary\": \"\"}"
JSONParser mJSONParser;
mJSONParser.addListener(this);
mJSONParser.parseString(temp);

More examples are in this blog post http://www.mosync.com/blog/2010/03/working-json-data

AttachmentSize
JSONParser.zip2.5 KB