Android message Push

Source: Internet
Author: User

1. Learn how to enable clients to receive server-side in real-time: The first is the way that clients use pull, that is, to go to the server to get information over a period of time to see if any updated information appears. The second is the way the server uses push (push), when new information is available on the server side, push the latest information to the client. This allows the client to automatically receive the message.

2. Several common solution implementation principles

1) Polling method: The client periodically sends an inquiry message to the server, synchronizing the message as soon as the server changes, but the frequency of polling is too slow may cause some message delay, too fast will be a lot of consumption of network broadband and battery;

2) SMS (push) mode: By intercepting the SMS message and parsing the message content to understand the server's commands, but this way the average user is economically difficult to bear, need to rely on operators;

3) Establish a long-term connection between client and server, so that the timeliness and real-time of the message can be realized;

3. For a large number of data pushes and does not need to be pushed in a timely manner, polling is more appropriate. Use the classes that integrate service components to define and implement them.

4. Long-term connection of the third-party message push, it is applicable to timely push, the amount of data is not very large message push, because the message push needs to rely on third-party servers to be forwarded, if the third party's server crashes your message pushes will also be affected, this may not happen much. For the third party message push way I also have some research, mainly study the aurora message push and Baidu cloud message push. In fact, these two methods are similar, are their own package of a method, to push the message, want to learn to their official online registration developer account for research, you can download the demo on the official website for research, because the method has been packaged well, it is not difficult to use, will be able to conduct a study, Note, however, that message pushes in this way need to rely on third-party forwarding.

5. Of course, to want to secure and timely message push, or need to do their own understanding of the relevant protocols, their own encapsulation method for message push. Generally available protocols are: Mott Protocol, XMPP protocol.

1) MQTT is a lightweight message publishing/subscription protocol that is the ideal solution for implementing a messaging push server based on a mobile client.

2) XMPP (Extensible Communication and Presentation Protocol) is an Extensible Markup Language (XML)-based protocol that is used for instant messaging (IM) and online probing. The agreement may eventually allow Internet users to send instant messages to anyone else on the Internet. Google's official C2DM server is also packaged using the XMPP protocol. It is said that this agreement is a more appropriate message to push the protocol, interested parties can also study, I small rookie is also in the study, but there is no clue, tangled ...

Finally, say, maybe some people think I said is a bit of nonsense, I just want to give those and I like the small rookie a train of thought, this is also my study summarizes.

Android message Push

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.