我应该使用GCM的设备之间的实时沟通? [英] Should I use GCM for real time communication between devices?

查看:195
本文介绍了我应该使用GCM的设备之间的实时沟通?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Android聊天应用。对于这一点,我决定用GCM(谷歌云通讯)。不过话说研究了一下这件事,我已阅读,它不应该被用于类似聊天。

I am making a chat application for android. For that, I decided to use GCM (Google Cloud Messaging). But having researched a bit about it,I have read that it shouldnt be used for something like chat.

我将实施上行消息(从设备直接发送数据到GCM未经发送至同步)。这里是我的顾虑:

I will be implementing Upstream messaging (sending data from the device to the GCM directly, without a send-to-sync). Here are my concerns:


  • 将消息瞬间转移? (必应足够快,用户可以看到输入/看到)

  • 如果所有设备都在网上,什么是GCM到达客户端消息的保证。

主要的原因,我想用GCM是

The main reasons I want to use GCM is


  1. GCM使用的电池寿命最少金额

  2. 这是Android的唯一的应用程序。

如果GCM是不是我应该用什么,我应该怎么用?

If GCM is not what I should use, what should I use?

推荐答案

我的工作类似的要求,并以能够显示的反馈,如打字/ lastseen等,按我的知识为基础的XMPP解决方案的需求展望会是适当的。

I am working on a similar requirement and Looking at the requirement of being able to show feedback such as typing/lastseen etc, as per my knowledge XMPP based solution would be appropriate.

您可以通过在服务器上安装它像ejabberd / mangooseim(开源)提供XMPP服务器尝试使用asmack或任何其他客户端的Java库将它与您的服务器通信。 (有很多教程可用于此)。

you can try with available xmpp server like ejabberd/mangooseim (open source) by installing it on your server and use asmack or any other client side java library to communicate it with your server. (There are lot of tutorials available for this).

有了这么多的设置,您就可以得到你能得到诸如打字的地位,其中的舞台,水涨船高,这WhatsApp的,也有一些聊天客户端一样的gtalk /洋泾浜节目。

With this much setup you will be able to get to the stage where you are able to get status such as "typing", "gone" which whatsapp and also some chat clients like gtalk/pidgin shows.

这将大致给现有的聊天客户端是如何工作的想法。

It would roughly give an idea of how existing chat clients work.

Ejabberd完全是用Erlang编写的,如果你想扩展任何功能Erlang的知识是必须的。 (它是专为高度并行容错和非停系统,这是有帮助的聊天应用而设计的。

Ejabberd is completely written in erlang and if you want to extend any functionality erlang knowledge is must. (it is specifically designed for highly concurrent fault tolerant and non-stop systems, which was helpful in chat applications.

GCM将肯定能够在Android手机之间99.99%的时候没有太大的延迟进行沟通,但如果你想拥有像普通聊天应用烘烤状态,你将不得不彻底推倒重来。

GCM would be definitely able to communicate between the android phones 99.99%of times with not much delay but if you want to have roasters status like normal chat applications, you will have to reinvent the wheel completely.

这篇关于我应该使用GCM的设备之间的实时沟通?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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