Parses an instance in json format data 2 and a json instance
Parsing instances in json format data 2
Json is a commonly used data transmission format on mobile platforms. In this example, two Json format file generation and parsing methods are provided.
The first method is to read and write json files through JsonReader and JsonWriter. the sdk must be later than 11.
Second, perform json read/write operations on objects such as JSONArray, JSONObject, and JSONTokener. the sdk must be later than 9. This method can also be implemented in other sdk versions by introducing jar packages.
After the client is started, click the write json button (1st or 3 buttons) to generate a Json file (location: cdjson under the sdcard root directory. json), and then click the read json button (2nd or 4 buttons ). The JsonParserUtil class in the instance corresponds to the first parsing method, and the JsonParserUtil2 class corresponds to the second parsing method.
:Http://www.dwz.cn/zrqoe
Click to write a json file to generate a Json file, and print a json string. Click to read the json file to generate a list in json format. The list is displayed in ListView.
Click item to display the cd data (parsed by json)