[Android] ANDROIDPN Open Source Project Introduction

Source: Internet
Author: User

Open the androidpn project and you'll see server and client Two-part code

Server section

Locate The server code, turn on the service, double-click bin/run.bat , and listen for the 127.0.0.1:7070 Port after the service starts

Open the above connection on the browser, you can see the interface, indicating the success of the launch

Client Section

Import the code into Eclipse

View the manifest file and see the activity

Demoappactivity

Notificationdetailsactivity

Notificationsettingsactivity

There is also a service,Notificationservice

View demoappactivity

Get a button to set the Click event, launch Settings page

Start a service in the background

View Properties file, open res/raw/androidpn.properties file

Set ApiKey, it's useless here.

Set XMPP host xmpphost (xmpp is a network protocol)10.0.2.2 Server IP address

Set xmpp Port xmppport 5222

Send a notification on the server side, the client will pop up a prompt, click on the prompt, will enter the notification details screen

When we want to use it, the server-side sends there to simulate a post submission.

Client use, copy the main client code to the past,Lib/asmack.jar , the above configuration file

The XMPP Network protocol Specifies the format of client-server interaction, the protocols that are exposed on the network for network chat, and some XML strings that the client sends to the server.

The Asmack.jar jar package is The implementation of the XMPP protocol, which can stitch together those XML strings, similar to HttpClient

[Android] ANDROIDPN Open Source Project Introduction

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