CN114610419B - Method and device for adding widget and computer readable storage medium - Google Patents

Method and device for adding widget and computer readable storage medium Download PDF

Info

Publication number
CN114610419B
CN114610419B CN202011419518.0A CN202011419518A CN114610419B CN 114610419 B CN114610419 B CN 114610419B CN 202011419518 A CN202011419518 A CN 202011419518A CN 114610419 B CN114610419 B CN 114610419B
Authority
CN
China
Prior art keywords
widget
terminal
target
interface
application
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.)
Active
Application number
CN202011419518.0A
Other languages
Chinese (zh)
Other versions
CN114610419A (en
Inventor
梁树为
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202011419518.0A priority Critical patent/CN114610419B/en
Priority to PCT/CN2021/119966 priority patent/WO2022121445A1/en
Publication of CN114610419A publication Critical patent/CN114610419A/en
Application granted granted Critical
Publication of CN114610419B publication Critical patent/CN114610419B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures

Abstract

The application discloses a method and a device for adding a widget and a computer readable storage medium, and belongs to the technical field of terminals. The method comprises the following steps: the first terminal determines a target widget to be added, wherein the target widget is associated with the installed target application; and if an instruction for adding the target widget to the second terminal is received, acquiring interface related data of the target widget, and sending a widget adding request to the second terminal, wherein the widget adding request carries the interface related data so as to request the second terminal to add the target widget in the second terminal based on the interface related data. The widget of the target application can be added to the second terminal through the first terminal, cross-device addition of the widget is achieved, the second terminal can also add the widget of the target application under the condition that the target application is not installed, storage resources and processing resources of the second terminal are saved, and the widget adding mode is expanded.

Description

Method and device for adding widget and computer readable storage medium
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a method and an apparatus for adding a widget, and a computer-readable storage medium.
Background
A widget (widget) is a widget, and can be added to a certain display interface of the terminal for use, for example, can be added to a desktop for use, so as to increase the functionality of the desktop. For example, the widget may be a clock, a memo, a weather report, or the like. In addition, a widget may also be associated with an application, and the widget associated with the application has a partial function of the application. For example, an application may provide one or more widgets. The user can realize partial functions of the application by directly interacting with the widget of the application, thereby facilitating the operation of the user.
In the related art, an application installed in a terminal provides an addition entry with an associated widget, that is, if a user wants to add a widget of an application to the terminal, the application needs to be installed in the terminal first, and then the widget of the application is added. However, the installation data of the application will occupy more storage resources of the terminal, and the running of the application will also consume more processing resources of the terminal, so for terminals such as a smart watch, if the application is installed first and then the widget of the application is added, the performance of the terminal will be affected.
Disclosure of Invention
The application provides a method and a device for adding a widget and a computer readable storage medium, which can solve the problem that the widget added by a terminal in the related art consumes storage resources and processing resources. The technical scheme is as follows:
in a first aspect, a method for adding a widget is provided, where the method includes: determining a target widget to be added, wherein the target widget is associated with the installed target application; and if an instruction for adding the target widget to the second terminal is received, acquiring interface related data of the target widget, and sending a widget adding request to the second terminal, wherein the widget adding request carries the interface related data of the target widget and is used for requesting the second terminal to add the target widget in the second terminal based on the interface related data.
In the embodiment of the application, the widget of the target application can be added to the second terminal through the first terminal, so that the cross-device addition of the widget is realized, the second terminal can also add the widget of the target application under the condition that the target application is not installed, the consumption of installing the target application on the storage resource and the processing resource of the second terminal is reduced, and the widget adding mode is expanded.
The target application may be any application installed on the first terminal, and the target application is associated with one or more widgets. The target widget may be any widget of the target application. The target widget has partial functions of the target application, and the display interface of the target widget comprises partial data and/or controls related to the target application. The control in the target widget can trigger certain functions of the target application.
For example, the target application may be a music application, a video application, a map application, or the like, and may also be other applications capable of providing widgets. The widget of the music application can be a music playing interface of the music application; the widget of the video application can be a video playing interface of the video application; the widget of the map application may be a navigation interface of the map application, and the like. It should be understood that the target widget may also be other display interfaces associated with the target application, which is not limited in this embodiment of the present application.
And the target widget interface related data is used for indicating the display interface of the target widget. The interface-related data for the target widget may include one or more of widget display data and widget control data.
The widget display data is used for indicating one or more of the layout of the target widget, the interface size of the target widget, and the type, position, icon and color of each control on the target widget. The layout of the target widget is used to indicate the structure of the target widget, for example, to indicate which data and control are included in the target widget. As an example, the widget display data includes one or more of a layout file of the target widget, a configuration file for configuring an interface size of the target widget, a configuration file for configuring a type and a position of each control on the target widget, an icon file and a color definition file of each control on the target widget.
The widget control data is used for indicating one or more of control objects and control events of each control on the target widget. The control event of the control comprises a response event that the control is triggered. As an example, the widget control data includes one or more of a configuration file for configuring a control object of each control on the target widget and a configuration file for configuring a control event of each control on the target widget. As an example, widget control data may be configured via a defined Remount View object. The Remount View object may contain one or more of control objects and control events for various controls on the target widget.
It should be noted that the target widget to be added may be set by default by the terminal, or may be selected by the user. For example, the first terminal may display one or more widget identifiers, the user may select one widget identifier from the one or more widget identifiers, and in response to the selection operation of the user, the first terminal may determine the widget identified by the widget identifier selected by the user as the widget to be added.
As an example, if a widget addition operation is detected, the first terminal may display a widget addition interface, where the widget addition interface includes one or more widget identifiers. And if the selection operation of any widget identifier in the widget adding interface is detected, determining the widget identified by the selected widget identifier as the widget to be added.
The widget adding operation can be a clicking operation, a sliding operation, a voice operation or a gesture operation. For example, the widget adding operation may be an operation of pressing a blank area of the main interface for a long time, or an operation of clicking a widget, and the like, which is not limited in this embodiment of the present application. Wherein, the window gadget is used for triggering the widget addition.
In a possible implementation manner, after determining the target widget to be added, the first terminal may further display terminal identifiers of one or more terminals. And if the selection operation of any one of the displayed one or more terminal identifications is detected, determining that an instruction for adding the target widget to the terminal identified by the selected terminal identification is received, wherein the terminal identified by the selected terminal identification is the second terminal.
Wherein, the one or more terminals are terminals which have established connection with the first terminal. For example, the one or more terminals are terminals that have established a short-range wireless communication connection with the first terminal, such as terminals that have established a short-range wireless communication connection with the first terminal through bluetooth or WIFI.
Optionally, the one or more terminals are terminals that have already established connection with the first terminal and support adding widget functions across devices. The terminal supporting the widget adding function across the devices is the terminal capable of adding the widget based on the widget adding request sent by other devices.
As an example, after determining a target widget to be added, a first terminal may first search for a terminal that has established connection with the first terminal, then determine a terminal that supports adding a widget function across devices from the searched terminals to obtain one or more terminals, and then display terminal identifiers of the one or more terminals.
As an example, before sending the widget addition request to the second terminal, the first terminal may perform packing processing on the interface-related data of the target widget, and then send the widget addition request to the second terminal, where the widget addition request carries the packed interface-related data.
In a possible implementation manner, after the first terminal sends the widget addition request to the second terminal, if the widget event of the target widget sent by the second terminal is received, the target application may also be triggered to execute a service corresponding to the widget event.
That is, the second terminal may control the target application in the first terminal based on the added target widget, so that cross-device control of the target application is achieved through the added widget, and flexibility of the widget is improved.
The widget event of the target widget may be triggered by a widget operation for the target widget added in the second terminal. The widget operation refers to an operation aiming at a target widget and is used for triggering a control event of the target widget. For example, the widget operation may be a triggering operation on any control in the target widget, such as a clicking operation or a sliding operation on any control in the target widget. Or, the widget operation may be a triggering operation on a physical key of the first terminal, a rotating operation on a knob of the first terminal, or the like in the process of displaying the target widget by the first terminal. Of course, the widget operation may also be other operations for the widget, such as a voice operation or a gesture operation, which is not limited in this embodiment of the present application.
In a possible implementation manner, after the target application executes the service corresponding to the control event, if it is determined that the target widget needs to perform interface refreshing based on the service executed by the target application, the first terminal may further obtain interface refreshing data of the target widget, and send a widget refreshing request to the second terminal, where the widget refreshing request carries the interface refreshing data to request the second terminal to refresh the display interface of the target widget based on the interface refreshing data. And the interface refreshing data is used for indicating the display interface refreshed by the target widget.
Therefore, the target widget in the second terminal can be refreshed through the first terminal, so that cross-device refreshing of the widget can be realized, and the flexibility of the widget is further improved.
In a second aspect, a device for adding a widget is provided, where the device for adding a widget has a function of implementing the behavior of the method for adding a widget in the first aspect. The apparatus for adding a widget includes at least one module, where the at least one module is configured to implement the method for adding a widget provided in the first aspect.
In a third aspect, an apparatus for adding a widget is provided, where the apparatus for adding a widget includes a processor and a memory, and the memory is configured to store a program that supports the apparatus for adding a widget to execute the method for adding a widget provided in the first aspect, and store data used to implement the method for adding a widget in the first aspect. The processor is configured to execute programs stored in the memory. The apparatus for adding a widget may further include a communication bus for establishing a connection between the processor and the memory.
In a fourth aspect, a computer-readable storage medium is provided, where instructions are stored, and when the instructions are executed on a computer, the instructions cause the computer to execute the method for adding a widget according to the first aspect.
In a fifth aspect, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform the method for adding a widget according to the first aspect.
The technical effects obtained by the second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and are not described herein again.
In a sixth aspect, a method for adding a widget is provided, where the method includes: receiving a widget adding request sent by a first terminal, wherein the widget adding request carries interface related data of a target widget, the interface related data is used for indicating a display interface of the target widget, and the target widget is associated with a target application installed on the first terminal; and adding the target widget in the second terminal based on the interface related data.
In the embodiment of the application, the widget of the target application can be added to the second terminal through the first terminal, so that the cross-device addition of the widget is realized, the second terminal can also add the widget of the target application under the condition that the target application is not installed, the consumption of installing the target application on the storage resource and the processing resource of the second terminal is reduced, and the widget adding mode is expanded.
The first terminal can add the target widget in the display interface of the second terminal based on the interface related data. After the target widget is added to the display interface of the second terminal, the display interface of the target widget may be displayed in the display interface of the second terminal. The display interface of the target widget may occupy all or a part of the area of the display interface of the second terminal, which is not limited in the embodiment of the present application.
The display interface for adding the target widget can be set by the second terminal in a default mode or can be selected by the user. For example, before adding the target widget to the second terminal based on the interface related data, the target display interface to which the target widget is to be added may be determined based on the interface selection operation of the user, and then the target widget is added to the target display interface based on the interface related data.
The interface selection operation may be a click operation, a slide operation, a voice operation, a gesture operation, or the like, which is not limited in the embodiment of the present application. For example, after the display interface is slid leftwards or rightwards, the interface selection operation may be a long-press operation on a blank area of the current display interface, or a click operation for adding an entry to a widget in the current display interface.
In a possible implementation manner, the operation of adding the target widget to the second terminal based on the interface related data includes: and based on the interface related data, creating a display interface of the target widget on the display interface of the second terminal so as to add the target widget in the second terminal.
As an example, the operation of creating the display interface of the target widget on the display interface of the second terminal based on the interface related data includes: creating a widget view object, and creating a display area of the widget view object on a display interface of the second terminal; creating an entity view corresponding to the interface related data; and adding the entity view into the display area of the widget view object to obtain a display interface of the target widget, thereby completing the display of the target widget on the second terminal.
The widget View object may be an APPWidgetHostView object, and the entity View may be an entity View. The second terminal can create an entity view corresponding to the interface related data according to the widget display data in the interface related data.
In a possible implementation manner, after the second terminal successfully adds the target widget to the second terminal based on the interface-related data, the second terminal may further send an addition success notification to the first terminal, where the addition success notification is used to indicate that the second device has successfully added the target widget.
After receiving the adding success notification, the first terminal may further store the device information of the second terminal that successfully adds the target widget. For example, the device information of the second terminal, to which the target widget is successfully added, is stored through the application widget service of the first terminal. For example, the device information of the second terminal, which successfully adds the target widget, may be stored in the widget database through the widget service applied by the first terminal.
After receiving the adding success notification, the first terminal may further store the device information of the second terminal that successfully adds the target widget. For example, the device information of the second terminal to which the target widget is successfully added is stored through the application widget service of the first terminal. For example, the device information of the second terminal, which successfully adds the target widget, may be stored in the widget database through the widget service applied by the first terminal.
In addition, after the target widget is added to the second terminal, the user may also control the target application in the first terminal by operating the target widget in the second terminal, that is, the cross-device operation of the target widget may be implemented.
In a possible implementation manner, after the target widget is added to the second terminal based on the interface related data, if the second terminal detects a widget operation for the target widget, the second terminal sends a control event of the target widget triggered by the widget operation to the first terminal.
The widget operation refers to an operation for the target widget, and is used for triggering a control event of the target widget. For example, the widget operation may be a triggering operation on any control in the target widget, such as a clicking operation or a sliding operation on any control in the target widget. Or, the widget operation may be a triggering operation on a physical key of the first terminal, a rotating operation on a knob of the first terminal, or the like in the process of displaying the target widget by the first terminal. Of course, the widget operation may also be other operations for the widget, such as a voice operation or a gesture operation, which is not limited in this embodiment of the present application.
As an example, if a widget operation for an added target widget is detected, sending, to the first terminal, a control event of the target widget triggered by the widget operation includes: if the triggering operation of the first control of the target widget is detected, determining a control event corresponding to the first control based on the interface related data; and sending the control event corresponding to the first control to the first terminal.
The triggering operation of the first control may be a clicking operation or a sliding operation on the first control, or may also be a voice operation or a gesture operation, which is not limited in the embodiment of the present application. The first control is any control of the target widget.
As an example, if a specified operation is detected based on the added target widget, the second terminal may trigger a broadcast-like message and then send the message to the first terminal. And the message carries a control event of the target widget triggered by the specified operation.
In a possible implementation manner, after the widget event of the target widget triggered by the specified operation is sent to the first terminal, if a widget refresh request sent by the first terminal is received, the second terminal may also refresh the display interface of the target widget based on interface refresh data of the target widget carried by the widget refresh request.
The widget refreshing request carries interface refreshing data of the target widget, and the interface refreshing data is used for indicating a display interface refreshed by the target widget. The interface refresh data can include one or more of widget display data and widget control data.
That is, the second terminal may control the target application in the first terminal based on the added target widget, so that cross-device control of the target application is achieved through the added widget, and flexibility of the widget is improved. After the second terminal controls the target application in the first terminal, the first terminal can refresh the target widget added in the first terminal according to the control of the second terminal, so that cross-device refreshing of the widget can be realized, and flexibility of the widget is further improved.
In a seventh aspect, an apparatus for adding a widget is provided, where the apparatus for adding a widget has a function of implementing the behavior of the method for adding a widget in the sixth aspect. The device for adding the widget comprises at least one module, and the at least one module is used for implementing the method for adding the widget provided by the sixth aspect.
An eighth aspect provides a device for adding a widget, where the structure of the device for adding a widget includes a processor and a memory, where the memory is used to store a program for supporting the device for adding a widget to execute the method for adding a widget provided in the sixth aspect, and to store data used to implement the method for adding a widget in the sixth aspect. The processor is configured to execute programs stored in the memory. The apparatus for adding a widget may further include a communication bus for establishing a connection between the processor and the memory.
In a ninth aspect, a computer-readable storage medium is provided, which stores instructions that, when executed on a computer, cause the computer to perform the method for adding a widget according to the above sixth aspect.
In a tenth aspect, there is provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of adding a widget according to the sixth aspect.
The technical effects obtained by the seventh aspect, the eighth aspect, the ninth aspect, and the tenth aspect are similar to the technical effects obtained by the corresponding technical means in the sixth aspect, and are not described herein again.
In an eleventh aspect, a system for adding a widget is provided, including: a first terminal and a second terminal, wherein the first terminal is used in the method for adding a widget according to the first aspect; the second terminal is configured to execute the method for adding a widget according to the second aspect.
Drawings
Fig. 1 is a schematic diagram of a system for adding a widget according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a terminal according to an embodiment of the present application;
fig. 3 is a block diagram of a software structure of a terminal according to an embodiment of the present disclosure;
fig. 4 is a system architecture diagram of a system for adding a widget according to an embodiment of the present application;
FIG. 5 is a graphical user interface for adding widgets across devices according to an embodiment of the present application;
FIG. 6 is another graphical user interface for adding widgets across devices according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a graphical user interface of a music application and a widget of the music application according to an embodiment of the present application;
fig. 8 is a schematic diagram of a graphical user interface of a video application and a widget of the video application according to an embodiment of the present application;
FIG. 9 is a graphical user interface diagram of a map application and a widget of the map application provided in an embodiment of the present application;
fig. 10 is a flowchart of a method for adding a widget according to an embodiment of the present application;
fig. 11 is a flowchart illustrating a widget adding process according to an embodiment of the present application;
fig. 12 is a flowchart illustrating a widget refresh process according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of an apparatus for adding a widget according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of another apparatus for adding a widget according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the embodiments herein, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality" means two or more than two.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
The method provided by the embodiment of the application is applied to a system for adding the widget. Referring to fig. 1, fig. 1 is a schematic diagram of a system for adding a widget according to an embodiment of the present application. As shown in fig. 1, the system includes a first terminal 10 and a second terminal 20, and the first terminal 10 and the second terminal 20 may be connected through a wired network or a wired network.
The first terminal 10 is installed with a target application, and the target application has one or more widgets for the user to add. The target application may be any application capable of providing a widget, such as a music application, a video application, or a navigation application, which is not limited in this embodiment of the present application. The second terminal 20 is a terminal that needs to add a target widget, and the target widget is a widget of a target application.
In this embodiment of the application, when a user wants to add a widget of a target application to the second terminal 20, the widget of the target application may be added to the second terminal 20 through the first terminal 10, so that the widget of the target application may also be successfully added to the second terminal 20 without installing the target application. Therefore, the storage resource and the processing resource of the second terminal 20 can be saved, the widget which can be added by the second terminal 20 only by installing the target application in advance is avoided, the adding mode of the widget is expanded, the flexibility is improved, and the diversified requirements of users can be met.
That is, the embodiment of the application can realize that a widget is added to another device through one device. For convenience of explanation, adding a widget to another device through one device in the embodiments of the present application is referred to as adding a widget across devices.
The first terminal 10 and the second terminal 20 may be a mobile phone, a tablet computer, a wearable device, an in-vehicle device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), and other terminals, and the wearable device may be a smart watch or a smart bracelet, and the embodiments of the present application do not limit the types of the first terminal 10 and the second terminal 20. Fig. 1 is only an example in which the first terminal 10 is a mobile phone and the second terminal 20 is a smart watch, and the first terminal 10 and the second terminal 20 may be of other types.
As an example, the first terminal 10 is a terminal with higher hardware performance, such as a mobile phone, a tablet computer, a notebook computer or a computer. The second terminal 10 is a terminal with low hardware performance, such as an AR/VR device, a vehicle-mounted device or a wearable device. Therefore, the target application can be installed in the terminal with higher hardware performance, and then the widget of the target application is added to the terminal with lower hardware performance in a cross-device mode through the terminal with higher hardware performance.
For example, the first terminal 10 is a mobile phone, the second terminal 20 is a smart watch, and a widget of a target application is added to the smart watch through the mobile phone. Because the hardware performance of the smart watch is not as high as that of the mobile phone, if the target application is installed, the installation data of the target application occupies more storage resources of the smart watch, and the operation of the target application consumes more processing resources of the smart watch, so that the performance of the smart watch is affected, and therefore in order to save the storage resources and the processing resources of the smart watch, the widget of the target application can be added to the smart watch through the mobile phone.
It should be noted that the target widget has a part of the functions of the target application. That is, the target widget is a shortcut of the target application, and includes a part of the display interface and a part of the control function of the target application. The target widget may be added to a certain display interface of the second terminal 20. After the target widget is added to a certain display interface of the second terminal 20, the display interface of the target widget occupies all or a part of the area of the display interface of the second terminal 20. The display interface of the target widget comprises related data and/or controls of the target application. The control in the target widget is used for triggering certain functions of the target application.
After the target widget is added to the second terminal 20, the user may also control the target application in the first terminal 10 by operating the target widget in the second terminal 20. For example, the user may trigger the target application in the first terminal 10 to execute a corresponding function by clicking a control of the target widget in the second terminal 20, so as to implement remote control on the target application.
Next, the structure of the terminal will be described. Referring to fig. 2, fig. 2 is a schematic structural diagram of a terminal 100 according to an embodiment of the present disclosure. The terminal 100 may be the first terminal 10 or the second terminal 20 of fig. 1 described above. The main operating system resources used by the first terminal 10 to provide services may include a processor, a memory, a network service, and the like. The second terminal 10 has a display screen and is capable of receiving various types of input events including, but not limited to, screen touch, button click, knob rotation, and other operation events.
As shown in fig. 2, the terminal 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the terminal 100. In other embodiments of the present application, terminal 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processor (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), among others. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be, among other things, a neural center and a command center of the terminal 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
The I2C interface is a bidirectional synchronous serial bus including a serial data line (SDA) and a Serial Clock Line (SCL). In some embodiments, the processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through an I2C bus interface to implement a touch function of the terminal 100.
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 through an I2S bus, enabling communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, so as to implement a function of answering a call through a bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled by a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit the audio signal to the wireless communication module 160 through a UART interface, so as to implement the function of playing music through a bluetooth headset.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the capture functionality of terminal 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the terminal 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, and the like.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB type c interface, or the like. The USB interface 130 may be used to connect a charger to charge the terminal 100, and may also be used to transmit data between the terminal 100 and peripheral devices. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other terminals, such as AR devices, etc.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only illustrative, and is not limited to the structure of the terminal 100. In other embodiments of the present application, the terminal 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the terminal 100. The charging management module 140 may also supply power to the terminal through the power management module 141 while charging the battery 142.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the terminal 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in terminal 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication and the like applied to the terminal 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication applied to the terminal 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (BT), global Navigation Satellite System (GNSS), frequency Modulation (FM), near Field Communication (NFC), infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, the antenna 1 of the terminal 100 is coupled to the mobile communication module 150 and the antenna 2 is coupled to the wireless communication module 160 so that the terminal 100 can communicate with a network and other devices through a wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The terminal 100 implements a display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may be a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-o led, a quantum dot light-emitting diode (QLED), or the like. In some embodiments, the terminal 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The terminal 100 may implement a photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.
The ISP is used to process the data fed back by the camera 193. For example, when a user takes a picture, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, an optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and converting into an image visible to the naked eye. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, terminal 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
In some possible cases, the camera 193 may be used as a gesture capture module to capture gesture operations of the user. The camera 193 may include a front camera and/or a rear camera.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the terminal 100 selects a frequency bin, the digital signal processor is configured to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The terminal 100 may support one or more video codecs. In this way, the terminal 100 can play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor, which processes input information quickly by referring to a biological neural network structure, for example, by referring to a transfer mode between neurons of a human brain, and can also learn by itself continuously. The NPU can implement applications such as intelligent recognition of the terminal 100, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the terminal 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in the external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the terminal 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (e.g., audio data, a phonebook, etc.) created during use of the terminal 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
The terminal 100 may implement an audio function through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playing, recording, etc. The keys 190 of the terminal 100 may include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc. The SIM card interface 195 is used to connect a SIM card.
In addition, the terminal 100 may include various sensors, such as a pressure sensor 180A for sensing a pressure signal, which may be converted into an electrical signal. The gyro sensor 180B may be used to determine a motion attitude of the terminal 100. The air pressure sensor 180C is used to measure air pressure. The magnetic sensor 180D includes a hall sensor. The acceleration sensor 180E may detect the magnitude of acceleration of the terminal 100 in various directions (generally, three axes). A distance sensor 180F for measuring a distance. The terminal 100 may measure the distance by infrared or laser. In some embodiments, the scene is photographed and the terminal 100 may range using the distance sensor 180F to achieve fast focus. The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The ambient light sensor 180L is used to sense the ambient light level. The terminal 100 may adaptively adjust the brightness of the display 194 according to the perceived ambient light level. The fingerprint sensor 180H is used to collect a fingerprint. The terminal 100 can utilize the collected fingerprint characteristics to realize fingerprint unlocking, access to an application lock, fingerprint photographing, fingerprint incoming call answering, and the like. The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation acting thereon or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. The bone conduction sensor 180M may acquire a vibration signal. And a temperature sensor 180J for detecting temperature. For example, the temperature sensor 180J may be a non-contact infrared temperature sensor that can measure the temperature of an object using infrared rays.
The software system of the terminal 100 may adopt a hierarchical architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention uses an Android system with a hierarchical architecture as an example to exemplarily explain a software structure of the terminal 100.
Fig. 3 is a block diagram of a software structure of a terminal 100 according to an embodiment of the present disclosure. The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom.
The application layer may include a series of application packages. As shown in fig. 3, the application package may include video, camera, gallery, calendar, talk, map, navigation, WLAN, bluetooth, music, short message, etc. applications.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer may also be referred to as the system services framework layer. The application framework layer includes a number of predefined functions. As shown in FIG. 3, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide a communication function of the terminal 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to notify download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, text information is prompted in the status bar, a prompt tone is given, the terminal vibrates, an indicator light flashes, and the like.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), two-dimensional graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The two-dimensional graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver. For example, the sensor driver is used for calling an infrared temperature sensor, and the camera driver can start the camera to collect images.
Next, a system architecture of the widget adding system is described with reference to fig. 3. Referring to fig. 4, fig. 4 is a system architecture diagram of a system for adding a widget according to an embodiment of the present application.
As shown in fig. 4, the first terminal 10 includes an application framework layer, also called a system service framework layer, and an application framework layer. The application layer of the first terminal 10 comprises a target application 11 and an application widget management 12. The application framework layer of the first terminal 10 includes an application widget service 13 and a cross device service 14. The second terminal 20 also includes an application layer and an application framework layer. The application layer of the second terminal 20 comprises a desktop launcher 21. The application framework layer of the second device 20 includes a cross-device service 22.
The target application 11 may be any application responsible for implementing application service functions. For example, the target application 11 is responsible for executing various widget services of the target application 11.
As an example, the target application 11 has various types of widget service request interfaces, and the target application 11 may execute various types of widget services by calling the various types of widget service request interfaces. For example, if the target application 11 receives a widget event of the target widget, a widget service request interface corresponding to the widget event may be called, and a service corresponding to the widget event may be executed through the widget service request interface corresponding to the widget event.
The application widget management 12 is responsible for widget-related service management of the application end. For example, the system is responsible for monitoring various control events of the target widget and notifying the control events to the target application 11. Or, the method is responsible for triggering the refreshing process of the target widget when the display interface of the target widget needs to be refreshed. Or responsible for business interaction with the target application 11, etc. Application widget management 12 may also be referred to as an application widget provider (APP widget provider). Illustratively, the application widget management 12 is integrated in the target application 11.
As an example, the application widget management 12 includes an event broadcast receiver, an interface refresh interface, and an interface for interacting with application services, etc. The event broadcast receiver is used for monitoring various control events of the target widget. The application widget management 12 may notify the target application 11 of the widget's control event, which is listened to through the event broadcast receiver. The interface refreshing interface is used for triggering an interface refreshing flow. For example, the interface refreshing interface is used to invoke the application widget service 13, and the interface refreshing data of the target widget is obtained through the application widget service 13, where the interface refreshing data is used to indicate the display interface after the target widget is refreshed. The application service interaction interface is used for performing service interaction with the target application 11.
The application widget service (APP widget service) 13 is responsible for related service management on the widget on the system side. For example, when the target widget needs to be added to the second terminal 20, interface related data of the target widget is obtained, where the interface related data is used to indicate a display interface of the target widget. Or when the display interface of the target widget needs to be refreshed, acquiring interface refreshing data of the target widget. Or, the system is responsible for recording related data of the widget and the like.
As one example, application widget service 13 includes a widget addition interface and a widget refresh interface. The widget adding interface is used for acquiring interface related data of the target widget. The widget refreshing interface is used for acquiring interface refreshing data of the target widget. Optionally, the application widget service 13 further has a widget data recording management function, where the widget data recording management function is used to record related data of the widget, such as recording widget addition data or widget refresh data.
For example, if the first terminal 10 determines that the display interface of the target widget needs to be refreshed, the interface refresh interface of the application widget management 12 may be called, and a refresh message is sent to the application widget service 13 through the called interface refresh interface. After receiving the refresh message, the application widget service 13 calls a widget refresh interface of the application widget service 13, and obtains interface refresh data of the target widget through the called widget refresh interface.
The cross-device service 14 is responsible for cross-device information data transfer. For example, it is responsible for sending a widget addition request or a widget refresh request to the second terminal 20. Or, the widget event of the target application sent by the second terminal 20 is received. In addition, the cross-device service 14 may also perform a packing process on interface related data or interface refreshing data of the target widget, or query the device establishing connection with the first terminal 10 or the widget adding device, so as to query device information of the device establishing connection with the first terminal 10 or the widget adding device, or whether the device supports a cross-device add widget function, and the like. The device information includes a device type, a software version or a system version of the device, and the like. The support of adding the widget function across the devices means that the widget can be added based on widget adding requests sent by other devices. The widget adding device is a device for adding widgets across devices.
As one example, the cross device service 14 includes a widget addition interface, a widget refresh interface, and a widget control event transmission interface. The widget addition interface is configured to send a widget addition request to the second terminal 20, where the widget addition request carries interface-related data of the target widget. Optionally, the widget addition interface is further configured to perform a package processing on the interface related data of the target widget, so as to send a widget addition request carrying the packaged interface related data to the second terminal 20. The widget refresh interface is configured to send a widget refresh request to the second terminal 20, where the widget refresh request carries interface refresh data of the target widget. Optionally, the widget refresh interface is further configured to perform a packaging process on the interface refresh data of the target widget, so as to send a widget refresh request carrying the packaged interface refresh data to the second terminal 20. The widget control event transmission interface is used for transmitting the control event of the target widget. For example, the control event of the target widget sent by the second terminal 20 is received, or the control event of the target widget is sent to the application widget management 12.
Optionally, the cross-device service 14 further includes a widget addition device query interface, where the widget addition device query interface is configured to query the device for establishing connection or the widget addition device, so as to query device information of the device for establishing connection or the widget addition device.
The desktop launcher 21 is responsible for the display frame of the widget and the processing and transmission of the widget control event. By way of example, the Launcher 21 may be a Launcher (Launcher) like the android system.
For example, the desktop launcher 21 may create a display interface of the target widget on the display interface of the second terminal 20 based on the interface related data of the target widget sent by the first terminal 10. Or, based on the interface refreshing data of the target widget sent by the first terminal 10, the display interface of the target widget is refreshed. Or, if the specified operation on the target widget is detected, sending the control event of the target widget to the cross-device service 22. Illustratively, the desktop launcher 21 includes a widget interface refreshing interface, and the widget interface refreshing interface is used for refreshing a display interface of the widget.
The cross device service 22 is responsible for cross device information data transfer. For example, it is responsible for receiving a widget addition request or a widget refresh request sent by the first terminal 10. Or, the widget control event is responsible for sending the widget of the target application to the first terminal 10.
As one example, the cross device service 22 includes a widget reception interface, a widget interface refresh interface, and a widget control event transmission interface. The widget receiving interface is configured to receive a widget addition request, and send the widget addition request to the desktop launcher 21, so as to instruct the desktop launcher 21 to create a display interface of the target widget. The widget interface refreshing interface is configured to receive a widget refreshing request, and send the widget refreshing request to the desktop launcher 21, so as to instruct the desktop launcher 21 to refresh the display interface of the target widget. The widget control event transmission interface is used for transmitting the control event of the target widget. For example, the control event of the target widget is sent to the first terminal 10.
In the embodiment of the application, in order to facilitate the user to add the widget to the second terminal through the first terminal, the first terminal may further provide an operation interface for the user to add the widget to the other device, so that the user can conveniently add the widget to the other device through the operation interface. The operation interface may include one or more widget identifications, and the user may select a widget identification of a target widget to be added from the one or more widget identifications. The widget identifier is used to uniquely identify the widget, and may be a name, an Identity Document (ID), an icon, or the like of the widget, which is not limited in this embodiment of the present application. In addition, the operation interface may further include device identifiers of one or more devices, and the user may select, from the device identifiers of the one or more devices, a device identifier of the second terminal that wants to add the target widget, so as to add the target widget to the second terminal. The device identifier is used for uniquely identifying a corresponding device, and may be a model, a name, an ID, or the like of the device. The operation interface may be triggered by a user through widget addition operation, where the widget addition operation may be an operation of pressing a blank area of a display interface such as a main interface for a long time, or an operation of adding a widget option in a click setting menu, and the like, and this is not limited in this embodiment of the application.
For convenience of understanding, in the following embodiments of the present application, a process of adding a widget to a second terminal through a first terminal is described by taking the first terminal as a mobile phone and the second terminal as a smart watch as an example, with reference to the accompanying drawings and an application scenario. At present, most of intelligent watches have touch display screens, and equipment is small in size and can be worn for a long time, so that widgets are added to the intelligent watches, and information can be quickly checked or a quick operation function can be realized through the added widgets.
Fig. 5 is a schematic diagram of a Graphical User Interface (GUI) for adding a widget across devices according to an embodiment of the present application. Fig. 5 (a) shows currently output interface content 501 of the mobile phone in the unlock mode, where the interface content 501 displays multiple applications (apps), such as music, camera, settings, and video applications. It should be understood that the interface content 501 may also include other more application programs, which is not limited in this embodiment of the present application. When a user wants to add a widget to other equipment through the mobile phone, the mobile phone can be triggered to display a widget adding interface through widget adding operation, so that the user can select the widget to be added through the widget adding interface.
As shown in fig. 5 (a), when the user presses a blank area in the interface content 501 for a long time, the mobile phone displays a desktop setting interface in response to the long-press operation of the user. Fig. 5 (b) illustrates a desktop settings interface 502, where the desktop settings interface 502 includes settings options for wallpaper, widgets, toggle effects, and desktop settings. Wherein the widget is used for adding the widget. As shown in fig. 5 (b), the user may click on the widget option, and in response to the click operation of the user, the mobile phone displays the widget addition interface. The widget adding interface may include one or more widget identifications, and the user may select a target widget to be added based on the one or more widget identifications.
Fig. 5 (c) illustrates a widget addition interface 503, where the widget addition interface 503 includes icons of a plurality of widgets, such as the icons of widget1, widget2, and widget 3. It should be understood that the widget addition interface 503 may also include other widget icons, which is not limited in this embodiment of the present application. The user can select the icon of the widget to be added from the displayed icons of the widgets. As shown in (c) of fig. 5, the user clicks the icon of widget2, in response to the click operation of the user, the mobile phone displays a device selection interface, the device selection interface displays device identifiers of devices that can be added, and the user can select the device identifier of the device to which widget2 is to be added from the displayed device identifiers, so as to add widget2 to the device identified by the selected device identifier. The device capable of being added is a device which is connected with the mobile phone, or a device which is connected with the mobile phone and supports the cross-device widget function addition.
Fig. 5 (d) illustrates a device selection interface 504, where the device selection interface 504 includes options add to local, add to device 1, add to device 2, and add to device 3. It should be understood that the device selection interface 504 may also include other more addable devices, which is not limited in this application. As shown in fig. 5 (d), the user clicks the add-to-device 1, and in response to the click operation of the user, the mobile phone sends a widget add confirmation message to the device 1, where the widget add confirmation message may carry device information of the mobile phone. After receiving the widget addition confirmation message, the device 1 may display widget addition inquiry information, where the widget addition inquiry information is used to prompt a user whether to approve adding a widget in the mobile phone.
Fig. 6 is a schematic diagram of another graphical user interface for adding a widget across devices according to an embodiment of the present application. Assuming that the device 1 is a smart watch, after receiving a widget addition confirmation message sent by the mobile phone, the smart watch may display a widget addition inquiry interface 601 as shown in (a) of fig. 6. widget addition inquiry interface 601 displays widget addition inquiry information: whether the mobile phone widget is allowed to be added, and an option is allowed and an option is cancelled. And if the user agrees to add the widget of the mobile phone, clicking the agreement option, responding to the clicking operation of the user, and sending an addition confirmation message to the mobile phone by the smart watch, wherein the addition confirmation message is used for indicating the widget agreeing to add the mobile phone.
After receiving the addition confirmation message sent by the smart watch, the mobile phone can send a widget addition request to the smart watch, wherein the widget addition request carries interface related data of widget2. In addition, in the process of sending the widget addition request, the mobile phone can also display data transmission information, and the data transmission information is used for indicating that the mobile phone is transmitting interface related data of the widget2. Fig. 6 (b) illustrates a data transmission interface 602 of a smart watch, where the data transmission interface 602 displays data transmission information: in widget data transmission.
In addition, the smart watch can also display data receiving information in the process of receiving widget data transmitted by the mobile phone, and the data receiving information is used for indicating that the smart watch is receiving interface related data of the widget2. Fig. 6 (c) illustrates a data receiving interface 603 of a smart watch, where the data receiving interface 603 displays data receiving information: and receiving widget data. After the smart watch receives the data, widget2 can be added to a certain display interface of the smart watch according to the received interface related data of the widget2. The display interface for adding the widget2 may be a designated interface, or may be selected by the user.
As an example, the user may select the display interface that wants to add widget2 by sliding the display interface left or right. Fig. 6 (d) illustrates a display interface 604 of a smart watch, and as shown in fig. 6 (d), a user may slide the display interface in the direction shown in fig. 6 (d), and in response to a sliding operation by the user, the smart watch may display other display interfaces. In addition, a widget adding inlet can be displayed on the display interface selected by the user, and the user can trigger the smart watch to add widget2 on the current display interface by triggering the widget adding inlet. For example, the widget add entry may be a plus sign as shown in (d) of fig. 6. If the user wants to add widget2 to the current display interface, the user may click the plus sign shown in (d) in fig. 6, and in response to the click operation of the user, the smart watch adds widget2 to the current display interface based on the received interface-related data of widget2. Fig. 6 (e) illustrates a display interface 605 after widget2 is added, and the display interface 605 displays a display interface with widget2.
After the widget2 is added to the smart watch, the user can also control the target application in the mobile phone by operating the widget2 in the smart watch, wherein the target application refers to the application associated with the widget2. For example, widget2 in the smart watch may be operated to trigger a widget event of the widget2, the smart watch sends the triggered widget event of the widget2 to the mobile phone, and the target application in the mobile phone executes a corresponding service based on the received widget event and returns service data to the smart watch.
In the embodiment of the application, the target widget added to the second terminal by the first terminal is a widget associated with the target application installed on the first terminal, that is, the target widget may be any widget of the target application installed on the first terminal. The target widget has partial functions of the target application.
Illustratively, the target application may be a music application, a video application, or a map application, among others. The widget of the music application can be a music playing interface of the music application, and is used for realizing information viewing, playing control and the like of the music application. The widget of the video application can be a video playing interface of the video application, and is used for realizing information viewing, playing control and the like of the video application. The widget of the map application may be a navigation interface of the map application, and is used for implementing a display guidance function for a navigation route, and the like. It should be understood that the target widget may also be other display interfaces associated with the target application, and may have other related functions of the target application, which is not limited in this embodiment of the application.
Next, taking the target widget added with the target application in the smart watch through the mobile phone as an example, the target widget added in the smart watch is exemplified.
Referring to fig. 7, fig. 7 is a schematic diagram of a music application and a graphical user interface of a widget of the music application according to an embodiment of the present application. Fig. 7 (a) illustrates a music playing interface 701 of a music application output by a mobile phone when the music application is opened. The music playing interface 701 displays buttons such as a song title, album cover of songs, lyrics, playing of a player, previous/next, collection, list playing order, and setup menu. It should be understood that the music playing interface 701 may further include other more data and function buttons, which are not limited in this embodiment of the application. Fig. 7 (b) illustrates a display interface 702 after a widget of a music application is added to a smart watch, and as shown in fig. 7 (b), the display interface of the widget of the music application is a short music playing interface, and includes buttons such as a song name, album covers of a song, playing of a player, previous/next, favorite, playing order of a list, setting a menu, and the like, for implementing information viewing and playing control of the music application. For example, the user may directly perform switching of the previous or next song, adjustment of the song playing progress, switching of song collection and playing state, and the like based on a widget of a music application added to the smart watch. It should be understood that the display interface of the widget of the music application may also be other interface contents, which is not limited in this embodiment of the application.
Referring to fig. 8, fig. 8 is a schematic diagram of a graphical user interface of a video application and a widget of the video application according to an embodiment of the present application. Fig. 8 (a) illustrates a video playing interface 801 of a video application output by a mobile phone when the video application is opened. The video playing interface 801 displays buttons such as video name, video frame, playing of the player, volume adjustment, zooming, downloading, and collection. It should be understood that the video playing interface 801 may further include other more data and function buttons, which are not limited in the embodiment of the present application. Fig. 8 (b) illustrates a display interface 802 after a widget of a video application is added to a smart watch, and as shown in fig. 8 (b), the display interface of the widget of the video application is a brief video playing interface, and includes buttons of a video screen and a player for implementing information viewing and playing control of the video application. The user can directly carry out video switching, video playing progress adjustment, volume adjustment, brightness adjustment, playing state switching and the like based on the widget of the music application added to the smart watch. It should be understood that the display interface of the widget of the video application may also be other interface contents, which is not limited in this embodiment of the application. For example, a user can control the playing progress, volume or brightness and the like of a video application by rotating a knob of the smart watch, so that the control accuracy is improved.
Referring to fig. 9, fig. 9 is a schematic diagram of a map application and a graphical user interface of a widget of the map application according to an embodiment of the present application. Fig. 9 (a) illustrates a navigation interface 901 of a map application output by a mobile phone when the map application is opened. The navigation interface 901 displays buttons for navigation direction, road information, exit, and setup. It should be understood that the navigation interface 901 may further include other more data and function buttons, which are not limited in this embodiment of the present application. Fig. 9 (b) illustrates a display interface 902 after a widget of a map application is added to a smart watch, and as shown in fig. 9 (b), the display interface of the widget of the map application is a brief navigation interface, and includes important navigation information such as a navigation direction and a road where the widget is located, so as to implement a display guidance function of a navigation route. The display interface of the widget of the map application may be refreshed according to a specified policy, such as periodically refreshing, so as to display the latest navigation interface to the user. It should be understood that the display interface of the widget of the map application may also be other interface contents, which is not limited in this embodiment of the application.
Next, a method for adding a widget according to an embodiment of the present application will be described in detail with reference to the accompanying drawings.
Fig. 10 is a flowchart of a method for adding a widget according to an embodiment of the present application, where interaction subjects of the method are a first terminal and a second terminal. Referring to fig. 10, the method includes:
step 1001: the first terminal determines a target widget to be added, wherein the target widget is a widget associated with the installed target application.
The target application may be any application installed by the first terminal, and the target application is associated with one or more widgets. The target widget may be any widget of the target application. The target widget has partial functions of the target application, and the display interface of the target widget comprises partial data and/or controls related to the target application. The control in the target widget can trigger certain functions of the target application.
For example, the target application may be a music application, a video application, a map application, or the like, and may also be other applications capable of providing a widget. The widget of the music application can be a music playing interface of the music application; the widget of the video application can be a video playing interface of the video application; the widget of the map application may be a navigation interface of the map application, and the like. It should be understood that the target widget may also be other display interfaces associated with the target application, which is not limited in this embodiment of the present application.
It should be noted that the target widget to be added may be set by the first terminal by default, or may be selected by the user. For example, the first terminal may display one or more widget identifiers, the user may select one widget identifier from the one or more widget identifiers, and in response to a selection operation of the user, the first terminal may determine the widget identified by the widget identifier selected by the user as the widget to be added.
Moreover, the widget identifier is used to uniquely identify a corresponding widget, and may be a name, an Identity Document (ID), an icon, or the like of the widget, which is not limited in this embodiment of the present application.
As an example, if a widget addition operation is detected, the first terminal may display a widget addition interface, where the widget addition interface includes one or more widget identifiers. And if the selection operation of any widget identifier in the widget adding interface is detected, determining the widget identified by the selected widget identifier as the widget to be added. For example, the widget addition interface may be the widget addition interface 503 shown in (c) of fig. 5.
It should be noted that the widget adding operation may be a click operation, a slide operation, a voice operation, a gesture operation, or the like. For example, the widget adding operation may be an operation of pressing a blank area of the main interface for a long time, or an operation of clicking a widget, and the like, which is not limited in this embodiment of the present application. Wherein, the window gadget is used for triggering the widget addition.
Step 1002: and if the first terminal receives an instruction for adding the target widget to the second terminal, acquiring interface related data of the target widget, wherein the interface related data is used for indicating a display interface of the target widget.
It should be noted that the interface-related data of the target widget may include one or more of widget display data and widget control data.
The widget display data is used for indicating one or more of the layout of the target widget, the interface size of the target widget, and the type, position, icon and color of each control on the target widget. The layout of the target widget is used to indicate the structure of the target widget, for example, to indicate which data and control are included in the target widget. As an example, the widget display data includes one or more of a layout file of the target widget, a configuration file for configuring an interface size of the target widget, a configuration file for configuring a type and a position of each control on the target widget, an icon file and a color definition file of each control on the target widget.
The widget control data is used for indicating one or more of control objects and control events of each control on the target widget. The control event of the control comprises a response event triggered by the control, such as a click response event and the like. As an example, the widget control data includes one or more of a configuration file for configuring a control object of each control on the target widget and a configuration file for configuring a control event of each control on the target widget. As an example, widget control data may be configured via a defined Remount View object. The Remount View object may contain one or more of control objects and control events of various controls on the target widget.
Moreover, the instruction for adding the target widget to the second terminal may be triggered through a device selection operation, where the device selection operation may be a click operation, a slide operation, a voice operation, a gesture operation, or the like.
As an example, the first terminal may display terminal identifications of one or more terminals after determining the target widget to be added. And if the selection operation of any one of the displayed one or more terminal identifications is detected, determining that an instruction for adding the target widget to the terminal identified by the selected terminal identification is received, wherein the terminal identified by the selected terminal identification is a second terminal.
It should be noted that one or more terminals are terminals that have established a connection with the first terminal. For example, the one or more terminals are terminals that have established a short-range wireless communication connection with the first terminal, such as terminals that have established a short-range wireless communication connection with the first terminal through bluetooth or WIFI.
Optionally, the one or more terminals are terminals that have established a connection with the first terminal and support adding a widget function across devices. The terminal supporting the widget adding function across the devices is a terminal capable of adding the widget based on a widget adding request sent by other devices.
As an example, after determining a target widget to be added, a first terminal may first search for a terminal that has established connection with the first terminal, then determine a terminal that supports adding a widget function across devices from the searched terminals to obtain one or more terminals, and then display terminal identifiers of the one or more terminals.
The operation of determining the terminal supporting the widget function added across the devices from the searched terminals may include the following implementation manners:
the first implementation mode comprises the following steps: and for any searched terminal, acquiring the equipment information of the terminal, and determining whether the terminal supports the cross-equipment widget adding function or not according to the equipment information of the terminal.
It should be noted that the device information of the terminal includes one or more of the type of the terminal, the software version of the terminal, or the system version. For example, whether the terminal supports adding the widget function across the devices may be determined according to the device information of the terminal and the correspondence between the stored device information and the support information whether the terminal supports adding the widget function across the devices.
The second implementation mode comprises the following steps: and for any searched terminal, acquiring the equipment mark of the terminal, and determining whether the terminal supports the cross-equipment widget adding function or not according to the equipment mark of the terminal. The device mark of the terminal is used for indicating whether the terminal supports adding the widget function across devices.
It should be noted that the device identifier of the terminal may be sent by the terminal. For example, after establishing a connection with the first terminal, the terminal may determine, according to the device information of the terminal, whether the terminal supports the cross-device add widget function, generate a device tag of the terminal based on whether the terminal supports the cross-device add widget function, and then send the device tag of the terminal to the first terminal through the established connection. After receiving the device tag of the terminal, the first terminal may store the device tag of the terminal, so as to determine whether the terminal supports adding a widget function across devices based on the stored device tag.
As an example, as shown in fig. 4, the first terminal may query whether the connected terminal supports the cross-device add widget function by the cross-device service 14. For example, it may be queried through the widget add device query interface of the cross-device service 14 whether the connected device supports the cross-device add widget function.
As an example, after the first terminal receives the instruction to add the target widget to the second terminal, the first terminal may further store the addition data of the target widget. As shown in fig. 4, the first terminal may store the addition data of the target widget through the application widget service 13, for example, create an addition data record of the target widget through the application widget service 13.
The adding data of the target widget may include one or more of the following data: the widget identifier, the adding event, the adding time, and the like of the target widget may also include other adding data of the target widget, which is not limited in the embodiment of the present application.
Step 1003: the first terminal sends a widget adding request to the second terminal, the widget adding request carries the interface related data, and the widget adding request is used for requesting the second terminal to add the target widget based on the interface related data.
As an example, before the first terminal sends the widget addition request to the second terminal, the first terminal may first perform packaging processing on the interface-related data of the target widget, and then send the widget addition request to the second terminal, where the widget addition request carries the packaged interface-related data.
As an example, as shown in fig. 4, the first terminal may send a widget addition request to the second terminal through the cross device addition service 14. For example, the interface related data of the target widget is packaged by the widget addition interface of the cross-device addition service 14, and a widget addition request carrying the packaged interface related data is sent to the second terminal.
In another embodiment, if an instruction for adding the target widget to the second terminal is received, a widget addition confirmation message may also be sent to the second terminal first. And after receiving the widget addition confirmation message, the second terminal can display widget addition inquiry information, wherein the widget addition inquiry information is used for prompting whether the user agrees to add the target widget from the first terminal. And if the second terminal detects the confirmation adding operation of the user based on the displayed widget adding inquiry information, sending a confirmation adding message to the first terminal, wherein the confirmation adding message is used for indicating that the target widget is allowed to be added from the first terminal. And after receiving the addition confirmation message, the first terminal acquires the interface related data of the target widget and sends the interface related data of the target widget to the second terminal.
Step 1004: and the second terminal receives the widget adding request sent by the first terminal, and adds the target widget in the second terminal based on the interface related data.
The first terminal can add the target widget in the display interface of the second terminal based on the interface related data. After the target widget is added to the display interface of the second terminal, the display interface of the target widget may be displayed in the display interface of the second terminal. The display interface of the target widget may occupy all or a part of the area of the display interface of the second terminal, which is not limited in the embodiment of the present application.
Taking the second terminal as an example of a smart watch, the display interface after adding the widget of the music application to the smart watch may be as shown in (b) of fig. 7. The display interface after adding the widget of the video application to the smart watch may be as shown in (b) of fig. 8. The display interface after adding the widget of the map application to the smart watch may be as shown in (b) of fig. 9.
The display interface for adding the target widget can be set by the second terminal in a default mode or can be selected by the user. For example, before adding the target widget to the second terminal based on the interface related data, the target display interface to which the target widget is to be added may be determined based on the interface selection operation of the user, and then the target widget is added to the target display interface based on the interface related data.
The interface selection operation may be a click operation, a slide operation, a voice operation, a gesture operation, or the like, which is not limited in the embodiment of the present application. For example, after the display interface is slid leftwards or rightwards, the interface selection operation may be a long-press operation on a blank area of the current display interface, or a click operation for adding an entry to a widget in the current display interface.
As an example, based on the interface related data, the operation of adding the target widget in the second terminal includes: and based on the interface related data, creating a display interface of the target widget on the display interface of the second terminal so as to add the target widget in the second terminal.
As an example, the operation of creating the display interface of the target widget on the display interface of the second terminal based on the interface related data includes: creating a widget view object, and creating a display area of the widget view object on a display interface of the second terminal; creating an entity view corresponding to the interface related data; and adding the entity view into the display area of the widget view object to obtain a display interface of the target widget, thereby completing the display of the target widget on the second terminal.
The Widget View object may be an APP Widget Host View object, and the entity View may be an entity View. The second terminal can create an entity view corresponding to the interface related data according to the widget display data in the interface related data.
As an example, as shown in fig. 4, the second terminal may receive, through the cross-device service 22, a widget addition request sent by the first terminal, and then add, through the desktop launcher 21, the target widget in the second terminal based on the interface related data of the target widget. After receiving the widget addition request sent by the first terminal, the cross device service 22 may send the widget addition request to the desktop launcher 21, and the desktop launcher 21 may add the target widget in the second terminal through the widget display frame.
In a possible implementation manner, after the second terminal successfully adds the target widget to the second terminal based on the interface-related data, the second terminal may further send an addition success notification to the first terminal, where the addition success notification is used to indicate that the second device has successfully added the target widget.
After receiving the adding success notification, the first terminal may further store the device information of the second terminal that successfully adds the target widget. For example, the device information of the second terminal, to which the target widget is successfully added, is stored through the application widget service of the first terminal. For example, the device information of the second terminal, which successfully adds the target widget, may be stored in the widget database through the widget service applied by the first terminal.
In addition, after the target widget is added to the second terminal, the user may also control the target application in the first terminal by operating the target widget in the second terminal, that is, the cross-device operation of the target widget may be implemented. The cross device operational flow of the target widget may include the following steps 1005-1009.
Step 1005: and if the second terminal detects the widget operation aiming at the added target widget, sending a control event of the target widget triggered by the widget operation to the first terminal.
The widget operation refers to an operation for the target widget, and is used for triggering a control event of the target widget. For example, the widget operation may be a triggering operation on any control in the target widget, such as a clicking operation or a sliding operation on any control in the target widget. Or, the widget operation may also be a triggering operation on a physical key of the first terminal, a rotating operation on a knob of the first terminal, or the like, in the process of displaying the target widget by the first terminal. Certainly, the widget operation may also be other operations aiming at the target widget, such as a voice operation or a gesture operation, which is not limited in this embodiment of the present application.
As an example, if a widget operation for an added target widget is detected, sending, to the first terminal, a control event of the target widget triggered by the widget operation includes: if the triggering operation of the first control of the target widget is detected, determining a control event corresponding to the first control based on the interface related data; and sending the control event corresponding to the first control to the first terminal.
The triggering operation of the first control may be a clicking operation or a sliding operation on the first control, or may also be a voice operation or a gesture operation, which is not limited in the embodiment of the present application. The first control is any control of the target widget.
As an example, if a specified operation is detected based on the added target widget, the second terminal may trigger a broadcast-like message and then send the message to the first terminal. And the message carries a control event of the target widget triggered by the specified operation.
As an example, as shown in fig. 4, the second terminal may detect a widget operation for the added target widget through the desktop launcher 21, and if the widget operation for the added target widget is detected, send, through the widget control event sending interface of the desktop launcher 21, a control event of the target widget triggered by the widget operation to the cross-device service 22, and send, through the cross-device service 22, the control event to the first terminal.
Step 1006: and the first terminal receives a control event of the target widget sent by the second terminal and triggers the target application to execute a service corresponding to the control event.
If the control event is a click event for switching to the next song button in the widget of the music application, the music application can be triggered to execute a service for switching to the next song.
As an example, the first terminal may receive, through the cross-device service in the application framework layer, a control event of the target widget sent by the second terminal. In addition, the first terminal can manage and monitor the control event of the target widget through the application widget in the application program layer, and if the control event of the target widget is monitored, the target application is triggered to execute the service corresponding to the control event.
As an example, referring to fig. 4, the first terminal may receive, through the cross-device service 14, a control event of the target widget sent by the second terminal. In addition, the first terminal may monitor the widget event of the target widget through the event broadcast receiver of the application widget management 12, and if the widget event of the target widget is monitored, trigger the target application 11 to execute the service corresponding to the widget event.
Step 1007: after the target application executes the service corresponding to the control event, if the interface refreshing of the target widget is determined to be required based on the service executed by the target application, the first terminal acquires interface refreshing data of the target widget, wherein the interface refreshing data is used for indicating a display interface refreshed by the target widget.
The interface refreshing data of the target widget may include one or more of widget display data and widget control data of the target widget.
As an example, the first terminal may obtain interface refresh data of the target widget through an application widget service in the application framework layer. As shown in fig. 4, the first terminal may obtain interface refresh data of the target widget by applying a widget refresh interface of the widget service 13.
Step 1008: the first terminal sends a widget refreshing request to the second terminal, the widget refreshing request carries the interface refreshing data, and the widget refreshing request is used for requesting the second terminal to refresh the display interface of the target widget based on the interface refreshing data.
As an example, before sending the widget refresh request to the second terminal, the first terminal may first perform packing processing on the interface refresh data of the target widget, and then send the widget refresh request to the second terminal, where the widget refresh request carries the packed interface refresh data.
As an example, a first terminal may send a widget refresh request to a second terminal through a cross-device service of an application framework layer. As shown in fig. 4, the first terminal may perform a packing process on the interface refresh data of the target widget through the refresh interface of the cross device service 14, and send a widget refresh request carrying the packed interface refresh data to the second terminal.
Step 1009: and the second terminal receives the widget refreshing request sent by the first terminal and refreshes the display interface of the target widget based on the interface refreshing data.
As an example, as shown in fig. 4, the second terminal may receive, through the cross-device service 22, a widget refresh request sent by the first terminal, and then refresh, through the desktop launcher 21, the display interface of the target widget based on the interface refresh data of the target widget. After receiving the widget refresh request sent by the first terminal, the cross-device service 22 may send the widget addition refresh to the desktop launcher 21, and the desktop launcher 21 may refresh the target widget through the widget display frame.
For convenience of understanding, the cross-device operation flow of the widget of the music application is described below with reference to fig. 7, taking the target widget as the widget of the music application as an example. As shown in fig. 7, a widget of a music application is added to the smart watch through the mobile phone, and the widget of the music application added to the smart watch is a music playing interface shown in fig. 7 (b). The user can directly control the music application in the mobile phone to realize the functions of switching the previous or next song, adjusting the song playing progress, switching song collection and playing state and the like by performing widget operation on the widget of the music application added to the smart watch. The widget operation may include a trigger operation on a widget of a music application added to the smart watch, or an operation on a physical button or knob of the smart watch.
As an example, the cross-device operation flow of a widget of a music application includes:
1) And clicking a next button in a widget of the music application added to the smart watch by the user.
2) And responding to the click operation of the user, and sending a control event triggered by the click operation to the mobile phone by the smart watch.
3) After receiving the control event, the mobile phone triggers a music application in the mobile phone to execute a service of switching to the next song, and sends interface refreshing data after switching to the next song to the smart watch.
4) And after receiving the interface refreshing data, the smart watch refreshes the widget of the music application based on the interface refreshing data so as to refresh the display interface of the widget of the music application into the display interface switched to the next song.
Next, taking the target widget as the widget of the video application as an example, the cross-device operation flow of the widget of the video application is described with reference to fig. 8. As shown in fig. 8, a widget of a video application is added to the smart watch through the mobile phone, and the widget of the video application added to the smart watch is a video playing interface shown in (b) in fig. 8. The user can directly control the video application in the mobile phone to realize the functions of video switching, video playing progress adjustment, volume adjustment, brightness adjustment, playing state switching and the like by performing widget operation on the widget of the video application added to the smart watch. The widget operation may include a trigger operation on a widget of a video application added to the smart watch, or an operation on a physical button or knob of the smart watch.
As an example, a cross-device operational flow of a widget of a video application includes:
1) The user sets up in the intelligent wrist-watch and controls the video broadcast progress through rotatory knob.
2) The user rotates a knob of the smart watch, and the smart watch sends a control event triggered by rotation operation to the mobile phone in response to the rotation operation of the user. For example, the control event may be a control event that drives the play progress bar to change by 0.5, which is triggered by 1 ° rotation of the knob.
3) After the mobile phone receives the control event, triggering a video application in the mobile phone to adjust the playing progress, completing the change of the playing progress bar, and sending interface refreshing data after the playing progress is adjusted to the smart watch.
4) And after receiving the interface refreshing data, the smart watch refreshes the widget of the video application based on the interface refreshing data so as to refresh the display interface of the widget of the video application into the display interface with the adjusted playing progress.
Next, taking the target widget as the widget of the map application as an example, a cross-device operation flow of the widget of the map application is described with reference to fig. 9. As shown in fig. 9, a widget of a map application is added to the smart watch through the mobile phone, and the widget of the map application added to the smart watch is a navigation interface shown in (b) in fig. 9. The user can quickly check the navigation information through the widget applied to the map added to the smart watch. In addition, the widget of the map application may also be refreshed according to a specified policy, such as periodically refreshing, so as to display the latest navigation interface to the user.
As one example, a cross-device operational flow of a widget of a map application includes:
1) After the map application in the mobile phone starts navigation, interface refreshing data of the widget of the map application is periodically sent to the smart watch, namely the refreshed navigation data is periodically sent to the smart watch.
For example, the map application in the mobile phone refreshes every 1 second, and sends interface refresh data of the widget of the map application to the smart watch.
2) And after receiving the interface refreshing data, the smart watch refreshes the widget of the map application based on the interface refreshing data so as to refresh the display interface of the widget of the map application to the latest navigation interface, thereby finishing the refreshing of the navigation interface.
In the related art, the widget of the third-party application, such as the music application, the video application, the map application, and the like, can only be added to the mobile phone, and occupies the display space of the desktop of the mobile phone. If the user wants to realize the related functions of the widget of the third-party application, the user needs to take out the mobile phone first, unlock the mobile phone and find the widget of the third-party application by sliding the desktop for multiple times, so that the related functions of the widget can be operated. In addition, at present, widgets installed on the smart watch are usually widgets fixed and customized for the smart watch, the functions and display data of the installed widgets are single, and for other widgets which can be added to a large number of third-party applications on the mobile phone, the smart watch does not support adding and is flexible and low. In the embodiment of the application, the widget of the target application can be added into the smart watch through the mobile phone in a mode of adding the widget across equipment, so that the widget of the third-party application can be added into the smart watch at will, the widget adding mode is expanded, and the functionality of the smart watch is enhanced.
In addition, the widget of the target application is added into the smart watch, so that the user can check and operate the added widget by lifting the smart watch, and the operation of the user is facilitated. For example, in a scene of driving a vehicle, if a map application of a mobile phone is used to view navigation information, the mobile phone needs to be fixed on a support of the vehicle for viewing; under the scene of riding, if the map application that uses the cell-phone looks over navigation information, because the cell phone stand is rarely installed on the bicycle, also need ride simultaneously and hold the cell-phone and look over, the mode that looks over through the cell-phone above-mentioned comes very inconvenient to the user, and has the potential safety hazard. According to the method for adding the widget in the cross-device mode, the widget of the map application can be added into the smart watch through the mobile phone, so that a user can lift the smart watch on the wrist, navigation information can be quickly checked through the widget of the map application added into the smart watch, operation of the user is facilitated, and potential safety hazards are reduced to a certain extent.
In the embodiment of the application, the widget of the target application can be added to the second terminal through the first terminal, cross-device addition of the widget is achieved, the widget of the target application can be added to the second terminal under the condition that the target application is not installed, consumption of storage resources and processing resources of the second terminal due to installation of the target application is reduced, and the widget adding mode is expanded. In addition, after the widget added by the second terminal, the application data of the target application in the first terminal can be quickly checked through the widget added by the second terminal, so that the target application or the widget of the target application is prevented from occupying the interface display space of the first terminal. In addition, the widget added by the second terminal can also control the target application of the first terminal, for example, trigger related functions of the target application in the first terminal, thereby facilitating the operation of a user and expanding the use mode of the widget.
Next, a widget adding process according to an embodiment of the present application will be described in detail with reference to fig. 4. Fig. 11 is a schematic flowchart of a widget adding process provided in an embodiment of the present application, and referring to fig. 11, the widget adding process includes:
step 1101: and opening a widget adding interface of the first terminal by the user, and selecting a target widget for adding the target application based on the widget adding interface.
Step 1102: the first terminal searches for the connected devices supporting the cross-device add widget function through the cross-device service 14.
For example, a widget adding device query interface of the cross-device service 14 may be called, and a device that is connected and supports the cross-device adding widget function is searched through the widget adding device query interface.
Step 1103: and the first terminal displays the equipment identification of the searched equipment.
For example, the device model of the searched device is displayed.
Step 1104: and the user selects a second terminal to which the target widget is to be added from the searched equipment based on the displayed equipment identifier.
Step 1105: and the first terminal calls a widget adding interface of the application widget service 13 based on the selection operation of the user to trigger the widget adding process.
Step 1106: the first terminal creates an added data record of the target widget through the application widget service 13, so that data and a control event of the target widget can be sent to the corresponding widget later when the widget operation is performed on the target widget.
The added data record of the target widget may include one or more of the following data: widget identification, event addition, time addition, and the like of the target widget.
Step 1107: the first terminal judges whether the triggered widget adding process is a cross-device widget adding process or not through the widget service 13, and if the triggered widget adding process is the cross-device widget adding process, interface related data of the target widget are acquired.
In addition, the first terminal can also display a local adding option for adding the target widget to the first terminal, and the user can also select the local adding option to add the target widget to the second terminal.
If the selection operation of the user on the local addition option is detected, the triggered widget addition process is the process of locally adding the widget, and in this case, the first terminal may add the target widget to the first terminal by applying the widget service 13. If the user is detected to select any one of the searched device identifiers of the device identifiers, the triggered widget adding process is a cross-device widget adding process, and in this case, the widget service 13 may be applied to obtain interface related data of the target widget, so as to send the interface related data of the target widget to the second terminal.
Step 1108: the first terminal sends a widget adding request to the second terminal through the cross-device service 14, wherein the widget adding request carries interface related data of the target widget to request the second terminal to add the target widget.
Step 1109: the second terminal receives the widget addition request sent by the first terminal through the cross-device service 22.
Step 1110: and the second terminal adds the target widget in the second terminal through the desktop launcher 21 based on the interface related data of the target widget carried by the widget adding request.
After receiving the widget addition request sent by the first terminal, the second terminal may send the widget addition request to the desktop launcher 21 through the cross device service 22. The desktop launcher 21 may add the target widget in the second terminal based on the interface-related data of the target widget carried by the widget addition request.
Step 1111: after the target widget is successfully added, the second terminal sends an addition success notification to the first terminal through the cross-device service 22, where the addition success notification is used to indicate that the target widget has been successfully added by the second terminal.
Step 1112: after receiving the notification of successful addition, the first terminal may store the device information of the second terminal that successfully adds the target widget by using the widget service 13.
For example, by applying the widget service 13, the device information of the second terminal to which the target widget is successfully added is stored in the widget database.
It should be noted that fig. 11 is only an exemplary illustration of a widget adding process provided in an embodiment of the present application, and does not limit the widget adding process. It should be understood that the process of the widget addition process may also be other processes, which is not limited in this embodiment of the present application.
Next, a widget refresh process according to an embodiment of the present application will be described in detail with reference to fig. 4. Fig. 12 is a schematic flowchart of a widget refresh process according to an embodiment of the present application, and referring to fig. 12, the widget refresh process includes:
step 1201: and clicking the control in the target widget added by the second terminal by the user so as to trigger the related function.
Step 1202: and the second terminal detects whether the first terminal where the target application corresponding to the target widget is located is connected with the second terminal or not based on the clicking operation of the user.
And if the first terminal is not connected with the second terminal, not responding. If the first terminal and the second terminal are connected, the following step 1203 is performed.
Step 1203: and the second terminal sends the control event of the target widget triggered by the click operation of the user to the target application 11 of the first terminal through the cross-device service 14 and the application widget service 13 of the first terminal.
Step 1204: the target application 11 of the first terminal may monitor a control event of the target widget, and if the control event of the target widget is monitored, execute a service corresponding to the control event.
The target application 11 may monitor the control event of the target widget through the application widget management 12, and if the application widget management 12 monitors the control event of the target widget, the target application 11 is triggered to execute the service corresponding to the control event.
Step 1205: after the target application 11 executes the service corresponding to the control event, if it is determined that the display interface of the target widget needs to be refreshed, the widget service management 12 sends a refresh message to the application widget service 13.
Step 1206: and the application widget service 13 acquires interface refreshing data of the target widget based on the refreshing message.
After executing the service corresponding to the control event, if it is determined that the display interface of the target widget needs to be refreshed, the target application 11 may obtain interface refresh data of the target widget through the application widget service 13.
If the target widget is a widget added across devices, the interface refreshing data of the target widget may be sent to the application widget service 13 of the target application 11. In addition, if the target widget is a widget locally added by the first terminal, the interface refreshing data of the target widget may also be sent to the local target widget, so that the local target widget can also refresh the display interface.
Step 1207: the first terminal sends the interface refreshing data of the target widget to the second terminal through the cross-device service 14.
After the first terminal obtains the interface refresh data of the target widget through the application widget service 13, it may first determine whether the second terminal added with the target widget is connected to the first terminal. If not, no response is made. And if the connection is established, sending the interface refreshing data of the target widget to the second terminal through the cross-device service 14.
Step 1208: and the second terminal refreshes the display interface of the target widget based on the received interface refreshing data of the target widget.
For example, the second terminal may refresh the display interface of the target widget through the widget display frame of the desktop launcher 21.
It should be noted that fig. 12 is only an exemplary illustration of a widget refresh process provided by an embodiment of the present application, and does not limit the widget refresh process. It should be understood that the flow of the widget refresh process may also be other flows, which is not limited in this embodiment of the application.
Fig. 13 is a schematic structural diagram of an apparatus for adding a widget according to an embodiment of the present application, where the apparatus may be implemented as part or all of a computer device, which may be the first terminal 10 shown in fig. 1, by software, hardware, or a combination of the two. Referring to fig. 13, the apparatus includes: a first determining module 1301, a first obtaining module 1302 and a first sending module 1303.
A first determining module, configured to perform step 1001 in the embodiment of fig. 10;
a first obtaining module, configured to perform step 1002 in the embodiment of fig. 10 described above;
a first sending module, configured to execute step 1003 in the embodiment in fig. 10.
Optionally, the apparatus further comprises:
the display module is used for displaying terminal identifiers of one or more terminals, and the one or more terminals are connected with the first terminal;
and a second determining module, configured to determine that an instruction for adding the target widget to a terminal identified by the selected terminal identifier is received if a selection operation on any terminal identifier of the displayed one or more terminal identifiers is detected, where the terminal identified by the selected terminal identifier is the second terminal.
Optionally, the apparatus further comprises:
a search module for searching for a terminal that has established a connection with the first terminal;
and a third determining module, configured to determine, from the searched terminals, a terminal that supports adding a widget function across devices, to obtain the one or more terminals, where the terminal that supports adding the widget function across devices is a terminal that can add a widget based on a widget addition request sent by another device.
Optionally, the interface related data includes widget display data and widget control data;
the widget display data is used for indicating one or more of the layout of the target widget, the interface size of the target widget, and the type, position, icon and color of each control on the target widget; the widget control data is used for indicating one or more of control objects and control events of each control on the target widget.
Optionally, the apparatus further comprises:
a trigger module, configured to perform step 1006 in the embodiment of fig. 10.
Optionally, the apparatus further comprises:
a second obtaining module, configured to perform step 1007 in the foregoing fig. 10 embodiment;
a second sending module, configured to execute step 1008 in the foregoing embodiment in fig. 10.
In the embodiment of the application, the widget of the target application can be added to the second terminal through the first terminal, so that the cross-device addition of the widget is realized, the widget of the target application can be added to the second terminal under the condition that the target application is not installed, the consumption of installing the target application on the storage resource and the processing resource of the second terminal is reduced, and the widget adding mode is expanded. In addition, after the widget added by the second terminal, the application data of the target application in the first terminal can be quickly checked through the widget added by the second terminal, so that the target application or the widget of the target application is prevented from occupying the interface display space of the first terminal. In addition, the widget added by the second terminal can also control the target application of the first terminal, for example, trigger related functions of the target application in the first terminal, thereby facilitating the operation of a user and expanding the use mode of the widget.
Fig. 14 is a schematic structural diagram of another apparatus for adding a widget according to an embodiment of the present application, where the apparatus may be implemented as part or all of a computer device, which may be the second terminal 20 shown in fig. 1, by software, hardware, or a combination of the two. Referring to fig. 14, the apparatus includes: a receiving module 1401 and an adding module 1402.
A receiving module 1401 and an adding module 1402, configured to execute step 1004 in the embodiment of fig. 10.
Optionally, the adding module 1402 is configured to:
and creating a display interface of the target widget on the display interface of the second terminal based on the interface related data.
Optionally, the adding module 1402 is configured to:
creating a widget view object, and creating a display area of the widget view object on a display interface of the second terminal;
creating an entity view corresponding to the interface related data;
and adding the entity view into the display area to obtain a display interface of the target widget.
Optionally, the interface related data includes widget display data and widget control data;
the widget display data is used for indicating one or more of the layout of the target widget, the interface size of the target widget, and the type, position, icon and color of each control on the target widget; and the widget control data is used for indicating one or more of control objects and control events of all controls on the target widget.
Optionally, the apparatus further comprises:
a sending module, configured to execute step 1005 in the foregoing embodiment in fig. 10.
Optionally, the sending module is configured to:
if the triggering operation of a first control of the target widget is detected, determining a control event corresponding to the first control based on the interface related data, wherein the first control is any control of the target widget;
and sending the control event corresponding to the first control to the first terminal.
Optionally, the apparatus further comprises:
a refresh module, configured to perform step 1009 in the embodiment of fig. 10.
In the embodiment of the application, the widget of the target application can be added to the second terminal through the first terminal, cross-device addition of the widget is achieved, the widget of the target application can be added to the second terminal under the condition that the target application is not installed, consumption of storage resources and processing resources of the second terminal due to installation of the target application is reduced, and the widget adding mode is expanded. In addition, after the widget added by the second terminal, the application data of the target application in the first terminal can be quickly checked through the widget added by the second terminal, so that the target application or the widget of the target application is prevented from occupying the interface display space of the first terminal. In addition, the widget added by the second terminal can also control the target application of the first terminal, for example, the related function of the target application in the first terminal is triggered, so that the operation of a user is facilitated, and the use mode of the widget is expanded.
It should be noted that: in the device for adding a widget according to the foregoing embodiment, when adding a widget, only the division of each functional module is illustrated, and in practical application, the foregoing function distribution may be completed by different functional modules as needed, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus for adding a widget and the method for adding a widget provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., digital Versatile Disk (DVD)), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
The above-mentioned embodiments are provided not to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (11)

