reading from url.openstream() misses EOL in android

by Michael » Mon, 13 Apr 2009 12:04:31 GMT


Sponsored Links
 Hi group,

I have following code in a sun jdk 1.6 desktop application as well as
in an android app. In the desktop application the html code of the
website is read in line by line as expected, but in android the EOL is
somehow missed and several, sometimes all, lines are read in in one.
What strikes me is, why does android behave different to the standard
jdk for this code?

URL url = new URL(" http://www.spiegel.de/" ;); //just an example
System.out.println(url);
DataInputStream dis = new DataInputStream(new BufferedInputStream
(url.openStream()));
while ((s = dis.readLine()) != null){
System.out.println(s);
}

Thanks for any ideas,
Michael

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



reading from url.openstream() misses EOL in android

by Michael MÁúČnch » Mon, 13 Apr 2009 12:04:38 GMT


 Hi group,

I have following code in a sun jdk 1.6 desktop application as well as in an
android app. In the desktop application the html code of the website is read
in line by line as expected, but in android the EOL is somehow missed and
several, sometimes all, lines are read in in one.
What strikes me is, why does android behave different to the standard jdk
for this code?

URL url = new URL(" http://www.spiegel.de/" ;); //just an example
System.out.println(url);
DataInputStream dis = new DataInputStream(new
BufferedInputStream(url.openStream()));
while ((s = dis.readLine()) != null){
System.out.println(s);
}

Thanks for any ideas,
Michael

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


Sponsored Links


Other Threads

1. Cursor position to the start of the text

Hi All,

   I have a small problem. In my activity i have a edittext and
button. Clicking on button I am changing the inputtype of the
edittext. Now whats when i click button the input type changes but the
cursor goes to the begining of the text in edittext. Can i retain the
same position of the cursor or can i bring the cursor to the end of
the text.
       I tried setSelection(edittextobj.getText().length()) but
doesnot work how can i achive this....

-- 

2. Tolong donk cara aktif kan Swap di Spica

Bro n suhu, tolong donk untuk cara aktif kan SWAP di Spica yg lewat ADB
Shell.
terima kasih

salam,
deddy

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

3. Bisakah kartu IM3 menggunakan Layanan IM2?

4. VOOT : Point Blank Droiders Clan

5. PC Suite For LG GW620 aka for All Android Phone :D

6. Engga bisa browsing

7. HELP: Nexus One tidak bisa bootloading