Only one line of output with DataInputStream.readLine() in android

by Michael » Mon, 13 Apr 2009 12:08:27 GMT


Sponsored Links
 Hi group,

I use the following code in a java-program on my desktop with sun-
jdk-1.6.0.13 to read a html file on my webserver. I get several lines
of output as expected. But when I use it in an android-app, the whole
html file is read in only one line.

Where could be the difference between the desktop and android
implementation? Do I have to change something like the encoding or
linebreak character?

URL url = new URL(" http://mysite.intern/test.html" ;);
System.out.println(url);
DataInputStream dis = new DataInputStream(new BufferedInputStream
(url.openStream()));
        while ((s = dis.readLine()) != null){
        System.out.println(s);
}

Thanks,
Michael

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. scrollView.scrollTo() speed control?

I would like to programmatically scroll to a specific point in a
scrollView...which I can do just fine...
Except I land there instantly.

Is there a way to control the speed of the scroll so it looks smoother?

Could somebody point me to an animation with a scrollview?

Thank you!
-Mike

-- 

2. Need Help, Desktop Battery Charger Magic

Dear rekan2,

Ada yang di Bandung dan punya desktop battery charger buat Magic ga?
Butuh pinjem bentar buat ngecharge batere Magic saya.
Magic saya ga mau dinyalain, tampaknya baterenya benar-benar drained.
Dicharge di handset juga ga mau nyala.

Mohon infonya jika ada yang punya ya.

Thanks

-- 
"Indonesian Android Community [id-android]" 

3. Kaos Android Greets Jakarta & [WTS] Android Stickers Se

4. Open native Maps with "directions"??

5. Kaos Android Greets Jakarta & [WTS] Android Stickers Se

6. Is it possible to use the USB connection in my app?

7. Salam kenal yah semua