1. A method for adding widget is characterized in that the method is applied to a first terminal, an operating system of the first terminal comprises a target application, an application widget service and a first cross-device service, the application widget service is responsible for related service management of the widget, the first cross-device service is responsible for cross-device information data transmission, and the method comprises the following steps:
determining a target widget to be added, wherein the target widget is a widget associated with the installed target application;
searching terminals which are connected with the first terminal through the first cross-device service, and determining terminals which support cross-device adding of the widget function from the searched terminals to obtain one or more terminals, wherein the terminals which support cross-device adding of the widget function refer to terminals which can add widgets based on widget adding requests sent by other devices;
under the condition that a second terminal does not install the target application, if an instruction for adding the target widget to the second terminal is received, acquiring interface related data of the target widget through the application widget service, wherein the interface related data is used for indicating a display interface of the target widget and comprises widget display data and widget control data, the widget display data is used for indicating one or more of the layout of the target widget, the interface size of the target widget and the type, position, icon and color of each control on the target widget, the widget control data is used for indicating one or more of a control object and a control event of each control on the target widget, and the second terminal is any one of the one or more terminals;
sending a widget adding request to the second terminal through the first cross-device service, wherein the widget adding request carries the interface related data, and the widget adding request is used for requesting the second terminal to add the target widget based on the interface related data.
2. The method of claim 1, wherein before obtaining the interface-related data of the target widget by the application widget service, further comprising:
displaying terminal identifications of one or more terminals, the one or more terminals having established a connection with the first terminal;
and if the selection operation of any one of the displayed one or more terminal identifications is detected, determining that an instruction for adding the target widget to the terminal identified by the selected terminal identification is received, wherein the terminal identified by the selected terminal identification is the second terminal.
3. The method of claim 1 or 2, wherein after sending the widget addition request to the second terminal, further comprising:
receiving a control event of the target widget sent by the second terminal;
and triggering the target application to execute the service corresponding to the control event.
4. The method of claim 3, wherein the method further comprises:
after the target application executes the service corresponding to the control event, if the target widget needs to be subjected to interface refreshing based on the service executed by the target application, acquiring interface refreshing data of the target widget, wherein the interface refreshing data is used for indicating a display interface refreshed by the target widget;
and sending a widget refreshing request to the second terminal, wherein the widget refreshing request carries the interface refreshing data, and the widget refreshing request is used for requesting the second terminal to refresh the display interface of the target widget based on the interface refreshing data.
5. A method for adding a widget is applied to a second terminal, an operating system of the second terminal comprises a desktop starter and a second cross-device service, the desktop starter is responsible for processing and transmitting a display frame of the widget and a control event of the widget, the second cross-device service is responsible for cross-device information data transmission, and the method comprises the following steps:
under the condition that a target application is not installed, receiving a widget adding request sent by a first terminal through the second cross-device service, wherein the widget adding request carries interface related data of the target widget, the interface related data is used for indicating a display interface of the target widget, the interface related data comprises widget display data and widget control data, the widget display data is used for indicating one or more of layout of the target widget, interface size of the target widget, and type, position, icon and color of each control on the target widget, the widget control data is used for indicating one or more of control object and control event of each control on the target widget, the target widget is a widget associated with the target application, and the target application is installed on the first terminal;
based on the interface related data, creating a display interface of the target widget on a display interface of the second terminal through the desktop starter;
creating a display interface of the target widget on the display interface of the second terminal through the desktop launcher based on the interface related data, including:
creating a widget view object through the desktop launcher, and creating a display area of the widget view object on a display interface of the second terminal;
creating an entity view corresponding to the interface related data through the desktop launcher;
and adding the entity view into the display area through the desktop starter to obtain a display interface of the target widget.
6. The method of claim 5, wherein after creating the display interface of the target widget on the display interface of the second terminal through the desktop launcher based on the interface-related data, the method further comprises:
and if the widget operation aiming at the target widget is detected, sending a control event of the target widget triggered by the widget operation to the first terminal.
7. The method of claim 6, wherein the sending, to the first terminal, the widget event of the target widget triggered by the widget operation if the widget operation directed to the target widget is detected comprises:
if the triggering operation of a first control of the target widget is detected, determining a control event corresponding to the first control based on the interface related data, wherein the first control is any control of the target widget;
and sending the control event corresponding to the first control to the first terminal.
8. The method of claim 6 or 7, wherein after sending the widget operation-triggered control event of the target widget to the first terminal, the method further comprises:
receiving a widget refreshing request sent by the first terminal, wherein the widget refreshing request carries interface refreshing data of the target widget, and the interface refreshing data is used for indicating a display interface refreshed by the target widget;
and refreshing the display interface of the target widget based on the interface refreshing data.
9. An apparatus for adding a widget, the apparatus comprising:
the first determining module is used for determining a target widget to be added, wherein the target widget is a widget associated with an installed target application;
the search module is used for searching the terminal which is connected with the first terminal through a first cross-device service, and the first cross-device service is responsible for cross-device information data transmission;
a third determining module, configured to determine, through the first cross-device service, a terminal that supports cross-device add widget function from the searched terminals, to obtain the one or more terminals, where the terminal that supports cross-device add widget function refers to a terminal that can add widget based on a widget addition request sent by another device;
a first obtaining module, configured to, if an instruction to add the target widget to a second terminal is received without installing the target application at the second terminal, obtain interface-related data of the target widget through a widget service, where the interface-related data is used to indicate a display interface of the target widget, the interface-related data includes widget display data and widget control data, the widget display data is used to indicate one or more of a layout of the target widget, an interface size of the target widget, and a type, a position, an icon, and a color of each control on the target widget, the widget control data is used to indicate one or more of a control object and a control event of each control on the target widget, the second terminal is any one of the one or more terminals, and the widget service is responsible for managing related services related to the widget;
a first sending module, configured to send a widget addition request to the second terminal through the first cross-device service, where the widget addition request carries the interface-related data, and the widget addition request is used to request the second terminal to add the target widget based on the interface-related data.
10. An apparatus for adding a widget, the apparatus comprising:
a receiving module, configured to receive, through a second cross-device service, a widget addition request sent by a first terminal without installing a target application, where the widget addition request carries interface-related data of the target widget, the interface-related data is used to indicate a display interface of the target widget, the interface-related data includes widget display data and widget control data, the widget display data is used to indicate one or more of a layout of the target widget, an interface size of the target widget, and a type, a position, an icon, and a color of each control on the target widget, the widget control data is used to indicate one or more of a control object and a control event of each control on the target widget, the target widget is a widget associated with the target application, the target application has been installed on the first terminal, and the second cross-device service is responsible for cross-device information data transmission;
the adding module is used for creating a display interface of the target widget on a display interface of a second terminal through a desktop starter based on the interface related data, and the desktop starter is responsible for processing and transmitting a display frame of the widget and a widget control event;
wherein the adding module is specifically configured to:
creating a widget view object through the desktop launcher, and creating a display area of the widget view object on a display interface of the second terminal;
creating an entity view corresponding to the interface related data through the desktop starter;
and adding the entity view into the display area through the desktop starter to obtain a display interface of the target widget.
11. A computer-readable storage medium having stored therein instructions that, when executed, implement the method of any of claims 1-4 or claims 5-8.
CN202011419518.0A 2020-12-07 2020-12-07 Method and device for adding widget and computer readable storage medium Active CN114610419B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011419518.0A CN114610419B (en) 2020-12-07 2020-12-07 Method and device for adding widget and computer readable storage medium
PCT/CN2021/119966 WO2022121445A1 (en) 2020-12-07 2021-09-23 Widget adding method, apparatus, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011419518.0A CN114610419B (en) 2020-12-07 2020-12-07 Method and device for adding widget and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114610419A CN114610419A (en) 2022-06-10
CN114610419B true CN114610419B (en) 2023-04-14

