带计时器的推送通知或线程

发布于 2024-09-03 19:49:40 字数 221 浏览 0 评论 0原文

在我的应用程序中,我具有像 Twitter 这样的功能,当您没有刷新屏幕时,如果有新消息,您会收到一条消息“您有 n 个新消息”和一个刷新按钮,按下该按钮将刷新屏幕。

我基本上是从带有一些 url 的 xml 中获取所有数据。

在线程的情况下,我需要在一段时间后调用计时器,这可能会影响应用程序的性能。

有人可以建议使用推送通知或带计时器的线程更好吗?

提前致谢。

In my application, I'm having functionality like twitter that when you have not refreshed your screen, and if there're new messages then you get this message that "You have n new messages" and a refresh button, which on press will refresh the screen.

I'm basically fetching all the data from an xml with some url.

In case of thread, I need to call a timer after some time period which might affect the app performance.

Can anybody please suggest wheather what will be better to use push notifications or thread with timer?

Thanx in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

罪#恶を代价 2024-09-10 19:49:40

如果您只想通知用户可用的新数据,那么一定要使用推送通知,而不是使用计时器在线程上拉取信息。

拉取信息总是比从外部源推送消息消耗更多的资源。

If you want to just notify the user about the new data available then definitely go for Push notifications rather than pulling the information on thread with timer.

Pulling of information always consume more resources than pushing message from external sources.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文