[Android] socket applications on mobile phones, android

Source: Internet
Author: User

[Android] socket applications on mobile phones, android

1. Mobile Assistant

 

1.1 USB Link

You can read the PID and VID of the mobile phone, identify the unique device, and install the corresponding driver for the mobile phone.

Socket Communication on fixed ports

 

1.2 WIFI connection

The pc sends UDP data packets in the entire network segment of the computer. After the mobile phone connects to wifi, it can listen to this port, receive the data packets, and try to establish a connection with the pc.

 

Bluetooth 1.3

Pairing through ipvthsocket

 

2. Purpose

2.1 large data volume, high real-time transmission requirements

Chat tools, stock trading

Socket persistent connection, heartbeat packet, send heartbeat packet to the server every 30 seconds

 

2.2 small data size

Message push and Precision Marketing

Send a UDP packet every 10 minutes. The packet must contain authentication information (application + User ID)

 

Import java. util. timer; import java. util. timerTask; public class TimerTest {/*** @ param args */public static void main (String [] args) {Timer timer = new Timer (); timer. schedule (new TimerTask () {@ Override public void run () {System. out. println ("1") ;}},); // executed once every second after 1 second }}

 

 

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.