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. Help required for android SDK : newbie

Hello

  I just started my experiments in android. I am using Ubuntu 9.10. I
installed Java SDK, Eclipse and downloaded SDK from android-sdk_r06-
linux_86.tgz as from http://developer.android.com/sdk/index.html. I
tried to execute the program `android` tools directory inside the
unziped directory ( android-sdk-linux_86 ) and next step was to set
package.


sa...@salil-laptop:~/Downloads/android-sdk-linux_86/tools$ ./android
./android
Starting Android SDK and AVD Manager
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.

<<<<<<

GUI came up.
'Available Packages' ->  I could see one line
https://dl-ssl.google.com/android/repository/repository.xml. When I
click the checkbox, It poped up a windows "Loading source". It failed
with message

XML verification failed for 
http://dl-ssl.google.com/android/repository/repository.xml.
Error: java.lang.NullPointerException

There I could see two leaves for the top level item as follows
    * No suitable XML schema validator could be found in your Java
environment. Please update your version of java
    * no packages found

Java version I am running in my system is

sa...@salil-laptop:~/Downloads/android-sdk-linux_86/tools$ java -
version
java version "1.5.0"
gij (GNU libgcj) version 4.4.1

Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

sa...@salil-laptop:~/Downloads/android-sdk-linux_86/tools$ javac -
version
javac 1.6.0_20


Any idea what is going wrong here ? Is there any work around for this
issue

Through browser I can see the repository.xml file. Is there any way I
can specify the xml file through command line or some thing.

Thanks
Salil

-- 

2. Share : Running windows 95 di android

Just share ajha..sory kalo repost

buat yang mau coba2 atau pamer.

Jalanin windows 95/98 di android phone ...lucu juga..

silahkan baca2 di:

http://forum.xda-developers.com/showthread.php?t=692682

http://forum.xda-developers.com/showthread.php?t=694105


sukses jalan di milestone

jadi inget pernah running qemu di motorola Linux ROKR E6


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

3. wtp smart curang?

4. Help Spica brick

5. Singapura --- Wonder Girls Muncul

6. Kenapa Device yg always Online boros batt yah?

7. hello salam kenal