Family

ID=81855902

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011419518.0A Active CN114610419B (en) 2020-12-07 2020-12-07 Method and device for adding widget and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN114610419B (en)
WO (1) WO2022121445A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117676518A (en) * 2022-08-31 2024-03-08 华为技术有限公司 Cross-device interaction method for cards and electronic device
CN116679861A (en) * 2022-11-30 2023-09-01 荣耀终端有限公司 Content display method and electronic equipment thereof

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105556458A (en) * 2013-07-19 2016-05-04 三星电子株式会社 Method and apparatus for configuring home screen of device
CN109525713A (en) * 2018-10-30 2019-03-26 努比亚技术有限公司 A kind of application control method, wearable device and mobile terminal

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100759604B1 (en) * 2006-01-23 2007-09-17 주식회사 팬택앤큐리텔 System and Method for protection to receive abnormal update packets on the Firmware Over The Air
KR20100050603A (en) * 2008-10-21 2010-05-14 삼성전자주식회사 System providing widget service and method for updating widget information thereof
CN101894155A (en) * 2010-07-06 2010-11-24 中兴通讯股份有限公司 Classification method, system and terminal of widget
CN102075539B (en) * 2011-01-25 2016-06-22 中兴通讯股份有限公司 Data delivery system and method
CN102143219B (en) * 2011-01-25 2015-01-28 中兴通讯股份有限公司 Widget resource sharing method and system
CN102694670B (en) * 2011-03-23 2015-01-28 中兴通讯股份有限公司 Three-network integration widget management platform, realizing method thereof and system thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105556458A (en) * 2013-07-19 2016-05-04 三星电子株式会社 Method and apparatus for configuring home screen of device
CN109525713A (en) * 2018-10-30 2019-03-26 努比亚技术有限公司 A kind of application control method, wearable device and mobile terminal

