Using ANDROIDNP for message push
Introduced:
Push: The so-called message push is from the server side to the mobile terminal to send connections, transmission of certain information.
Server-side push to Android clients, there are three main ways:
1. The client periodically goes to the server to fetch or to maintain a long socket, from the nature of this is not called push, this is to go to the server to pull the data. But the implementation is simple, the main disadvantage: power consumption, etc.
2.Google C2DM, the server is abroad, unstable.
3.XMPP protocol, which is an XML-based delivery protocol with strong flexibility and scalability. It is characterized by the transfer of complexity from the client to the server side.
2.XMPP protocol
XMPP full name extensiblemessaging and Presence Protocol, formerly known as the Jabber Project, is an XML-based open Instant Messaging protocol. XMPP by Google Talk and NetEase bubble application by the vast number of netizens contact. The key features of XMPP are decentralized instant messaging systems, and the use of XML streaming. XMPP is currently being standardized by the IETF International Standards Organization.
Androidpush notification (ANDROIDPN) is a Java open source implementation based on the XMPP protocol, which contains the complete client and server side. The server side is basically modified on the basis of another open source project OpenFire.
Implementation steps:
1. Download
Androidpn-demoapp-0.5.0.zip (Official client Demo)
Http://nchc.dl.sourceforge.net/project/androidpn/androidpn-demoapp/androidpn-demoapp-0.5.0.zip
Androidpn-client-0.5.0.zip (can modify client)
Http://nchc.dl.sourceforge.net/project/androidpn/androidpn-client/androidpn-client-0.5.0.zip
Androidpn-server-0.5.0-bin.zip (ANDROIDPN server)
Http://ncu.dl.sourceforge.net/project/androidpn/androidpn-server/androidpn-server-0.5.0-bin.zip
2, click the Run.bat in C:\Users\PC\Downloads\androidnp\androidpn-server-0.5.0\bin, enter the automatic installation
Installation is successful (open again or run.bat)
3. Import androidpn-client-0.5.0 in Eclipse, reminders cannot be imported. Workaround: Copy to workspace import again.
4, in/androidpn-demoapp/res/raw/androidpn.properties Modify your server's IP such as 192.168.114
5, in Eclipse Android import androidpn-demoapp-0.5.0, run the project error
Workaround: The error reason code relies on other libraries and requires a right-click property on the specific project to tick the Asmack package file to be compiled in the order and export in the Java build path. Then clean the project, refresh and then run it.
Run again, show success
You can also push individually:
Student Profile: http://www.cnblogs.com/hanyonglu/archive/2012/03/04/2378971.html
Android uses ANDROIDNP for message push