使用RSS feed显示图像 [英] Display image using a RSS feed

查看:142
本文介绍了使用RSS feed显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用RSS阅读器的应用程序。我的问题是,我不知道什么是显示图像的最佳方式。越接近我能得到是拉图像描述()。我知道我可以通过自己解析字符串,得到图像的URL,但我想知道是否有解决这个问题一个更优雅的方式。我尝试使用SAX和DOM类,但我无法弄清楚。

I have an application in which use a RSS feed reader. My problem is that I don't know what is the best way to display an image. The closer I could get was to pull the image description (). I know I could parse this String by myself and get the image url, but I was wondering if there is a more elegant way to solve this issue. I tried using the SAX and the DOM classes, but I couldn't figure it out.

非常感谢,
Gratzi餐馆

Thanks a lot, Gratzi

推荐答案

您询问如何获取从XML RSS提要的图像网址是什么?没有什么内置那将帮助您解析XML,比你已经注意到SAX或DOM其他的SDK。有一个学习曲线的,但他们是合理的做法。

are you asking how to get the image URL from the XML RSS feed? there's nothing built into the SDK that's going to help you parse the XML, other than SAX or DOM which you have already noted. there is a learning curve to those, but they are reasonable approaches.

有一个名为 ROME项目这是一个API,用于解析强劲种种提要,包括RSS。你可以导入这个库到你的Andr​​oid应用程序。注意,这个库有其他的依赖关系,所以你必须导入它们也。我没有做过往心里去,但我听说在Android应用使用罗马人,所以这是可行的。

there's a project called ROME that is an API for robustly parsing all sorts of feeds, including RSS. you could import this library into your android app. note that this library has other dependencies, so you'd have to import them also. i haven't done it personally, but i have heard of people using ROME in android apps, so it's doable.

或者更简单地说,如果你只想图片网址和你并不需要一个完整的饲料分析器,可以使用java.util.regex中解析出你想要的领域。

or more simply, if you just want the image URL and you don't need a complete feed parser, you can use java.util.regex to parse out the fields you want.

如果你问如何你有网址后显示图像,kcoppock的回答解释了吧。

if you are asking how to display the image after you have the URL, kcoppock's answer explains it.

这篇关于使用RSS feed显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