如何将数据推送到设备?
我需要一种方法将数据从网络服务器推送到我的设备,如何实现这一点?我希望有一个指南来帮助我。我一直被 C2DM 困住了,这对我来说实在是太难以处理了。这些指南只是逐行列出代码,并没有解释它们的作用,这很糟糕。如果您能给我链接到一个可以教如何将数据推送到 Android 设备的指南,我会很高兴。
I need a way to push data to my device from my web server, how can I accomplish this? And I would love a guide to help me. I've been stuck on C2DM forever and its just too much for me to handle. The guides are just all list lines after lines of code and don't explain what they do, which sucks. I'd love if you could link me to a guide that can teaches how to push data to the android device.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我同意没有太多关于 CD2M 的文档。对我来说,最好的文档是 Google 示例。您可以抓住它们并按照代码来了解其工作原理。示例如下此处和此处。
C2DMBaseReceiver
以提供您自己的实现(当您收到消息时会收到回调,错误时会收到回调,等等)。请记住在您的清单中注册这些内容,查看这些示例中的清单以了解如何操作。I agree that there isn't too much documentation about CD2M. For me, the best docs are the Google examples. You can grab them and follow the code to understand how this works. Examples are here and here.
C2DMBaseReceiver
to provide your own implementation (you get a callback when you receive a message, a callback for an error, and so on). Remember to register these things in your Manifest, look at the Manifest in those examples to know how to do it.阅读这篇博文。它引用了许多可能性,并且可能正是您正在寻找的。 http://tokudu.com/2010/how-to-实现-push-notifications-for-android/
Read this blog post. It references many possibilities and is probably just what you are looking for. http://tokudu.com/2010/how-to-implement-push-notifications-for-android/
在 .NET 3.5 或更高版本中使用 Windows Communication Foundation (WCF)。
Use Windows Communication Foundation (WCF) in .NET 3.5 or greater.