@Override public void run() { JsonRequest<GetContactsResult> req = new JsonRequest<GetContactsResult>( Constant.SERVER_GET_CONTACTS + "/" + u.getUsername() + "/contacts", GetContactsResult.class); GetContactsResult r = client.get(req); // Log.d(Constant.LOG_TAG, "post: " + r.toString()); BusProvider.getBus().post(r); }
@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); }
@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); }