Code example for JSONObject: Parsing JSON documents

Methods: getDouble, getJSONObject, getLong, getString

0
		return data;
	} 
 
	static public PushZoneLocation getPushZoneLocationFromData(JSONObject resultData) throws JSONException
	{ 
		JSONObject response = resultData.getJSONObject("response");
 
		PushZoneLocation location = new PushZoneLocation();
 
		location.setName(response.getString("name"));
		location.setLat(response.getDouble("lat"));
		location.setLng(response.getDouble("lng"));
		location.setDistanceTo(response.getLong("distance"));
 
		return location;
	} 
 
	static public Map<String, Object> getSendAppOpenData(Context context) {
		Map<String, Object> data = new HashMap<String, Object>();
 
		data.put("application", PreferenceUtils.getApplicationId(context));