Package com.google.appengine.labs.repackaged.org.json

Examples of com.google.appengine.labs.repackaged.org.json.JSONObject


      surveyJson[listSurveys.size()-1-i][0] = listSurveys.get(i).getId() + "-+" + listSurveys.get(i).getTitle() + "/" + listSurveys.get(i).getDateCreated();
      surveyJson[listSurveys.size()-1-i][1] = listSurveys.get(i).getNarrative();
    }
   
    //���ʾ��������������ʽ��ΪJSON��ʽ   
    JSONObject surveyJsonObject = new JSONObject();
    try {
      surveyJsonObject.put("surveyJson", surveyJson);
    } catch (JSONException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here


   */
  public static String getError(String strerr)
  {
    String error;
    try {
      JSONObject json = new JSONObject(strerr);
      error = json.getString("error");
      return error;
     
    } catch (JSONException e) {
      log.info("error.JSON " + e.getMessage());
      return "未知错误";
View Full Code Here

    HTTPResponse response = api.account_verify_credentials(fromJID);
    String id = null;
    if(response.getResponseCode() == 200)
    {
      try {
        JSONObject respJSON = new JSONObject(new String(response.getContent()));
        id = respJSON.getString("id");
      } catch (JSONException e) {
        Common.log.warning(strJID + ":JSONid " + e.getMessage());
      }
    }
   
View Full Code Here

   * @param strJSON JSON格式字符串
   */
  public StatusJSON(String strJSON)
  {
    try {
      JSONObject json = new JSONObject(strJSON);
      created_at = json.getString("created_at");
      id = json.getString("id");
      text = json.getString("text");
      source = json.getString("source");
      userJson = new UserJSON(json.getString("user"));
     
    } catch (JSONException e) {
      //e.printStackTrace();
      Common.log.info("status.show.JSON " + e.getMessage());
    }
View Full Code Here

   * @param strJSON JSON格式字符串
   */
  public UserJSON(String strJSON)
  {
    try {
      JSONObject json = new JSONObject(strJSON);
      id = json.getString("id");
      screen_name = json.getString("screen_name");
      gender = json.getString("gender");
      description = json.getString("description");
      profile_image_url = json.getString("profile_image_url");
      location = json.getString("location");
      followers_count = json.getInt("followers_count");
      friends_count = json.getInt("friends_count");
      favourites_count = json.getInt("favourites_count");
      statuses_count = json.getInt("statuses_count");
      following = json.getBoolean("following");
    } catch (JSONException e) {
      //e.printStackTrace();
      log.info("users.show.JSON " + e.getMessage());
    }
  }
View Full Code Here

        Common.sendMessage(fromJID,"成功回复\n  " + jsonStatus.getText());
      }
      else if(response.getResponseCode() == 400)
      {
        try {
          JSONObject json = new JSONObject(new String(response.getContent()));
          String error = json.getString("error");
          Common.sendMessage(fromJID,error);
         
        } catch (JSONException e) {
          //e.printStackTrace();
          Common.log.warning(Common.getStrJID(fromJID) + " @:" + new String(response.getContent()));
View Full Code Here

TOP

Related Classes of com.google.appengine.labs.repackaged.org.json.JSONObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.