如何实现白鲸或WhatsApp的像Android

如何实现白鲸或WhatsApp的像Android

本文介绍了如何实现白鲸或WhatsApp的像Android 2.1的消息传递系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发在我的Andr​​oid应用程序的消息应用程序。该消息会像WhatsApp的和白。我GOOGLE了一下,发现C2DM的Andr​​oid 2.2可以发送推送通知到设备。但是,这不是在Android 2.1。任何人都知道如何WhatsApp的发送通知2.1设备?

I am trying to develop a message app within my android app. The message will be like whatsapp and beluga. I googled it and found C2DM Android 2.2 can send the push notifications to the device. However, this is not available on Android 2.1. Anyone knows how whatsapp send the notifications for 2.1 devices?

推荐答案

有关Android的:WhatsApp的是建立在C2DM和应用程序打开时,它会打开一个XMPP连接到他们的服务,即时传递邮件。他们也可能会使用MQTT作为一个协议,以尽量减少电池的使用。这基本上它。

For Android: Whatsapp is build upon C2DM and when the app opens it opens an XMPP connection to their service to deliver the messages instantly. They also might use MQTT as a protocol to minimize battery usage. That's basically it.

编辑:我学会了更多,Facebook的使用MQTT在他们的消息应用程序。 WhatsApp的是建立在XMPP与自己的扩展。他们的服务器端运行在ejabbard的顶部(在二郎XMPP实现)。 http://www.ejabberd.im/

I learned more, Facebook uses MQTT in their messaging app. Whatsapp is build upon XMPP with their own extensions. Their server side runs on top of ejabbard (XMPP implementation in erlang). http://www.ejabberd.im/

在pre 2.1设备的WhatsApp可能保持连接打开自己的XMPP服务器的背景,但,这不是电池的寿命真的很不错。

On pre 2.1 devices WhatsApp probably keeps a connection open to their XMPP servers in the background but this is not really good for battery life.

这篇关于如何实现白鲸或WhatsApp的像Android 2.1的消息传递系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 05:31