aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorKoushik Dutta <koush@koushikdutta.com>2013-05-16 01:07:50 -0600
committerKoushik Dutta <koush@koushikdutta.com>2013-05-16 01:07:50 -0600
commit119119e21de482d19d2e21f8922138895ce7fb62 (patch)
treeda0a2c530cb8e7bc590563fb7808e936ea33392a /README.md
parentfc1231a7faaf4d770d18f2ab7ca5fd7000c848eb (diff)
downloadAndroidAsync-119119e21de482d19d2e21f8922138895ce7fb62.tar.gz
AndroidAsync-119119e21de482d19d2e21f8922138895ce7fb62.tar.bz2
AndroidAsync-119119e21de482d19d2e21f8922138895ce7fb62.zip
Update README.md
Diffstat (limited to 'README.md')
-rw-r--r--README.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/README.md b/README.md
index 68b5903..947ae11 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,25 @@ AsyncHttpClient.getDefaultInstance().get(url, new AsyncHttpClient.StringCallback
```
+### Download a JSON Object
+
+```java
+// url is the URL to download. The callback will be invoked on the UI thread
+// once the download is complete.
+AsyncHttpClient.getDefaultInstance().get(url, new AsyncHttpClient.JSONObjectCallback() {
+ // Callback is invoked with any exceptions/errors, and the result, if available.
+ @Override
+ public void onCompleted(Exception e, JSONObject result) {
+ if (e != null) {
+ e.printStackTrace();
+ return;
+ }
+ System.out.println("I got a JSONObject: " + result);
+ }
+});
+```
+
+
### Download a url to a file