[android-developers] Re: Getting the content of a web page.

2008-10-26 Thread Christine
this works: String buffer = null; HttpResponse response = client.execute(get); entity = response.getEntity(); status = response.getStatusLine().getStatusCode(); InputStream in = entity.getContent(); for (int i = in.read(); i

[android-developers] Re: Getting the content of a web page.

2008-10-26 Thread JamesB
The first one still gives me an IOException. It forces me to add throws or a couple of try/catch's for error handling but either way it gets IOException. This is the code for that: public String getPrice(String symbol) throws ClientProtocolException, IOException { DefaultHttpClient

[android-developers] Re: Getting the content of a web page.

2008-10-26 Thread Christine
just for the record, your androidmanifest file does contain this line? uses-permission android:name=android.permission.INTERNET / otherwise, the snippets come from my program, which works fine. I removed the try/finally block in the example, for readability. Christine On Oct 26, 10:34 pm,

[android-developers] Re: Getting the content of a web page.

2008-10-26 Thread Christine
Jason, you're right about the efficiency of appending to a string. I use it for short messages only. I use an input stream to create a DOM document, which probably isn't efficient either. But then, if all you get is 200 bytes at most, who cares. Christine On Oct 26, 11:06 pm, Jason Proctor

[android-developers] Re: Getting the content of a web page.

2008-10-26 Thread JamesB
That was it! Thanks! On Oct 26, 6:03 pm, Christine [EMAIL PROTECTED] wrote: just for the record, your androidmanifest file does contain this line?   uses-permission android:name=android.permission.INTERNET / otherwise, the snippets come from my program, which works fine. I removed the