Android push service based on Xmapp protocol (pro-Test available)

Source: Internet
Author: User

OnePC-side running server directly


1. Go to directory Androidpn-server-0.5.0\bin, double-click Run.bat


2. Browser Input URL: http://127.0.0.1:7070/index.do


3. Import Androidpn-client to eclipse


4. Configure the target platform, open the Androidpn-client/res/raw/androidpn.properties file, make the following changes

apikey=1234567890xmpphost=10.0.2.2 (simulator uses this address, the real machine simulates the words, then writes the IP address of your PC) xmppport=5222

5. Enter the push message in the browser and the client's notification bar to receive


6. Additional instructions, server-side configuration properties: Androidpn-server-0.5.0\conf\config.properties

Apikey=1234567890admin.console.host=127.0.0.1admin.console.port=7070xmpp.ssl.storetype=jksxmpp.ssl.keystore= conf/security/keystorexmpp.ssl.keypass=changeitxmpp.ssl.truststore=conf/security/truststorexmpp.ssl.trustpass= Changeit

7. The following shows the effect of running


Server side, enter the push message, click the Submit button


The client notification bar receives the message


After clicking on the


Two, source code building server


1. Androidpn the entire copy of the folder to the directory D:\Program Files\apache software foundation\myproject\


2. Modify the file D:\Program Files\apache software foundation\tomcat 8.0\conf\server.xml,

Add the following statement between <Host></Host>

<context path= "/androidpushserver" docbase= "D:\Program Files\apache software foundation\myproject\androidpn\ WebRoot "/>

3. Open the MySQL client, use the command in the client, create the database Androidpn

Create Database Androidpn;

4. Modify the file D:\Program Files\apache software foundation\myproject\androidpn\resources\jdbc.properties as shown below

# JDBC Configurationjdbcdriverclassname=com.mysql.jdbc.driver#jdbcurl=jdbc:mysql://localhost:3306/android? useunicode=true&characterencoding=utf-8&zerodatetimebehavior=converttonulljdbcurl=jdbc:mysql:// Localhost:3306/androidpn?useunicode=true&characterencoding=utf-8&zerodatetimebehavior= converttonullhibernate.dialect=org.hibernate.dialect.mysql5innodbdialectjdbcusername=root//Database user name jdbcpassword=                           //To fill in the database password # DBCP Pool settingsjdbcinitialsize=5jdbcmaxactive=10jdbcmaxidle=5jdbcmaxwait= 30000jdbcvalidationquery=select 1
Note: If not, also modify D:\Program Files\apache software foundation\myproject\androidpn\webroot\web-inf\classes\ Jdbc.properties


5. Because the project being run is not in the root directory of Tomcat 8.0, there are several files that need to be modified

1 "D:\Program Files\apache software foundation\myproject\androidpn\webroot\decorators\default.jsp, the front slash is removed, such as"/ Index.do ", modified to" index.do "2 D:\Program files\apache software foundation\myproject\androidpn\webroot\index.jsp, will"/ Images/androidpn.png "modified to" Images/androidpn.png "3" D:\Program Files\apache software foundation\myproject\androidpn\ webroot\web-inf\pages\index.jsp, change "/images/androidpn.png" to "Images/androidpn.png"



6. Launch Tomcat 8.0


7. Input in Browser: http://localhost:8010/androidpushServer/, run successfully (note: 8010 port number for my own Tomcat server)


Third, client and server-side package download

Android push client and server-side code


Android push service based on Xmapp protocol (pro-Test available)

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.