Method for realizing sharing of Socket communication service on Android platform

A technology of communication and service components, applied in the field of communication, can solve problems that are not conducive to business expansion and code sharing, waste Socket resources, affect user operation response, etc., and achieve the goal of realizing program running space, improving application range, and improving operating efficiency Effect

Active Publication Date: 2012-06-27
XIAMEN YAXON NETWORKS CO LTD
View PDF4 Cites 19 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This method couples network communication with UI view operations, which is not conducive to business expansion and code sharing
If the call process is synchronously blocked, it may affect the user's operation response on the UI view, and the method of creating a new thread to send and receive network data will face problems such as multiple connection conflicts, multi-thread synchronization, and waste of Socket resources.
[0003] To sum up, the same network service may be called by multiple UI views, and if the establishment of a socket is bound to each UI view, there are many uncertainties in its synchronization control work and resource sharing

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for realizing sharing of Socket communication service on Android platform
  • Method for realizing sharing of Socket communication service on Android platform
  • Method for realizing sharing of Socket communication service on Android platform

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0023] The present invention will be further described in conjunction with the accompanying drawings and specific embodiments.

[0024] like Figure 1-Figure 4 Shown, the present invention specifically comprises the following steps:

[0025] The steps of creating a Socket management module, encapsulating all operations of the network layer as interfaces, including the establishment and connection of Sockets, the creation of intermediate pipeline data streams, and the receiving and sending of Socket network data;

[0026] Create an independent thread to run the Socket management module, communicate messages between threads through Handler, and use thread message queues to manage multiple service requests;

[0027] The step of encapsulating the Socket management module as a service component of the system, the service component provides interfaces for service creation, destruction, binding and unbinding, so as to manage the shared use of the Socket service by multiple callers; ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to the technical field of communication. A method for realizing sharing of Socket communication service on an Android platform comprises the following steps of: creating a Socket management module, and encapsulating all pieces of operation of a network layer into interfaces, wherein the operation comprises Socket establishment and connection, creation of intermediate pipeline data streams, and receiving and sending of Socket network data; creating independent threads to operate the Socket management module, performing message communication between the threads through a Handler, and managing requests for a plurality of pieces of service by using a thread message queue; encapsulating the Socket management module into a service component of a system, wherein the service component provides the interfaces for creating, destroying, binding and unbinding the service; changing an external interface of Socket service into an IBinder object of Android; and performing remote proxy on the IBinder object by using an Android interface description language (AIDL), and performing inter-process communication and analysis. The method is applicable to sharing management of the Socket communication service on the Android platform.

Description

technical field [0001] The invention relates to the field of communication technology, in particular to a shared management method for Socket communication services applied on an Android platform. Background technique [0002] On the Android platform, network communication is usually established using Socket. Initiating a network service usually establishes a Socket connection first, and then obtains the intermediate pipeline connection data flow for sending and receiving data. During the application process, you can initiate a network service in a UI view operation, wait for the Socket connection to be established, and perform network communication. After the service ends, disconnect the network connection and release the Socket resource. This method couples network communication with UI view operations, which is not conducive to business expansion and code sharing. If the call process is synchronously blocked, it may affect the user's operation response on the UI view, a...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F9/44
Inventor 郑振贵许宁吕瑞明林剑棍王文欣
Owner XIAMEN YAXON NETWORKS CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products