Back to project page android-http.
The source code is released under:
Apache License
If you think the Android project android-http listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.loopj; //from w ww. j ava 2 s. co m import org.json.*; import com.loopj.android.http.*; class TwitterRestClientUsage { public void getPublicTimeline() { TwitterRestClient.get("statuses/public_timeline.json", null, new JsonHttpResponseHandler() { @Override public void onSuccess(JSONArray timeline) { try { JSONObject firstEvent = (JSONObject) timeline.get(0); String tweetText = firstEvent.getString("text"); // Do something with the response System.out.println(tweetText); } catch (JSONException e) { e.printStackTrace(); } } }); } }