[android-developers] RSS feed parsing multiple images with SAX parser for same nodes/parameters

2013-12-24 Thread sweety fx
Hi,

   I am using SAX parser to parse the RSS feed. Previously, the RSS feed 
only returns an id like say12345(imageId12345/imageId and I need to 
construct an url with this id which will return multiple images in xml 
format.
Now I get the RSS feed with multiple images with same node, like, 
imageurlimage url1/imageurlimageurlimage 
url2/imageurlimageurlimage url3/imageurl.
how can I parse them into an array or list and use them later by 
constructing the xml format(the same way the image id url does) and place 
then local storage. Use the local storage xml format  to retrieve all the 
images

2 things need to considered in it. I might either get one image url and 
image id. or I may get multiple image urls instead of id. When I get one 
image url, I don't need to construct the xml.
How can I handle this situation?

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] RSS feed parsing multiple images with SAX parser for same nodes/parameters

2013-12-24 Thread Danny D
Not 100℅ understanding your question.  How familiar with SAX are you?  You 
should be handling the start element and end element for each imageurl, put 
them into a list of either String or URL or URI objects.  For the latter two, 
you'll need to add the host and any path stuff.

There are lots of SAX parsing tutorials to show you some techniques.  In 
general, you're parser is going to keep eating the imageurl objects until 
they're done.

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[android-developers] rss Feed

2012-03-06 Thread νιяιη¢нソ
hello everyone,
how do i receive feeds from different websites and display in my
application 
actually it has several options as technology , sports .
it has sub division in it...

thanks in advance.

-- 
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

[android-developers] rss Feed

2012-03-06 Thread νιяιη¢нソ
hello everyone,
how do i receive feeds from different websites and display in my
application 
actually it has several options as technology , sports .
it has sub division in it...

thanks in advance.

-- 
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

Re: [android-developers] rss Feed

2012-03-06 Thread Justin Anderson
http://catb.org/esr/faqs/smart-questions.html

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


2012/3/6 νιяιη¢нソ joinvir...@gmail.com

 hello everyone,
 how do i receive feeds from different websites and display in my
 application 
 actually it has several options as technology , sports .
 it has sub division in it...

 thanks in advance.

 --
 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


-- 
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

[android-developers] RSS feed by HttpURLConnection - html issue

2010-08-02 Thread Obason
I would like to read RSS feed by following coding:

/** Get data from the list feed */
private void GetListFeed() {
// Get the XML
URL url;
try {
String ListFeed = getString(R.string.rss_blog);

url = new URL(ListFeed);

URLConnection connection = url.openConnection();

HttpURLConnection httpConnection = (HttpURLConnection) 
connection;
httpConnection.setReadTimeout(5000);

int responseCode = httpConnection.getResponseCode();

if (responseCode == HttpURLConnection.HTTP_OK) {

InputStream in = 
httpConnection.getInputStream();

DocumentBuilderFactory dbf = 
DocumentBuilderFactory
.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();

// Parse the feed.
Document dom = db.parse(in);
Element docEle = dom.getDocumentElement();

// Get a list of each entry.
NodeList nl = 
docEle.getElementsByTagName(item);
if (nl != null  nl.getLength()  0) {
int k = nl.getLength();

for (int i = 0; i  k; i++) {
Element entry = (Element) 
nl.item(i);

Element title = 
(Element) entry

.getElementsByTagName(title).item(0);

Element description = 
(Element) entry

.getElementsByTagName(description)

.item(0);;

strTitle = 
title.getFirstChild().getNodeValue()

.trim().toString();

strDescription = 
description.getFirstChild()

.getNodeValue().trim().toString();



}

}
}

}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
} finally {
}
}

However, it description contains html symbol, such as br /, it will
stop read and display any thing before it.
For example: abc defg hi br / jkl mn opq
At android device, it will shows abc defg hi only.

I would appreciate if you guys can help me solve this issue. .



-- 
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


RE: [android-developers] RSS feed by HttpURLConnection - html issue

2010-08-02 Thread Tommy
you could read the file into a string, then do a replace on it to remove the
HTML characters then save that file temporarily as an XML file, parse it,
delete it

-Original Message-
From: android-developers@googlegroups.com
[mailto:android-develop...@googlegroups.com] On Behalf Of Obason
Sent: Sunday, August 01, 2010 6:48 PM
To: Android Developers
Subject: [android-developers] RSS feed by HttpURLConnection - html issue

I would like to read RSS feed by following coding:

/** Get data from the list feed */
private void GetListFeed() {
// Get the XML
URL url;
try {
String ListFeed = getString(R.string.rss_blog);

url = new URL(ListFeed);

URLConnection connection = url.openConnection();

HttpURLConnection httpConnection =
(HttpURLConnection) connection;
httpConnection.setReadTimeout(5000);

int responseCode = httpConnection.getResponseCode();

if (responseCode == HttpURLConnection.HTTP_OK) {

InputStream in =
httpConnection.getInputStream();

DocumentBuilderFactory dbf =
DocumentBuilderFactory
.newInstance();
DocumentBuilder db =
dbf.newDocumentBuilder();

// Parse the feed.
Document dom = db.parse(in);
Element docEle = dom.getDocumentElement();

// Get a list of each entry.
NodeList nl =
docEle.getElementsByTagName(item);
if (nl != null  nl.getLength()  0) {
int k = nl.getLength();

for (int i = 0; i  k; i++) {
Element entry = (Element)
nl.item(i);

Element title =
(Element) entry

.getElementsByTagName(title).item(0);

Element description
= (Element) entry

.getElementsByTagName(description)

.item(0);;

strTitle =
title.getFirstChild().getNodeValue()

.trim().toString();

strDescription =
description.getFirstChild()

.getNodeValue().trim().toString();



}

}
}

}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
} finally {
}
}

However, it description contains html symbol, such as br /, it will
stop read and display any thing before it.
For example: abc defg hi br / jkl mn opq
At android device, it will shows abc defg hi only.

I would appreciate if you guys can help me solve this issue. .



-- 
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

-- 
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


Re: [android-developers] RSS feed by HttpURLConnection - html issue

2010-08-02 Thread Frank Weiss
Please understand what the DOM is. There you have two text nodes
sandwiching a BR element. Either the feed should use CDATA to wrap the
marked up text or you need to decide how you are going to reconstruct
PCDATA, that is, turn the sandwiched BR element into text.

-- 
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