android:实现推送通知
我正在制作一个应用程序,我想在收到 Gmail 等传入短信时收到通知(推送通知),这样当我们收到任何邮件时,启动器图标上就会有通知。任何帮助将不胜感激。 谢谢。
I am making an app in which i want to recieve notification(PUSH Notification) on recieve of incoming sms like gmail in the way that as we recieve any mail there is notification on launcher icon.Any help will be appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
查看 Android 云到设备消息传递框架 或 本教程。
编辑:
另一个教程
Have a look at the Android Cloud to Device Messaging Framework or this tutorial.
EDIT:
Another tutorial
我猜你并不真正需要推送通知(就 C2D 的含义而言)。您需要的是在收到短信时收到通知。
对于 C2D,您需要一个云(顾名思义)来接收您的短信,然后通知您。但如果您只想收到短信通知,这不是解决方案。
为此,解决方案是
BroadcastReceiver
。只需注册您自己的广播接收器并检查短信即可。此主题可能会有所帮助
在收到 BroadcastReceiver 的通知后,您应该通知用户使用通知管理器
I guess you don't really need Push notification (in the sense what C2D means). What you need is to get notified if a SMS is received.
For C2D you would need a Cloud (as the name suggests) that receives your SMS and then notifies you. But if you just want to be notified on SMS reception that wouldn't be the solution.
For this, the solution would be the
BroadcastReceiver
. Simply register your own Broadcast receiver and check for SMS.This Topic could help
After you have been notified by the BroadcastReceiver, you should notify the user using the Notification Manager
是的
https://github.com/commonsguy/cw-advandroid/tree /master/Push/C2DM/
这是最基本的示例之一,在实现 c2dm 时对我帮助很大。尝试一下
如果您觉得有用,请投票并接受答案
如果您需要进一步帮助,请发表评论
yup
https://github.com/commonsguy/cw-advandroid/tree/master/Push/C2DM/
this is one of the most basic example which helped me a lot while implementing c2dm.have a try
vote up and accept answer if you find it useful
comment if u need further assistance