CN104796458A - Information fusion method for Android system - Google Patents
Information fusion method for Android system Download PDFInfo
- Publication number
- CN104796458A CN104796458A CN201510125860.2A CN201510125860A CN104796458A CN 104796458 A CN104796458 A CN 104796458A CN 201510125860 A CN201510125860 A CN 201510125860A CN 104796458 A CN104796458 A CN 104796458A
- Authority
- CN
- China
- Prior art keywords
- intelligent terminal
- android system
- json data
- bitmap
- fusion method
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
- H04L12/16—Arrangements for providing special services to substations
- H04L12/18—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
- H04L12/1895—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast for short real-time information, e.g. alarms, notifications, alerts, updates
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention relates to the intelligent terminal technology, aims to solve the problem that the synchronization of Notification can not be realized for the existing intelligent terminals of multiple Android systems and provides an information fusion method for the Android system. The technical scheme is that a first intelligent terminal monitors the notification information of the self, creates the CS Socket and waits for connection, wherein processing is not conducted if no connection exists till connection is accessed. After the Socket is built and successfully connected, if the first intelligent terminal monitors the notification information of the self, the data in the notification information will be obtained and encapsulated into the JSON data, the first intelligent terminal sends the encapsulated JSON data to a second intelligent terminal connected with the first intelligent terminal through the CS Socket, and finally the second intelligent terminal analyzes the received JSON data and obtains and presents the notification information. The information fusion method for the Android system has the advantages of being convenient for users and applicable to the intelligent terminals of the Android system.
Description
Technical field
The present invention relates to intelligent terminal technology, particularly the technology of multiple intelligent terminal message intercommunication.
Background technology
Existing a lot of intelligent terminal is all Android system, comprise smart mobile phone, Intelligent flat computer, Intelligent set top box, intelligent television and Intelligent worn device etc., when we have the intelligent terminal of multiple Android system simultaneously, and when needing the state simultaneously paying close attention to each intelligent terminal, must switch in different hardware intelligent terminals, this is uninteresting and dull operator scheme, and Google is unpromising, and we provide message synchronization between Android device and shared mechanism.
The smart machine of existing Android system is for smart mobile phone, its system has carried Notification and has reminded for user message, generally be applied to phone, note, the notification message such as mail and ring of alarm clock, when there being these notification messages, the status bar of smart mobile phone just there will be a small icon, prompting user processes this notification message, at this moment user just can launch from sliding mode hurdle, top and process this message, but this is only work in single a kind of equipment of Android system, the smart machine of multiple Android system this Notification synchronous cannot be made, and respective handling is made to this Notification.
In Android 4.3, the feature of an outbalance with the addition of the support to Android wear, Google has carried out larger transformation to Android notification for this reason, the most important is, by notice monitoring service, Notification is exposed to third-party application, and certain third-party application needs to apply for corresponding authority.The callback method of an outbalance is had in notice monitoring service:
public void onNotificationPosted(StatusBarNotification sbn)
During this method readjustment, pass to the concrete data that we are about to the Notification shown, notify that we can obtain following data easily by status bar:
Summary of the invention
Can not the shortcoming of synchronous Notification between the intelligent terminal that the object of the invention is to solve existing multiple Android system, a kind of Android system message fusion method is provided.
The present invention solves its technical problem, and the technical scheme of employing is, Android system message fusion method, is characterized in that, comprise the following steps:
Himself announcement information monitored by step 1, intelligent terminal one;
Step 2, intelligent terminal one create CS Socket, wait to be connected, if there is connection, enter step 3, if without connection, do not carry out processing until after having connection access, enter step 3 after setting up Socket successful connection;
The just like announcement information listening to himself of step 3, intelligent terminal, then obtain data wherein and be encapsulated as JSON data;
Packaged JSON data are sent to connected intelligent terminal two by CS Socket by step 4, intelligent terminal one;
The JSON data received resolved by step 5, intelligent terminal two, are notified information and present.
Concrete, step 1 comprises the following steps:
Step 101, intelligent terminal one newly-built Similar integral notice monitoring service, and override onNotificationPosted method, intercept and capture announcement information in this method, in announcement information, comprise Notification data;
Step 102, in AndroidManifest, register this notice monitoring service, and the implicit expression intention of statement notice monitoring service.
Further, step 3 comprises the following steps:
The just like announcement information listening to himself of step 301, intelligent terminal, then intercepted data in onNotificationPosted () method, and conversion process is done to Bitmap, be encapsulated as complete JSON data.
Concrete, in step 301, described JSON data are JSON character string.
Further, in step 301, describedly conversion process is done to Bitmap refer to: first Bitmap is converted to byte array, then is converted to string format by Base64, obtain Bitmap character string, it can be used as an element in JSON data.
Concrete, step 5 comprises the following steps:
The JSON data received resolved by step 501, intelligent terminal two;
Bitmap character string in step 502, intelligent terminal two pairs of JSON data carries out inverse conversion, obtains Bitmap object;
Present or directly present after self-defined View required for step 503, intelligent terminal two.
Further, in step 502, described reverse is changed to: do Base64 reverse to Bitmap character string and be changed to byte array, then resolved to a Bitmap object.
The invention has the beneficial effects as follows, in the present invention program, by above-mentioned Android system message fusion method, the information information of other Android system intelligent terminals or each Android system intelligent terminal showing other Android system intelligent terminals can be shown on the intelligent terminal of an Android system, facilitate user.
Embodiment
Below in conjunction with embodiment, describe technical scheme of the present invention in detail.
In Android system message fusion method of the present invention, first the announcement information of himself monitored by intelligent terminal one, then intelligent terminal one creates CS Socket, etc. to be connected, if without connection, do not carry out processing until have connect access and after setting up Socket successful connection, the just like announcement information listening to himself of intelligent terminal, then obtain data wherein and be encapsulated as JSON data, packaged JSON data are sent to connected intelligent terminal two by CS Socket by intelligent terminal one, the JSON data received resolved by last intelligent terminal two, be notified information and present.
Embodiment
Owing to relating to the sharing and synchronization of information in the embodiment of the present invention, first the problem solving information data communication is needed, select in embodiments of the present invention to carry out data communication by CS Socket, the SocketPort of intelligent terminal service-creation acquiescence waits for client access, once communication creates successfully, intelligent terminal is once being communicated by Socket with intelligent terminal two, Socket communication is selected to have two main causes: 1, communication is stable, once Socket breaks, easy discovery, and do abnormality processing; 2, light flexibly, be simple and easy to use, multi-client access better process.
The data structure determining to communicate also is needed in data communication.Consider the View feature of Notification, a pictures, a title, a description is just enough to complete performance information content, so under data structure roughly confirms:
In the Android system message fusion method of the embodiment of the present invention, comprise following concrete steps:
Himself announcement information monitored by step 1, intelligent terminal one.
In this step, can comprise the following steps:
Step 101, intelligent terminal one newly-built Similar integral notice monitoring service, and override onNotificationPosted method, intercept and capture announcement information in this method, in announcement information, comprise Notification data;
Step 102, in AndroidManifest, register this notice monitoring service, and the implicit expression intention of statement notice monitoring service.
Step 2, intelligent terminal one create CS Socket, wait to be connected, if there is connection, enter step 3, if without connection, do not carry out processing until after having connection access, enter step 3 after setting up Socket successful connection.
The just like announcement information listening to himself of step 3, intelligent terminal, then obtain data wherein and be encapsulated as JSON data.
The concrete steps of this step are exemplified below:
The just like announcement information listening to himself of step 301, intelligent terminal, then intercepted data in onNotificationPosted () method, and conversion process is done to Bitmap, be encapsulated as complete JSON data.
Wherein, doing conversion process to Bitmap can be: first Bitmap is converted to byte array, then is converted to string format by Base64, obtain Bitmap character string, it can be used as an element in JSON data.JSON data are herein preferably JSON character string.
Packaged JSON data are sent to connected intelligent terminal two by CS Socket by step 4, intelligent terminal one.
The JSON data received resolved by step 5, intelligent terminal two, are notified information and present.
When step 3 adopts the concrete steps in citing, this step can adopt following steps:
The JSON data received resolved by step 501, intelligent terminal two;
Bitmap character string in step 502, intelligent terminal two pairs of JSON data carries out inverse conversion, obtains Bitmap object; Wherein, reverse is changed to: do Base64 reverse to Bitmap character string and be changed to byte array, then resolved to a Bitmap object;
Present or directly present after self-defined View required for step 503, intelligent terminal two.
Claims (7)
1. Android system message fusion method, is characterized in that, comprises the following steps:
Himself announcement information monitored by step 1, intelligent terminal one;
Step 2, intelligent terminal one create CS Socket, wait to be connected, if there is connection, enter step 3, if without connection, do not carry out processing until after having connection access, enter step 3 after setting up Socket successful connection;
The just like announcement information listening to himself of step 3, intelligent terminal, then obtain data wherein and be encapsulated as JSON data;
Packaged JSON data are sent to connected intelligent terminal two by CS Socket by step 4, intelligent terminal one;
The JSON data received resolved by step 5, intelligent terminal two, are notified information and present.
2. Android system message fusion method as claimed in claim 1, it is characterized in that, step 1 comprises the following steps:
Step 101, intelligent terminal one newly-built Similar integral notice monitoring service, and override onNotificationPosted method, intercept and capture announcement information in this method, in announcement information, comprise Notification data;
Step 102, in AndroidManifest, register this notice monitoring service, and the implicit expression intention of statement notice monitoring service.
3. Android system message fusion method as claimed in claim 2, it is characterized in that, step 3 comprises the following steps:
The just like announcement information listening to himself of step 301, intelligent terminal, then intercepted data in onNotificationPosted () method, and conversion process is done to Bitmap, be encapsulated as complete JSON data.
4. Android system message fusion method as claimed in claim 3, it is characterized in that, in step 301, described JSON data are JSON character string.
5. Android system message fusion method as claimed in claim 4, it is characterized in that, in step 301, describedly conversion process is done to Bitmap refer to: first Bitmap is converted to byte array, string format is converted to again by Base64, obtain Bitmap character string, it can be used as an element in JSON data.
6. Android system message fusion method as claimed in claim 5, it is characterized in that, step 5 comprises the following steps:
The JSON data received resolved by step 501, intelligent terminal two;
Bitmap character string in step 502, intelligent terminal two pairs of JSON data carries out inverse conversion, obtains Bitmap object;
Present or directly present after self-defined View required for step 503, intelligent terminal two.
7. Android system message fusion method as claimed in claim 6, it is characterized in that, in step 502, described reverse is changed to: do Base64 reverse to Bitmap character string and be changed to byte array, then resolved to a Bitmap object.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510125860.2A CN104796458A (en) | 2015-03-20 | 2015-03-20 | Information fusion method for Android system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510125860.2A CN104796458A (en) | 2015-03-20 | 2015-03-20 | Information fusion method for Android system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104796458A true CN104796458A (en) | 2015-07-22 |
Family
ID=53560966
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510125860.2A Pending CN104796458A (en) | 2015-03-20 | 2015-03-20 | Information fusion method for Android system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104796458A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110557752A (en) * | 2019-07-19 | 2019-12-10 | 珠海格力电器股份有限公司 | information protection method, information protection device, electronic equipment and computer readable medium |
CN114741213A (en) * | 2021-10-22 | 2022-07-12 | 华为技术有限公司 | Notification processing method, chip, electronic device and computer-readable storage medium |
CN114915607A (en) * | 2022-07-18 | 2022-08-16 | 荣耀终端有限公司 | Notification message processing method, electronic equipment and system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1775911A1 (en) * | 2005-10-13 | 2007-04-18 | Research In Motion Limited | System and method for providing asynchronous notifications using synchronous data |
CN103905561A (en) * | 2014-04-14 | 2014-07-02 | 北京君正集成电路股份有限公司 | Method and system for synchronizing data |
CN104301873A (en) * | 2014-09-05 | 2015-01-21 | 惠州Tcl移动通信有限公司 | Intelligent terminal, functional terminal and notification information synchronous push method |
-
2015
- 2015-03-20 CN CN201510125860.2A patent/CN104796458A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1775911A1 (en) * | 2005-10-13 | 2007-04-18 | Research In Motion Limited | System and method for providing asynchronous notifications using synchronous data |
CN103905561A (en) * | 2014-04-14 | 2014-07-02 | 北京君正集成电路股份有限公司 | Method and system for synchronizing data |
CN104301873A (en) * | 2014-09-05 | 2015-01-21 | 惠州Tcl移动通信有限公司 | Intelligent terminal, functional terminal and notification information synchronous push method |
Non-Patent Citations (1)
Title |
---|
刘素芳: "一种基于JSON的跨平台远程生产控制的处理策略", 《廊坊师范学院学报(自然科学版)》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110557752A (en) * | 2019-07-19 | 2019-12-10 | 珠海格力电器股份有限公司 | information protection method, information protection device, electronic equipment and computer readable medium |
CN110557752B (en) * | 2019-07-19 | 2021-01-22 | 珠海格力电器股份有限公司 | Information protection method, information protection device, electronic equipment and computer readable medium |
CN114741213A (en) * | 2021-10-22 | 2022-07-12 | 华为技术有限公司 | Notification processing method, chip, electronic device and computer-readable storage medium |
CN114741213B (en) * | 2021-10-22 | 2023-03-24 | 华为技术有限公司 | Notification processing method, chip, electronic device and computer-readable storage medium |
CN114915607A (en) * | 2022-07-18 | 2022-08-16 | 荣耀终端有限公司 | Notification message processing method, electronic equipment and system |
CN114915607B (en) * | 2022-07-18 | 2022-10-11 | 荣耀终端有限公司 | Notification message processing method, electronic equipment and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103117960A (en) | System and method of broadband user speeding up access bandwidth in self-service mode | |
CN105898893B (en) | Full-duplex communication method for mobile terminal and Internet of things equipment | |
US20190114183A1 (en) | Terminal Configuration Method and Terminal Based on Provision Protocol for Transmission | |
US20240276569A1 (en) | Method and apparatus for data exchange | |
CN103607423A (en) | Distributed broadcast system based on WebSocket protocol | |
CN111240858A (en) | Event scheduling method and component | |
CN104796458A (en) | Information fusion method for Android system | |
CN117041472A (en) | Method and equipment for transmitting video stream | |
CN102983889A (en) | Method of information cooperative processing between smart mobile phone and computer through Bluetooth wireless pairing | |
CN112416396A (en) | Application program updating method and system | |
CN104486330A (en) | Two-way communication system based on remote procedure calls (RPCs) | |
KR101952053B1 (en) | Scalable charging system based on service-oriented architecture(soa) | |
CN107317881B (en) | BA system based on micro-service architecture | |
CN109831404B (en) | Instant communication system and method compatible with multiple terminals | |
CN108989157B (en) | Method and device for controlling intelligent equipment | |
CN111767176B (en) | Method and device for remotely controlling terminal equipment | |
CN106657076B (en) | TCP service implementation method and device for network name space | |
CN104391576A (en) | Remote input method and device based on wireless Ethernet | |
US20150215414A1 (en) | Out of band electronic signaling | |
CN104797004A (en) | Method for implementation of automatic networking between master and slave devices | |
CN114584603B (en) | Method and device for connecting desktop client software with server and readable storage medium | |
CN105094902A (en) | System and method for controlling login state of application program | |
CN107548016B (en) | Management method, device and system of Bluetooth connection resources | |
US10148765B2 (en) | Security information interaction system, device and method | |
CN112383904A (en) | Pair-free quick peripheral calling method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20150722 |
|
RJ01 | Rejection of invention patent application after publication |