コード例 #1
0
    protected byte[] doInBackground(String... params) {

      byte[] image = null;
      String username = params[0];
      try {
        MultivaluedMap map = new MultivaluedMapImpl();
        map.add("username", username);

        RestClient tc = new RestClient(map);
        image = tc.postForImage("user/retrieve/profile/image");
      } catch (Exception e) {
        e.printStackTrace();
      }
      return image;
    }
コード例 #2
0
    protected String doInBackground(String... params) {

      String jsonString = null;
      String username = params[0];
      try {
        MultivaluedMap map = new MultivaluedMapImpl();
        map.add("username", username);

        RestClient tc = new RestClient(map);
        jsonString = tc.postForString("user/retrieve/pending/contact/requests");
      } catch (Exception e) {
        e.printStackTrace();
      }
      return jsonString;
    }
コード例 #3
0
    protected Integer doInBackground(Integer... params) {

      Integer responseCode = 0;
      try {
        MultivaluedMap map = new MultivaluedMapImpl();
        map.add(
            "username",
            SharedPreferencesHelper.getStringProperty(getApplicationContext(), "username"));
        map.add("contactId", params[0].toString());

        RestClient tc = new RestClient(map);
        responseCode = tc.postForResponseCode("user/delete/contact");
      } catch (Exception e) {
        e.printStackTrace();
      }
      return responseCode;
    }