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. DatePicker error

Hi,
I've a problem with DatePicker. This is my situation:

-I've a linearlayout
-a datepicker
-a button

When I click the button I print the date with a Toast:

        public void onClick(View v) {
                                Toast.makeText(getApplicationContext(), 
""+date.getDayOfMonth()
+"/"+
                                                
(date.getMonth()+1)+"/"+date.getYear(),Toast.LENGTH_SHORT).show
();
                        }

The date picker has as default date the today date (22/05/09 for
example). If you change the data (30/05/09 for example) and than turn
your phone the datepicker display the wrong date: 22/05/09 instead of
30/05/09 (in my example).
Furthemore I found another anomalous behaviour: if you change the day
or the month or the year with the keyboard and you dont focus out from
the field, the value of the date picker is wrong. So if the default
day is 22 and you type 23 but you dont focus out from the field and
then press the button, on Toast message is displayed 23/05/09, tha's
wrong.

Any ideas? Maybe a bug?

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

2. How to snapshot the task, and I can present the snapshot in another view?

As the subject, it looks like get the windows DC in windows Mobile.
How can I meet this effect?

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

3. Upgraded SDK, now can't do helloAndroid project

4. New App / TextBack (Auto SMS reply with Current location and custom settings per each contact)

5. Problems on Mac Android - Eclipse

6. ConnectivityManager isConnected REAL Network Connection FAIL

7. Is it possible to extend default applications?