Summary of several Android message push scenarios

Source: Internet
Author: User

First look at a list of the third-party pushes and amounts used in the domestic Top500 Android app:

Now summarize the basic situation and pros and cons of several push scenarios under the Android platform:

First, using GCM (Google cloude Messaging)

The push GCM that comes with Android can help developers send data to their Android apps. It is a lightweight message that tells the Android application to have new data to get from the server, or it may be a message that contains 4KB of payload data (such as instant messaging applications that can use the payload message directly). The GCM service processes queued messages and passes messages to the Android application running on the target device.

Pros: Google offers services, native, and simple, without the need to implement and deploy the server.

Cons: 1. Android 2.2 is required, for many 2.2 of the system can not be pushed;

2. Domestic services are not stable. And many domestic terminal manufacturers have to remove Google's services, replace their own.

3. Users are required to bind Google accounts, but many domestic users do not have a Google account.

Ii. use of the XMPP Protocol (Openfire+spark+smark)

XMPP is an XML-based protocol that inherits the flexibility of development in XML environments and is highly extensible. Including the above-mentioned GCM server bottom is also in the XMPP protocol encapsulation.

Advantages: The protocol is mature, strong, extensible, is mainly used in many chat systems, and has open source Java version of the development example ANDROIDPN.

Disadvantage: The protocol is more complex, redundant (based on XML), charge flow, charge power, and the cost of deploying hardware is high.

ANDROIDPN (Android Push Notification) is a set of integrated solutions based on the XMPP open source component, which is based on OpenFire and client based smack. Download 2 files to the ANDROIDPN Project home page (http://sourceforge.net/projects/androidpn/): Androidpn-server-0.5.0-bin.zip and Androidpn-client-0.5.0.zip are the code for the server and client respectively. Detailed implementation methods There are many articles on the Internet.

1.ANDROIDPN Service End multiplicity The client will not re-connect after the start, this is very tragic

2. Because the server does not save the message, it causes the client to not receive the message if it is currently offline

3.ANDROIDPN sent out the message is no matter, so there is no message receipt report, and so on, resulting in the application of subsequent data analysis of the user Experience improvement, which for enterprise-class application is a fatal wound.

XMPP protocol compared to the cost of electricity, the current consumption of intelligent machines is too large, narrow-band networks and unstable (mobile) network is not the best choice. But in general, the XMPP protocol is still relatively mature.

third, the use of the MQTT protocol (want to learn more can see http://mqtt.org/)

Lightweight, agent-based "Publish/subscribe" mode for message transfer protocols.

Advantages: The protocol is concise, small, scalable, and provincial traffic, power saving, has been applied to the Enterprise Domain (reference: http://mqtt.org/software), and has a C + + version of the service-side components RSMB.

Disadvantage: not mature enough, achieve more complex, service-side components RSMB not open source, the deployment of hardware cost is high.

Iv. http round robin mode

Periodically get the latest messages to the HTTP server-side interface (WEB service API).

Advantages: Easy to implement, strong controllability, low cost of deployment hardware.

Disadvantage: Poor real-time.

V. Use of third-party services

This is the third-party push, the client only needs to import the Lib library provided by the third party, there is a third-party management long connection, responsible for receiving/sending the message. At the same time, the message has more detailed report data, can be used to do data analysis, mining, improve the user experience.

Summary of several Android message push scenarios

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.