示例#1
0
  private void sendEmail(String eMail) {
    email = eMail;
    JSONObject postBody = new JSONObject();

    try {
      postBody.put("userId", Login.getUserId(loginSettings));
      postBody.put("email", eMail);
      postBody.put("type", 1);
    } catch (JSONException e) {
      e.printStackTrace();
    }

    HttpPost httpPost = BuildHttpRequest.setEntity(postBody, emailUrl);

    AsynchronousHttpClient a = new AsynchronousHttpClient();
    a.sendRequest(httpPost, responseListener, loginSettings);
  }
示例#2
0
  private void sendUsername(String us) {
    username = us;
    JSONObject postBody = new JSONObject();

    try {
      postBody.put("userId", Login.getUserId(loginSettings));
      postBody.put("opnUsername", us);
      postBody.put("type", 1);
    } catch (JSONException e) {
      e.printStackTrace();
    }

    HttpPost httpPost = BuildHttpRequest.setEntity(postBody, usernameUrl);

    AsynchronousHttpClient a = new AsynchronousHttpClient();
    a.sendRequest(httpPost, responseListener, loginSettings);
  }
示例#3
0
  public void findOpponentRandom(View v) {
    JSONObject postBody = new JSONObject();

    try {
      postBody.put("userId", Login.getUserId(loginSettings));
      postBody.put("type", 1);
    } catch (JSONException e) {
      e.printStackTrace();
    }

    HttpPost httpPost = BuildHttpRequest.setEntity(postBody, randomUrl);

    AsynchronousHttpClient a = new AsynchronousHttpClient();
    a.sendRequest(httpPost, randomResponseListener, loginSettings);

    alert(
        "Finding opponent",
        "Searching for an opponent to play against. This can take some minutes...",
        this);
  }