diff options
author | Koushik Dutta <koush@koushikdutta.com> | 2013-05-16 01:07:50 -0600 |
---|---|---|
committer | Koushik Dutta <koush@koushikdutta.com> | 2013-05-16 01:07:50 -0600 |
commit | 119119e21de482d19d2e21f8922138895ce7fb62 (patch) | |
tree | da0a2c530cb8e7bc590563fb7808e936ea33392a /README.md | |
parent | fc1231a7faaf4d770d18f2ab7ca5fd7000c848eb (diff) | |
download | AndroidAsync-119119e21de482d19d2e21f8922138895ce7fb62.tar.gz AndroidAsync-119119e21de482d19d2e21f8922138895ce7fb62.tar.bz2 AndroidAsync-119119e21de482d19d2e21f8922138895ce7fb62.zip |
Update README.md
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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
|