Skip to content

Instantly share code, notes, and snippets.

@caseycrites
Created February 27, 2012 18:16
Show Gist options
  • Select an option

  • Save caseycrites/1925937 to your computer and use it in GitHub Desktop.

Select an option

Save caseycrites/1925937 to your computer and use it in GitHub Desktop.
DroidCafe cafe = new DroidCafe(new BasicAuth("key", "secret"));
cafe.get("https://go.urbanairship.com/api/apids/d17d5a62-a937-4375-9207-b50f5901ba35/", new Handler() {
@Override
public void handleMessage(Message message) {
HttpResponse result = (HttpResponse) message.obj;
switch (message.what) {
case (DroidCafe.REQUEST_RESULT):
try {
Log.e(TAG, EntityUtils.toString(result.getEntity()));
} catch (IllegalStateException e) {
Log.e(TAG, e.getMessage());
} catch (IOException e) {
Log.e(TAG, e.getMessage());
}
break;
case (DroidCafe.REQUEST_CANCEL):
Log.e(TAG, "Cancelled.");
break;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment