新闻应用/RSS 订阅和 XML

News App/ RSS Feed and XML

我正在为 android wear 创建一个新闻应用程序,并且已经在这个 nigel 上停留了几个月。我知道什么是 RSS 提要等等。

这是BBC新闻技术费http://feeds.bbci.co.uk/news/technology/rss.xml

我可以在我的应用程序中显示提要的描述,但这大约是 1 句话。我想从文章中获取所有内容并将其保存到字符串变量或文件中。我需要使用这个字符串并通过我制定的算法进行处理。这是一个例子,

一篇文章在rss中有这样的描述

EE, the UK's largest mobile phone operator, is fined £1m by the regulator Ofcom for breaching rules on handling customer complaints.

但真正的文章是这样的。

EE, the UK's largest mobile phone operator, has been fined £1m by the regulator Ofcom for breaching rules on handling customer complaints.

Ofcom said from 2011 to 2014, the firm did not provide its customers with full information about their right to take complaints to an independent body.

EE should have informed customers about this in writing, but did not, it found.

The investigation into EE is part of Ofcom's wider look at complaints handling by telecoms companies.

EE stressed that the fine related to historic conduct.

"While this in no way excuses it, it is important to note that we identified issues in our complaints handling and began our programme to tackle these problems head-on in 2013, before Ofcom started their investigation," a spokesperson for the company said.

"We have made considerable improvements since then. Ofcom's current figures highlight that complaints into Ofcom about EE have fallen by 50% in the past year." 'Deadlock'

EE customers have the right to take complaints that cannot be resolved to an independent body up to two months after the complaint is first made.

Between 22 July 2011 and 8 April 2014, Ofcom found that a number of customers who had requested a "deadlock letter" as a precursor to referring their complaint to the independent body never received such a letter.

It also found that EE did not notify some customers on their paper bills that they could refer any complaint to this body free of charge.

"It's vital that customers can access all the information they need when they're pursuing a complaint," said Ofcom's Claudio Pollack.

"Ofcom imposes strict rules on how providers must handle complaints and treats any breach of these rules very seriously. The fine imposed against EE takes account of the serious failings that occurred in the company's complaints handling, and the extended period over which these took place."

The regulator said EE had 20 days to pay the penalty, which would then be passed on the UK Treasury.

我可以得到最上面的描述,但我不能得到像第二个那样的文本。我不是新手,我不要求完整的代码。我真的不希望它被关闭。这个问题使我的应用程序延迟了几个月。我看过许多图书馆,但 none 的图书馆都在做我想做的事。谢谢。

rss 文件是 xml 文档。这是它的摘录

   <item> 
      <title>Facebook to pay video clip creators</title>  
      <description>Facebook is to start sharing revenue from advertising with video creators.</description>  
      <link>http://www.bbc.co.uk/news/technology-33362722#sa-ns_mchannel=rss&amp;ns_source=PublicRSS20-sa</link>  
      <guid isPermaLink="false">http://www.bbc.co.uk/news/technology-33362722</guid>  
      <pubDate>Thu, 02 Jul 2015 13:45:27 GMT</pubDate>  
      <media:thumbnail width="66" height="49" url="http://c.files.bbci.co.uk/17D36/production/_84009579_fbook.jpg"/>  
      <media:thumbnail width="144" height="81" url="http://c.files.bbci.co.uk/218E/production/_84009580_fbook.jpg"/> 
    </item>  

所以您通过 Sax 或 Dom 之类的东西解析文档,提取每个项目元素,这将是文章元数据。从 item 元素中提取 link 元素,从中提取实际的 url 并使用它来检索文章。