Android Open Source - acs-android-sdk C C Response

From Project

Back to project page acs-android-sdk.


The source code is released under:

Apache License

If you think the Android project acs-android-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*from w  ww .j  a  v a2  s .co  m*/
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class CCResponse {
  protected CCMeta meta;
  protected JSONObject responseData;
  protected CCResponse[] compoundResponses;

  public CCMeta getMeta() {
    return meta;

  public String getMetaString() {
    return meta.toString();

  public JSONObject getResponseData() {
    return responseData;

  public CCResponse[] getCompoundResponses() {
    return compoundResponses;

  public CCResponse(JSONObject jObject) throws ACSClientError {
    try {
      meta = new CCMeta(jObject.getJSONObject("meta"));
    } catch (JSONException e1) {
      throw new ACSClientError("Invalid Server Response: Response missing meta");
    } catch (Exception e1) {
      throw new ACSClientError(e1.getLocalizedMessage());
    try {
      responseData = jObject.getJSONObject("response");
      // check if this is a compound response
      JSONArray responseArray = responseData.getJSONArray("responses");
      if (responseArray.length() > 0) {
        compoundResponses = new CCResponse[responseArray.length()];
        for (int i = 0; i < responseArray.length(); i++) {
          CCResponse tmpResponse = new CCResponse(responseArray.getJSONObject(i));
          compoundResponses[i] = tmpResponse;
    } catch (Exception e) {



Java Source Code List