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); }
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); }
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); }