Code example for JSONStringer

Methods: endObjectkeyobjecttoString

0
		String req_SmsId = "smsIds";
		JSONArray smsIds = request.getContent().getJSONArray(req_SmsId);
		List<String> ids = Utils.getStringListFromJSONArray(smsIds);
		int count = Telephony._delSmsMessage(cr, ids);
 
		JSONStringer js = new JSONStringer();
		js.object();
		js.key("count").value(count);
		js.endObject();
 
		return Message.getResponseMessage(request.getRegion(), request
				.getCommand(), true, new JSONObject(js.toString()));
	} 
 
	public void delMmsMessage(Message request) {
 
		String req_MmsId = "mmsIds";
		try { 
			JSONArray mmsIds = request.getContent().getJSONArray(req_MmsId);
			List<String> ids = Utils.getStringListFromJSONArray(mmsIds);
Contextual code suggestions in your IDE  Get Codota for Java