简体   繁体   English

如何从 rss 提要制作主屏幕小部件?

[英]How do I make home screen widget from rss feed?

This is a three-part question.这是一个三部分的问题。 I am new to Android and am trying to create a new app that reads RSS feeds and shows them on the home screen in the form of a widget .我是 Android 的新手,我正在尝试创建一个新的应用程序来读取 RSS 提要并以widget的形式在主屏幕上显示它们。

  1. What network calls are required to show a well-formatted RSS feed?显示格式良好的 RSS 提要需要哪些网络调用?
  2. What layout structures can I use to hold the received content?我可以使用哪些布局结构来保存接收到的内容?
  3. How can I make the web browser open the link to the RSS feed if the user selects it from this widget?如果用户从此小部件中选择它,如何使 web 浏览器打开指向 RSS 提要的链接?

Thanks for your help!谢谢你的帮助!

I am new to Android and am trying to create a new app that reads RSS feeds and shows them on the home screen in the form of a widget.我是 Android 的新手,我正在尝试创建一个新的应用程序来读取 RSS 提要并以小部件的形式在主屏幕上显示它们。

First, the interactive bits of the home screen are called "app widgets".首先,主屏幕的交互部分称为“应用小部件”。

Second, this is unlikely to be easy, except perhaps on Honeycomb.其次,这不太容易,除非在 Honeycomb 上。

What network calls are required to show a well-formatted RSS feed?显示格式良好的 RSS 提要需要哪些网络调用?

Ask whoever you are getting the RSS feed from.询问您从谁那里获取 RSS 提要。 Typically, it is HTTP.通常为 HTTP。 However, if you spend the time to research what "RSS" and "network calls" mean, you will learn that they are largely unrelated.但是,如果您花时间研究“RSS”和“网络调用”的含义,您会发现它们在很大程度上是不相关的。 I can give you an RSS feed in the form of a piece of paper, for example.例如,我可以以一张纸的形式给你一个 RSS 提要。

What layout structures can I use to hold the received content?我可以使用哪些布局结构来保存接收到的内容?

On Honeycomb, you can use a ListView for your feed in an app widget.在 Honeycomb 上,您可以在应用小部件中为您的提要使用ListView

How can I make the web browser open the link to the RSS feed if the user selects it from this widget?如果用户从此小部件中选择它,如何使 web 浏览器打开指向 RSS 提要的链接?

Use startActivity() to launch an ACTION_VIEW Intent on the URL.使用startActivity()在 URL 上启动ACTION_VIEW Intent

However, if you spend the time to research what "RSS feed" and "link" are, you will learn that browsers do not know how to display RSS feeds (an XML format).但是,如果您花时间研究“RSS 提要”和“链接”是什么,您会发现浏览器不知道如何显示 RSS 提要(XML 格式)。 I am guessing that you really mean "open the link to the item from the RSS feed".我猜你的意思是“从 RSS 提要打开项目的链接”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM