如何在应用程序或程序上发生任何更新时实现通知 [英] how to implement notification when any update is arise on the application or program

查看:101
本文介绍了如何在应用程序或程序上发生任何更新时实现通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好每一个

i想知道如何实现任何通知都是在服务器上产生的,所以如何通知客户端任何更新都被激活了???

谢谢in avance

hello every one
i want to know that how to implement any notification are arrised on the server so how to notify to client any update are arrised ???
thanks in avance

推荐答案

你有多种方法可以做到这一点。



第一种方法是轮询服务器要求更新。这个解决方案效率不高,很多参数都必须选择:更新时间 - >将影响电池和重新活动。



第二种方式是使用Google Cloud Messaging(GCM)。它提供了将数据从服务器推送到用户的解决方案。它实现起来非常简单。检查android文档: http://developer.android.com/guide/google/gcm/index.html [ ^ ]。这将优化电池,即使你的应用程序关闭,你也可以获得推送。
You have multiple ways to do that.

First way is to poll the server to ask for update. This solution isn't really efficient and lot of params are had to choose: Time to update-> will affect battery and re-activity.

Second way is to use Google Cloud Messaging(GCM). It provides a solution to push data from server to user. It's really simple to implement. Check android documentation: http://developer.android.com/guide/google/gcm/index.html[^].This will optimizes battery and you could receive push even if your app is off.


这篇关于如何在应用程序或程序上发生任何更新时实现通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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