Also Published As

Publication number Publication date
WO2022121445A1 (en) 2022-06-16
CN114610419A (en) 2022-06-10

Similar Documents

Publication Publication Date Title
WO2020103764A1 (en) Voice control method and electronic device
CN113434288B (en) Memory management method and electronic equipment
CN114327666B (en) Application starting method and device and electronic equipment
CN116009999A (en) Card sharing method, electronic equipment and communication system
CN114513847B (en) Positioning method, device, system, electronic equipment and storage medium
CN114610419B (en) Method and device for adding widget and computer readable storage medium
WO2021218429A1 (en) Method for managing application window, and terminal device and computer-readable storage medium
CN112860445B (en) Method and terminal for sharing data between fast application and native application
WO2022127130A1 (en) Method for adding operation sequence, electronic device, and system
CN113805797B (en) Processing method of network resource, electronic equipment and computer readable storage medium
CN114741256B (en) Sensor monitoring method and device and terminal equipment
CN112740148A (en) Method for inputting information into input box and electronic equipment
CN110609650B (en) Application state switching method and terminal equipment
WO2023284555A1 (en) Method for securely calling service, and method and apparatus for securely registering service
WO2022166435A1 (en) Picture sharing method and electronic device
WO2021238376A1 (en) Function pack loading method and apparatus, and server and electronic device
CN111752648A (en) System language switching method and related device
CN117009005A (en) Display method, automobile and electronic equipment
WO2022052962A1 (en) Application module startup method and electronic device
CN116204093B (en) Page display method and electronic equipment
CN116056176B (en) APN switching method and related equipment
CN116048710B (en) Application identifier display method, electronic device and readable storage medium
CN113179362B (en) Electronic device and image display method thereof
CN117472604A (en) Task continuing method, electronic equipment, program product and medium
CN117879981A (en) Display method and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant