Пример #1
0
    @Override
    public void run() {
      JsonRequest<PutContactsResult> req =
          new JsonRequest<PutContactsResult>(
              Constant.SERVER_GET_CONTACTS + "/" + u.getUsername() + "/contacts",
              PutContactsResult.class);
      req.setHttpBody(new JsonBody(c));

      req.setMethod(HttpMethods.Put);
      PutContactsResult r = client.put(req);
      BusProvider.getBus().post(r);
    }
Пример #2
0
 @Override
 public void run() {
   JsonRequest<SendMessageResult> req =
       new JsonRequest<SendMessageResult>(
           Constant.SERVER_SEND_MESSAGE_ADRESS, SendMessageResult.class);
   req.setHttpBody(new JsonBody(m));
   SendMessageResult r = client.post(req);
   if (r == null) {
     Log.d(Constant.LOG_TAG, "Send message error!");
     return;
   }
   BusProvider.getBus().post(r);
 }
Пример #3
0
 @Override
 public void run() {
   JsonRequest<LoginResult> req =
       new JsonRequest<LoginResult>(Constant.SERVER_LOGIN_ADDRESS, LoginResult.class);
   req.setHttpBody(new JsonBody(u));
   final LoginResult r = client.post(req);
   JPushInterface.setAliasAndTags(
       context,
       u.getUsername(),
       null,
       new TagAliasCallback() {
         @Override
         public void gotResult(int i, String s, Set<String> set) {
           if (i == 0) {
             BusProvider.getBus().post(r);
           } else {
             Log.d(Constant.LOG_TAG, "Set alias error!");
           }
         }
       });
 }