Anyone got any ideas?
On Jun 23, 8:07 am, "bsbi...@googlemail.com" <bsbi...@googlemail.com>
wrote:
> Hi,
>
> The example I posted is a cut down version.
>
> In the real example the inputstream is passed as a argument to the sax
> parser.
>
> I just wanted to show that the
>
> String line = buff.readLine();
> System.out.println(line);
> while (line != null) {
> line = buff.readLine();
> System.out.println(line);
> }
>
> Does not read the whole rss.xml on the HTC android phone
>
> On Jun 22, 5:05 pm, Marco Nelissen <marc...@android.com> wrote:
>
>
>
> > On Mon, Jun 22, 2009 at 5:09 AM, bsbi...@googlemail.com <
>
> > bsbi...@googlemail.com> wrote:
>
> > > Hello,
>
> > > I am reading the following URL to test a RSS parser.
>
> > >http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/uk/rss.xm
>
> > > When using the same code on a Android HTC phone the whole resource
> > > cannot be read. There are no exceptions being thrown. I am guessing
> > > the rss.xml is too large to be read in?
>
> > > I use a sax parser after the block of code which complains.
>
> > Complains about what? The code you posted tries to read the entire file and
> > dumps it to stdout, which means that even you passed the input stream to the
> > parser (which the code you posted doesn't do, since the input stream object
> > has limited scope), there would not be anything left for it to read.
>
> > > try {
> > > InputStream urlInputStream = null;
>
> > > URL url = new URL("http://newsrss.bbc.co.uk/rss/
> > > newsonline_uk_edition/uk/rss.xml<http://newsrss.bbc.co.uk/rss/%0Anewsonline_uk_edition/uk/rss.xml>
> > > ");
>
> > > BufferedReader buff = new BufferedReader(new
> > > InputStreamReader
> > > (url.openStream()));
>
> > > String line = buff.readLine();
> > > System.out.println(line);
>
> > > while (line != null) {
> > > line = buff.readLine();
> > > System.out.println(line);
> > > }
>
> > > if (urlInputStream != null) {
> > > urlInputStream.close();
> > > }
> > > } catch (MalformedURLException e) {
> > > e.printStackTrace();
> > > } catch (IOException e) {
> > > e.printStackTrace();
> > > }
> > > }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---