ANDROID push notification for information push usage

Source: Internet
Author: User
Tags android push notification

This article describes the use of the ANDROIDPN project for push.

In the previous article, the solution to push in Android was mentioned, and one of the more mature solutions was to use the XMPP protocol to implement it. The ANDROIDPN project is an open source project that uses the XMPP protocol for information push. Here we introduce the use of the process.

Features of the Apndroid Push notification:

Fast integration: Provides a faster way to use than C2DM and avoids various restrictions.

No server Setup required: Reduce the additional server burden by using cloud services.

Can push messages to the site page at the same time, Android phone

Less power consumption, less traffic.

Specific configuration process:

First, we need to download and


Extract two packages, Eclipse Import client, configure target platform, open raw/ file, configure client program.

1. If the emulator is running the client program, configure the Xmpphost to[ The simulator considers as the address of the host, is the loopback address of the emulator itself, represents the gateway address, represents the DNS address, represents the network address of the target device], and details about the emulator, You can refer to the relevant information, not detailed here.

Xmppport=5222 is the server's XMPP service listening port

Run Androidpn-server-0.5.0\bin\run.bat boot server, access from the browser (ANDROIDPN server has a lightweight Web server, On 7070-Port listening requests, accept user-entered text messages)

Running the client, the client initiates a connection request to the server, and after successful registration, the server can identify the client and maintain a long IP connection with the client.

2. If you are testing the simulator of other machines in the same LAN (or using the same wireless router's WiFi connection), you need to set this value to the server machine's LAN IP.

For example, your computer and Android phone are connected to the same wireless router WiFi, the computer's IP address is and the IP address of the phone is, this time need to change this value to xmpphost= or power The IP address of the brain, it can be used on the phone.

3. If the test is not on the same LAN, we need to set this value to the IP address of the server.

The specific configuration is as follows:


My Computer IP is:

The server runs the main interface:




The push information is shown in the following interface:


The test results are as follows:

Finally the test passed in my simulator and the real machine. ^_^

Finally, hope that the reprint of friends can respect the author's labor results, plus reprint address: Thank you.

Complete. ^_^

Related Article

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: 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.