一段时间后解析xml android
在我的应用程序中,我需要解析 XML 文件&显示有关活动的信息。就像股市一样&当服务器上的信息更新时,我需要解析 xml 和显示信息。我需要在 5 分钟后访问服务器显示有关活动的更新信息。我尝试过使用 AsyncTask &计时器但出了问题。如果有人有演示,请提供链接、教程..
非常紧急..
感谢您的帮助....
In my app i need to parse the XML file & display info on activity. just like stock market as & when information at server got updated i need to parse the xml & display the info.I need to hit the server after 5 minutes & display the updated info on activity. I have tried using AsyncTask & timer but something going wrong.If any one is having demo then please provide link,tutorial..
It's extermely urgent..
thnx for any help....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您想在后台运行轮询循环?您应该能够使用计时器来启动检查和异步任务来实际请求/解析。设置计时器处理有点复杂,但是这个问题的公认答案应该有所帮助:
如何使用AsyncTask和Timer获取XML?
Sounds like you want to run a polling loop in the background? You should be able to use a timer to kick off the check and an async task to actually request/parse. There's a bit of complexity in setting up the timer handling, the accepted answer to this question should help however:
How to get XML using AsyncTask and Timer?