Summary of several message push solutions for Android, android Solutions

Source: Internet
Author: User

Summary of several message push solutions for Android, android Solutions

Reprinted please indicate the source: http://www.cnblogs.com/Joanna-Yan/p/6241354.html

First, let's take a look at the third-party push they use in the Top500 Android app in China and the amount they occupy:

Now we will summarize the basic information and advantages and disadvantages of several push solutions on the Android platform:

1. Use GCM (Google Cloude Messaging)

The push GCM provided by Android helps developers send data to their Android applications. It is a lightweight message that instructs the Android Application to obtain new data from the server, or it may be a message, it contains 4 kb payload data (such as instant messaging applications can directly use this payload message ). The GCM service processes queued messages and transmits messages to Android applications running on the target device.

Advantages: the services provided by Google are native and simple, and there is no need to implement or deploy the server.

Disadvantages: 1. Android 2.2 and later versions are required, which cannot be pushed to many systems earlier than Android 2.2;

2. Unstable services in China. In addition, many terminal manufacturers in China have removed Google services and replaced them with their own services.

3. You need to bind your Google account, but many Chinese users do not have a Google account.

Ii. Use XMPP protocol (Openfire + Spark + Smark)

XMPP is an XML-based protocol that inherits the flexible development and strong scalability in the XML environment. The GCM servers mentioned above are also encapsulated using XMPP protocol.

Advantages: the Protocol is mature, powerful, and highly scalable. Currently, it is mainly used in many chat systems and has an open-source Java version Development Instance androidpn.

Disadvantages: the Protocol is complex, redundant (based on XML), paybytraffic, power consumption, and high hardware deployment costs.

Androidpn (Android Push Notification) is an integrated solution based on XMPP open-source components. The server is based on Openfire and the client is based on Smack. Download 2 files from 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. The detailed implementation methods are described in many articles on the Internet.

1. The client will not be reconnected after the androidpn server is restarted. This is a tragedy.

2. Because the server does not save messages, messages cannot be received if the client is offline.

3. The androidpn does not work after the message is sent, so there is no message Receipt Report or the like, resulting in the inability to improve the user experience for subsequent data analysis of applications, which is fatal to enterprise applications.

The XMPP protocol compares the cost of electricity and traffic, which consumes too much of the current smart machines. It is not the best choice for narrowband networks and unstable (mobile phone) networks. But in general, the XMPP protocol is still relatively mature.

3. Use the MQTT Protocol(Want To Know More can see http://mqtt.org /)

Lightweight, proxy-based "Publish/subscribe" message transmission protocol.

Advantages: the Protocol is simple, small, highly scalable, traffic-saving, power-saving, has been applied to the enterprise field (reference: http://mqtt.org/software), and has C ++ version of the server component rsmb.

Disadvantages: not mature enough, complicated implementation, the server component rsmb is not open-source, and the hardware deployment cost is high.

Iv. HTTP round robin

Regularly obtain the latest message from the HTTP Service API.

Advantages: easy to implement, strong controllability, and low hardware deployment costs.

Disadvantage: poor real-time performance.

5. Use third-party services

This is the third-party push introduced earlier. The client only needs to import the lib library provided by the third party and has a third-party supervisor persistent connection to receive/send messages. At the same time, the message has relatively detailed report data, which can be used for data analysis and mining to improve user experience.

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.