适用于 Android 客户端的 GAE 聊天服务器
我正在寻找一个最佳解决方案来在 GAE 上为 Android 客户端实现聊天服务器。
目前,我使用 C2DM 通知特定用户有新消息,并在通知后从服务器提取数据。但有时C2DM服务器会延迟通知消息并且不再实时。
我还查看了 XMPP,似乎必须拥有像 google talk 这样的外部 XMPP 服务器,所以这也不是我想要的。
有没有其他方法可以在GAE上实现聊天?任何建议都热烈欢迎!
I am looking for an optimal solution to implement chat server for android clients on GAE.
At the moment I use C2DM to notify particular users about new messages and pull data from server after such notification. But sometimes C2DM servers delay notification message and it stops to be realtime.
I also had a look on XMPP and it seems that it is mandatory to have an external XMPP server like google talk, so it is not what I am looking for too.
Is there another way to implement chat on GAE? Any advices are warmly appriceted!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您遇到 C2DM 延迟的原因是它不是实时的。谷歌实际上是这样说的:这不是最可靠的方法。建议使用第三方服务器,例如 XMPP
The Reason why you are experiencing Delay with C2DM is because it is not real time. Google actually says this: It isnt the most reliable way. It suggest having a third party server such as XMPP
您可以使用 Channel API 在 App Engine 上实现聊天,但是唯一支持的客户端是浏览器。如果您准备让您的 Android 应用程序基于浏览器,这将是一个解决方案 - 否则,您将不得不考虑第三方服务,例如 城市飞艇。
You can implement chat on App Engine using the Channel API, but the only supported clients for that are browsers. If you're prepared to make your Android app browser-based, that would be a solution - otherwise, you will have to look into third-party services, like Urban Airship.