예제 #1
0
  /** Package protected for test */
  String buildUrl() {
    StringBuilder sb = new StringBuilder();
    sb.append(serverUrl).append("?").append("email=").append(SC2DM.INSTANCE.email());
    sb.append("&regId=").append(registrationId);

    SC2DMLogger.i("Sending to uri: ", sb.toString());

    return sb.toString();
  }
예제 #2
0
  public void run() {
    String completeRequestUrl = buildUrl();

    try {
      HttpClient client = new DefaultHttpClient();
      HttpGet get = new HttpGet(completeRequestUrl);

      client.execute(get);
      SC2DMLogger.i("Registration id sent to: ", serverUrl);
    } catch (IOException io) {
      SC2DMLogger.e("Unable to send registration id to " + completeRequestUrl, io);
    }
  }