Android instance RSS client development (1)

Source: Internet
Author: User
First, we must understand what RSS is:

  • RSS refers to Really Simple Syndication (truly simple combination)
  • RSS enables you to aggregate (Syndicate) website content
  • RSS defines a very simple way to share and view titles and content
  • RSS files can be automatically updated
  • RSS allows personalization of views for different websites
  • RSS is written in XML


RSS is designed to display selected data. If no
RSS, users have to come to your website every day to check new content. This is too time-consuming for many users. Through RSS feed (RSS is usually called news feed or RSS feed ), users can use RSS aggregators to check your website updates more quickly (RSS aggregators are websites or software used to aggregate and classify RSS feeds ). Because
RSS data is small and can be quickly loaded. It can be easily used by services similar to mobile phones or PDAs. Websites with similar content (Web-rings) can easily share content on their websites to make these websites better and more valuable.

Who should use RSS?

Network administrators who seldom update content do not need RSS!

RSS is helpful for websites that frequently update content, such:

News sites
List news titles, dates, and descriptions
Enterprise
List news and new products
Calendar
List coming schedules and important dates
Site update
List updated pages or new pages
How RSS works

With RSS, you register your content at a company named aggregator.

One step is to create an RSS document and save it with the. xml suffix. Upload the file to your website. Next, register with an RSS aggregator. Every day, the aggregators go to the registered website to search for RSS documents, verify their links, and display information about the feed, so that customers can link to documents that interest them.

Tip: Please go to RSS
Publish this free RSS feed service.

An RSS instance document

RSS documents use a simple self-describing Syntax:

Let's take a look at a simple RSS document:

<?xml version="1.0" encoding="ISO-8859-1" ?><rss version="2.0"><channel>  <title>W3School Home Page</title>  <link>http://www.w3school.com.cn</link>  <description>Free web building tutorials</description>  <item>    <title>RSS Tutorial</title>    <link>http://www.w3school.com.cn/rss</link>    <description>New RSS tutorial on W3School</description>  </item>  <item>    <title>XML Tutorial</title>    <link>http://www.w3school.com.cn/xml</link>    <description>New XML tutorial on W3School</description>  </item></channel></rss>

The first line in the document: XML Declaration-defines the XML version and character encoding used in the document. This example complies with the 1.0 specification and uses the ISO-8859-1 (Latin-1/West European) Character Set.

The next line identifies this document as an RSS document's RSS Declaration (in this example, RSS version 2.0 ).

The next line contains the <channel> element. This element is used to describe RSS feed.

<Channel> An element has three required child elements:

  • <Title>-define the channel title. (For example, w3school homepage)
  • <Link>-defines the hyperlink to the channel. (For example, www.w3school.com.cn)
  • <Description>-describe this channel (for example, a free website construction tutorial)

Each <channel> element can have one or more <item> elements.

Each <item> element can define an article or "story" in an RSS feed ".

<Item> An element has three required child elements:

  • <Title>-define the project title. (For example, RSS tutorial)
  • <Link>-define a hyperlink to the project. (Such as http://www.w3school.com.cn/rss)
  • <Description>-describe this project (for example, w3school RSS tutorial)

Finally, the <channel> and <RSS> elements are closed in the next two lines.

RSS comments

The syntax for writing comments in RSS is similar to that in HTML:

<!-- This is an RSS comment -->
RSS is written in XML

Because RSS is also XML, remember:

  • All elements must have tags.
  • The element is case sensitive.
  • Elements must be correctly nested
  • The attribute value must be enclosed in quotation marks.

The above is a brief introduction to RSS. For details, go to w3school, http://www.w3school.com.cn/rss/rss_channel.asp. Our later androidrss client was built on this basis.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.