TJ wrote:
> Mark, thanks for the help But, I an also getting the same error msg
> when I try pulling the JSON file from twitter.com.
> thanks for the help.
> 
> String url = "http://twitter.com/statuses/user_timeline.json?
> screen_name=huskyr";
> HttpClient httpclient = new DefaultHttpClient();
> HttpGet httpget = new HttpGet(url);
> HttpResponse response;
> InputStream instream = entity.getContent();
> String result= convertStreamToString(instream);
> JSONObject json=new JSONObject(result);

Rather than entity.getContent() and whatever convertStreamToString() is,
use a BasicResponseHandler to get String content back from a Web service.

Visit http://commonsware.com/AndTutorials, scroll down, and click on the
Source Code link. Tutorial #17 will demonstrate accessing Twitter via
HttpClient and a BasicResponseHandler, parsing it into a JSONObject.
However, that is for a status update -- starting in Tutorial #18, I dump
manual Twitter HTTP stuff like a bad habit and switch to using JTwitter.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android 1.6 Programming Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to