WO2022121445A1 - 添加widget的方法、装置及计算机可读存储介质 - Google Patents

添加widget的方法、装置及计算机可读存储介质 Download PDF

Info

Publication number
WO2022121445A1
WO2022121445A1 PCT/CN2021/119966 CN2021119966W WO2022121445A1 WO 2022121445 A1 WO2022121445 A1 WO 2022121445A1 CN 2021119966 W CN2021119966 W CN 2021119966W WO 2022121445 A1 WO2022121445 A1 WO 2022121445A1
Authority
WO
WIPO (PCT)
Prior art keywords
widget
terminal
interface
target
application
Prior art date
Application number
PCT/CN2021/119966
Other languages
English (en)
French (fr)
Inventor
梁树为
Original Assignee
荣耀终端有限公司
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 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Publication of WO2022121445A1 publication Critical patent/WO2022121445A1/zh

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

Definitions

  • the present application relates to the field of terminal technologies, and in particular, to a method, an apparatus, and a computer-readable storage medium for adding widgets.
  • a widget is a widget that can be added to a certain display interface of the terminal for use, for example, can be added to the desktop for use, thereby increasing the functionality of the desktop.
  • widgets can be clocks, memos, or weather forecasts.
  • the widget can also be associated with an application, and the widget associated with the application has some functions of the application.
  • an application can provide one or more widgets. The user can directly interact with the widget of the application to realize some functions of the application, thereby facilitating the operation of the user.
  • the present application provides a method, an apparatus and a computer-readable storage medium for adding widgets, which can solve the problem in the related art that a widget of a terminal added application consumes storage resources and processing resources.
  • the technical solution is as follows:
  • a method for adding a widget comprising: determining a target widget to be added, and the target widget is associated with an installed target application; if an instruction to add the target widget to the second terminal is received, then Obtain interface-related data of the target widget, send a widget add request to the second terminal, and the widget add request carries the interface-related data of the target widget for requesting the second terminal to add the target widget to 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, which realizes the cross-device addition of the widget, so that the second terminal can also add the widget of the target application without installing the target application.
  • the consumption of the storage resources and processing resources of the second terminal by the installation target application is reduced, and the way of adding widgets is expanded.
  • 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 can be any widget of the target application.
  • the target widget has some functions of the target application, and the display interface of the target widget includes some data and/or controls related to the target application. Controls in the target widget can trigger certain functions of the target application.
  • the target application may be a music application, a video application, or a map application, etc., of course, it may also be other applications that can provide widgets.
  • the widget of the music application may be the music playing interface of the music application;
  • the widget of the video application may be the video playing interface of the video application;
  • the widget of the map application may be the navigation interface of the map application, and so on.
  • the target widget may also be other display interface associated with the target application, which is not limited in this embodiment of the present application.
  • the data related to the target widget interface is used to indicate the display interface of the target widget.
  • 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 to indicate 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 controls are included in the target widget.
  • the widget display data includes a layout file of the target widget, a configuration file for configuring the interface size of the target widget, a configuration file for configuring the type and position of each control on the target widget, and an icon file for each control on the target widget and one or more of the color definition files.
  • the widget control data is used to indicate one or more of the widget objects and widget events of each widget on the target widget.
  • the control events of the control include the response events that the control is fired.
  • the widget control data includes one or more of a configuration file for configuring control objects of each control on the target widget, and one or more configuration files for configuring control events for each control on the target widget.
  • widget control data can be configured through a defined Remount View object.
  • the Remount View object can contain one or more of the control objects and control events of each control on the target widget.
  • the target widget to be added may be set by default by the terminal, or may be selected by the user.
  • the first terminal can display one or more widget identifiers, and the user can select a widget identifier from the one or more widget identifiers.
  • the first terminal can display the widget identifiers identified by the widget identifier selected by the user. The widget is determined to be the widget to be added.
  • the first terminal may display a widget adding interface, where the widget adding interface includes one or more widget identifiers. If a selection operation of any widget identifier in the widget adding interface is detected, the widget identified by the selected widget identifier is determined as the widget to be added.
  • the widget addition operation may be a click operation, a sliding operation, a voice operation, or a gesture operation, and the like.
  • the widget adding operation may be an operation of long-pressing a blank area of the main interface, or an operation of clicking a widget, etc., which is not limited in this embodiment of the present application.
  • widgets are used to trigger adding widgets.
  • the first terminal may further display terminal identifiers of one or more terminals. If a selection operation of any terminal identification among the displayed one or more terminal identifications is detected, it is determined that an instruction to add the target widget to the terminal identified by the selected terminal identification is received, and the terminal identified by the selected terminal identification is second terminal.
  • one or more terminals are terminals that have established connections with the first terminal.
  • one or more terminals are terminals that have established a short-range wireless communication connection with the first terminal, such as a terminal that has established a short-range wireless communication connection with the first terminal through Bluetooth or WIFI.
  • 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 that supports the function of adding widgets across devices refers to a terminal that can add widgets based on widget adding requests sent by other devices.
  • the first terminal may first search for a terminal that has established a connection with the first terminal, and then determine a terminal that supports the function of adding widgets across devices from the searched terminals, and obtain one or more terminals. terminal, and then display the terminal identifiers of the one or more terminals.
  • the first terminal may first package the interface-related data of the target widget, and then send a widget add request to the second terminal, where the widget add request carries the packaged interface related data.
  • the first terminal sends a widget addition request to the second terminal, if it receives a widget event of the target widget sent by the second terminal, it can also trigger the target application to execute the service corresponding to the widget event.
  • the second terminal can control the target application in the first terminal based on the added target widget, so that the added widget realizes cross-device control of the target application and improves the flexibility of the widget.
  • the control event of the target widget may be triggered by a widget operation on the target widget added in the second terminal.
  • the widget operation refers to the operation on the target widget, which is used to trigger the control event of the target widget.
  • the widget operation may be a triggering operation on any control in the target widget, such as a click operation or a sliding operation on any control in the target widget.
  • the widget operation may also be a triggering operation on a physical key of the first terminal, or a rotating operation on a knob of the first terminal, or the like, during the process of displaying the target widget on the first terminal.
  • the widget operation may also be other operations for widgets, such as a voice operation or a gesture operation, which is not limited in this embodiment of the present application.
  • the first terminal may also obtain the interface refresh data of the target widget, A widget refresh request is sent to the second terminal, where the widget refresh request carries the interface refresh data, so as to request the second terminal to refresh the display interface of the target widget based on the interface refresh data.
  • the interface refresh data is used to indicate the refreshed display interface of the target widget.
  • the target widget in the second terminal can be refreshed through the first terminal, so that the widget can be refreshed across devices, which further improves the flexibility of the widget.
  • an apparatus for adding a widget in a second aspect, is provided, and the apparatus for adding a widget has the function of implementing the behavior of the method for adding a widget in the first aspect.
  • the apparatus for adding widgets includes at least one module, and the at least one module is configured to implement the method for adding widgets provided in the first aspect above.
  • an apparatus for adding widgets wherein the structure of the apparatus for adding widgets includes a processor and a memory, and the memory is used for storing the apparatus for adding widgets that supports the apparatus for adding widgets to perform the adding of widgets provided in the first aspect.
  • the processor is configured to execute programs stored in the memory.
  • the means for adding widgets may further include a communication bus for establishing a connection between the processor and the memory.
  • a computer-readable storage medium where instructions are stored in the computer-readable storage medium, when the computer-readable storage medium runs on a computer, the computer executes the method for adding a widget described in the first aspect.
  • a computer program product containing instructions that, when executed on a computer, cause the computer to execute the method for adding widgets described in the first aspect above.
  • a method for adding a widget comprising: receiving a widget adding request sent by a first terminal, where the widget adding request carries interface-related data of a target widget, where the interface-related data is used to indicate the target widget
  • the display interface, the target widget is associated with the target application installed on the first terminal; based on the relevant data of the interface, the target widget is added in the second terminal.
  • the widget of the target application can be added to the second terminal through the first terminal, which realizes the cross-device addition of the widget, so that the second terminal can also add the widget of the target application without installing the target application.
  • the consumption of the storage resources and processing resources of the second terminal by the installation target application is reduced, and the way of adding widgets is expanded.
  • the first terminal may add a target widget to 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 on the display interface of the second terminal.
  • the display interface of the target widget may occupy all or part of the area of the display interface of the second terminal, which is not limited in this embodiment of the present application.
  • the display interface for adding the target widget may be set by default by the second terminal, or may 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 of the target widget to be added may be determined based on the user's interface selection operation, and then based on the interface-related data, add the target display interface to the target display interface. target widget.
  • the interface selection operation may be a click operation, a sliding operation, a voice operation, or a gesture operation, etc., which is not limited in this embodiment of the present application.
  • the interface selection operation may be a long-press operation on a blank area of the currently displayed interface after sliding the display interface to the left or right, or a click operation to add an entry to a widget in the currently displayed interface, etc.
  • the operation of adding the target widget in the second terminal includes: 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 realize Add the target widget in the second terminal.
  • the operation of creating the display interface of the target widget on the display interface of the second terminal includes: creating a widget view object, and creating a display area of the widget view object on the display interface of the second terminal; Create an entity view corresponding to the interface-related data; add the entity view to the display area of the widget view object to obtain the display interface of the target widget, thereby completing the display of the target widget on the second terminal.
  • the widget view object can be the APP Widget Host View object
  • the entity view can be the entity View.
  • the second terminal may create an entity view corresponding to the interface-related data according to the widget display data in the interface-related data.
  • the second terminal may also send an addition success notification to the first terminal, where the addition success notification is used to indicate the second terminal The device has successfully added the target widget.
  • the first terminal may also store the device information of the second terminal that successfully added the target widget.
  • 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.
  • the device information of the second terminal to which the target widget is successfully added may be stored in the widget database through the application widget service of the first terminal.
  • the first terminal may also store the device information of the second terminal that successfully added the target widget.
  • 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.
  • the device information of the second terminal to which the target widget is successfully added may be stored in the widget database through the application widget service of the first terminal.
  • the user after adding the target widget in the second terminal, the user can 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 can be realized.
  • the second terminal after adding the target widget to the second terminal, if the second terminal detects a widget operation for the target widget, the second terminal sends the target triggered by the widget operation to the first terminal widget's control events.
  • the widget operation refers to the operation on the target widget, which is used to trigger the control event of the target widget.
  • the widget operation may be a triggering operation on any control in the target widget, such as a click operation or a sliding operation on any control in the target widget.
  • the widget operation may also be a triggering operation on a physical key of the first terminal, or a rotating operation on a knob of the first terminal, or the like, during the process of displaying the target widget on the first terminal.
  • the widget operation may also be other operations for widgets, such as a voice operation or a gesture operation, which is not limited in this embodiment of the present application.
  • sending the control event of the target widget triggered by the widget operation to the first terminal includes: if a triggering operation on the first control of the target widget is detected, based on The interface-related data determines a control event corresponding to the first control; and sends the control event corresponding to the first control to the first terminal.
  • the triggering operation of the first control may be a click operation or a sliding operation on the first control, and may also be a voice operation or a gesture operation, which is not limited in this embodiment of the present application.
  • the first control is any control of the target widget.
  • the second terminal may trigger a broadcast-like message, and then send the message to the first terminal.
  • the message carries the control event of the target widget triggered by the specified operation.
  • the second terminal may also base on the widget refresh request carried in the widget refresh request.
  • the interface of the target widget refreshes the data, and the display interface of the target widget is refreshed.
  • the widget refresh request carries interface refresh data of the target widget, and the interface refresh data is used to indicate the refreshed display interface of the target widget.
  • the interface refresh data may include one or more of widget display data and widget control data.
  • the second terminal can control the target application in the first terminal based on the added target widget, thereby realizing the cross-device control of the target application through the added widget, and improving the flexibility of the widget.
  • the first terminal can also refresh the target widget added in the first terminal according to the control of the second terminal, so that the widget can be refreshed across devices, which further improves the The flexibility of widgets.
  • an apparatus for adding widgets is provided, and the apparatus for adding widgets has the function of implementing the behavior of the method for adding widgets in the sixth aspect.
  • the apparatus for adding widgets includes at least one module, and the at least one module is configured to implement the method for adding widgets provided in the sixth aspect.
  • an apparatus for adding widgets wherein the structure of the apparatus for adding widgets includes a processor and a memory, and the memory is used for storing the apparatus for adding widgets to support the apparatus for adding widgets to perform the adding of widgets provided in the sixth aspect.
  • the processor is configured to execute programs stored in the memory.
  • the means for adding widgets may further include a communication bus for establishing a connection between the processor and the memory.
  • a computer-readable storage medium where instructions are stored in the computer-readable storage medium, when the computer-readable storage medium runs on a computer, the computer executes the method for adding widgets described in the sixth aspect.
  • a computer program product comprising instructions, which, when executed on a computer, cause the computer to execute the method for adding a widget described in the sixth aspect.
  • An eleventh aspect provides a system for adding widgets, including: a first terminal and a second terminal, wherein the first terminal is used for the method for adding widgets described in the first aspect; the second terminal A method for adding widgets described in the second aspect above.
  • FIG. 1 is a schematic diagram of a system for adding widgets provided by an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of a terminal provided by an embodiment of the present application.
  • FIG. 3 is a block diagram of a software structure of a terminal provided by an embodiment of the present application.
  • FIG. 4 is a system architecture diagram of a system for adding widgets provided by an embodiment of the present application.
  • 5 is a graphical user interface for adding widgets across devices provided by an embodiment of the present application.
  • FIG. 6 is another graphical user interface for adding widgets across devices provided by 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 provided by 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 provided by an embodiment of the present application;
  • FIG. 9 is a schematic diagram of a graphical user interface of a map application and a widget of the map application provided by an embodiment of the present application;
  • FIG. 10 is a flowchart of a method for adding widgets provided by an embodiment of the present application.
  • FIG. 11 is a schematic flowchart of a widget adding process provided by an embodiment of the present application.
  • FIG. 12 is a schematic flowchart of a widget refresh process provided by an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of a device for adding widgets provided by an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of another apparatus for adding widgets provided by an embodiment of the present application.
  • first and second are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features.
  • a feature defined as “first” or “second” may expressly or implicitly include one or more of that feature.
  • FIG. 1 is a schematic diagram of a system for adding widgets provided by an embodiment of the present application.
  • 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 that can provide widgets, 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 to which a target widget needs to be added, and the target widget is the widget of the target application.
  • the widget of the target application when the user wants to add the widget of the target application to the second terminal 20, the widget of the target application can be added to the second terminal 20 through the first terminal 10, so that the second terminal 20 does not have the target application installed in the second terminal 20. In this case, the widget of the target application can also be successfully added. In this way, the storage resources and processing resources of the second terminal 20 can be saved, the second terminal 20 needs to install the target application before adding the widget of the target application, expand the adding method of the widget, improve the flexibility, and can meet the diversification of users. need.
  • a widget can be added to another device through one device.
  • adding a widget to another device through one device is referred to as adding a widget across devices.
  • the first terminal 10 and the second terminal 20 may be mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR)/virtual reality (VR) devices, notebook computers, super mobile personal A computer (ultra-mobile personal computer, UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA) and other terminals, the wearable device can be a smart watch or a smart bracelet, etc.
  • the type of the two terminals 20 is not limited.
  • FIG. 1 only takes as an example that 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 also be of other types.
  • the first terminal 10 is a terminal with high 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.
  • the target application can be installed in the terminal with higher hardware performance, and then the widget of the target application can be added across devices for the terminal with lower hardware performance through the terminal with higher hardware performance.
  • the first terminal 10 is a mobile phone
  • the second terminal 20 is a smart watch
  • a widget of a target application is added to the smart watch through the mobile phone. Since 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 will occupy more storage resources of the smart watch, and the running of the target application will also consume more processing resources of the smart watch. Affects the performance of the smart watch, so in order to save the storage resources and processing resources of the smart watch, you can add the widget of the target application to the smart watch through the mobile phone.
  • the target widget has some functions of the target application. That is, the target widget is a shortcut of the target application, which includes part of the display interface and 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 part of the area of the display interface of the second terminal 20 .
  • the display interface of the target widget includes relevant data and/or controls of the target application. The controls in the target widget are used to trigger certain functions of the target application.
  • the user can also control the target application in the first terminal 10 by operating the target widget in the second terminal 20 .
  • the user can trigger the target application in the first terminal 10 to execute the corresponding function by clicking the control of the target widget in the second terminal 20, so as to realize the remote control of the target application.
  • FIG. 2 is a schematic structural diagram of a terminal 100 provided by an embodiment of the present application.
  • the terminal 100 may be the first terminal 10 or the second terminal 20 in the foregoing FIG. 1 .
  • the main operating system resources used by the first terminal 10 to provide services may include processors, memory, network services, and the like.
  • the second terminal 10 has a display screen and can receive various input events, including but not limited to operation events such as screen touch, button click, and knob rotation.
  • 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, Antenna 1, Antenna 2, Mobile Communication Module 150, Wireless Communication Module 160, Audio Module 170, Speaker 170A, Receiver 170B, Microphone 170C, Headphone Interface 170D, Sensor Module 180, Key 190, Motor 191, Indicator 192, Camera 193, Display screen 194, and subscriber identification module (subscriber identification module, SIM) card interface 195 and so on.
  • SIM subscriber identification module
  • 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, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
  • the terminal 100 may include more or less components than shown, or some components may be combined, or some components may be separated, or different component arrangements.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait.
  • application processor application processor, AP
  • modem processor graphics processor
  • graphics processor graphics processor
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • different processing units can be independent devices, or can be integrated in one or more processors.
  • the controller may be the nerve center and command center of the terminal 100 .
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This 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. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may contain multiple sets of I2C buses.
  • the processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flash, the camera 193 and the like through different I2C bus interfaces.
  • the processor 110 may couple the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate with each other through the I2C bus interface, so as to realize the touch function of the terminal 100 .
  • the I2S interface can be used for audio communication.
  • the processor 110 may contain multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170 .
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the I2S interface, so as to realize the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communications, sampling, quantizing and encoding analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to realize the function of answering calls through the Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is typically used to connect the processor 110 with the wireless communication module 160 .
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
  • the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193 .
  • MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
  • the processor 110 communicates with the camera 193 through the CSI interface, so as to realize the shooting function of the terminal 100 .
  • the processor 110 communicates with the display screen 194 through the DSI interface to implement the display function of the terminal 100 .
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface may be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like.
  • the GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the terminal 100, and can also be used to transmit data between the terminal 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. This interface can also be used to connect other terminals, such as AR devices, etc.
  • the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the terminal 100 .
  • the terminal 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive wireless charging input through the wireless charging coil of the terminal 100 . While the charging management module 140 charges the battery 142 , it can also supply power to the terminal through the power management module 141 .
  • the power management module 141 is used for connecting 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 supplies power to the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be provided 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, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in terminal 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the 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 wireless communication solution including 2G/3G/4G/5G, etc. applied on the terminal 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110, and may be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the terminal 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • frequency modulation frequency modulation, FM
  • NFC near field communication technology
  • infrared technology infrared, IR
  • 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 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation on it, amplify it, and convert it into electromagnetic waves for
  • the antenna 1 of the terminal 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the terminal 100 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the GNSS may include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou navigation satellite system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • global positioning system global positioning system, GPS
  • global navigation satellite system global navigation satellite system, GLONASS
  • Beidou navigation satellite system beidou navigation satellite system, BDS
  • quasi-zenith satellite system quadsi -zenith satellite system, QZSS
  • SBAS satellite based augmentation systems
  • the terminal 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 194 is used to display images, videos, and the like.
  • Display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • LED diode AMOLED
  • flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the terminal 100 may include one or N display screens 194 , where N is a positive integer greater than one.
  • the terminal 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
  • the ISP is used to process the data fed back by the camera 193 .
  • the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin tone.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object is projected through the lens to generate an optical image onto the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the terminal 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • the camera 193 can be used as a gesture capturing module to capture the user's gesture operation.
  • the camera 193 may include a front camera and/or a rear camera.
  • a digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the terminal 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point, and so on.
  • Video codecs are used to compress or decompress digital video.
  • Terminal 100 may support one or more video codecs.
  • the terminal 100 can play or record videos in various encoding formats, for example, moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the terminal 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the processor 110 executes various functional applications and data processing of the terminal 100 by executing the instructions stored in the internal memory 121 .
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area may store data (such as audio data, phone book, etc.) created during the use of the terminal 100 and the like.
  • the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the terminal 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playback, recording, etc.
  • the keys 190 of the terminal 100 may include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key.
  • Motor 191 can generate vibrating cues. The motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback.
  • the indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
  • the SIM card interface 195 is used to connect a SIM card.
  • the terminal 100 also includes various different sensors, for example, the pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals.
  • the gyro sensor 180B may be used to determine the 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 can detect the magnitude of the acceleration of the terminal 100 in various directions (generally three axes).
  • Distance sensor 180F for measuring distance.
  • the terminal 100 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the terminal 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
  • Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the ambient light sensor 180L is used to sense ambient light brightness.
  • the terminal 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the terminal 100 can use the collected fingerprint characteristics to unlock the fingerprint, access the application lock, take a picture with the fingerprint, answer the incoming call with the fingerprint, and the like.
  • Touch sensor 180K also called "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, also called a “touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the temperature sensor 180J is used to detect the temperature.
  • 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 layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiments of the present application take an Android system with a layered architecture as an example to exemplarily describe the software structure of the terminal 100 .
  • FIG. 3 is a software structural block diagram of a terminal 100 provided by an embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
  • the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, and a kernel layer.
  • the application layer can include a series of application packages. As shown in Figure 3, the application package can include video, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, SMS and other applications.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer can also be referred to as the system service framework layer.
  • the application framework layer includes some predefined functions. As shown in Figure 3, the application framework layer may include window managers, content providers, view systems, telephony managers, resource managers, notification managers, and the like.
  • a window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
  • Content providers are used to store and retrieve data and make these data accessible to applications.
  • the data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications.
  • a display interface can consist of one or more views.
  • the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
  • the telephony manager is used to provide the communication function of the terminal 100 .
  • the management of call status including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files, etc.
  • the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt tone is issued, the terminal vibrates, and the indicator light flashes.
  • Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
  • the core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.
  • the application layer and the application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
  • a system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
  • surface manager surface manager
  • media library Media Libraries
  • 3D graphics processing library eg: OpenGL ES
  • 2D graphics engine eg: SGL
  • the Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
  • a 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.
  • the sensor driver is used to call the infrared temperature sensor, and the camera driver can start the camera to collect images.
  • FIG. 4 is a system architecture diagram of a system for adding widgets provided by an embodiment of the present application.
  • the first terminal 10 includes an application program layer and an application program framework layer, and the application program framework layer is also called a system service framework layer.
  • the application layer of the first terminal 10 includes 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 includes a desktop launcher 21 .
  • the application framework layer of the second device 20 includes cross-device services 22 .
  • the target application 11 can be any application, and is responsible for implementing application business functions.
  • the target application 11 is responsible for executing various widget services of the target application 11 .
  • the target application 11 has various widget service request interfaces, and the target application 11 can execute various widget services by calling various widget service request interfaces. For example, if the target application 11 receives the widget event of the target widget, it can call the widget service request interface corresponding to the widget event, and execute the service corresponding to the widget event through the widget service request interface corresponding to the widget event.
  • the application widget management 12 is responsible for widget-related business management on the application side. For example, it is responsible for monitoring various control events of the target widget, and notifying the target application 11 of the control events. Or, it is responsible for triggering the refresh process of the target widget when it is determined that the display interface of the target widget needs to be refreshed. Or, it is responsible for business interaction with the target application 11 and so on.
  • the application widget management 12 may also be referred to as an application widget provider (APP widget provider).
  • APP widget provider application widget provider
  • the application widget management 12 is integrated in the target application 11 .
  • the application widget management 12 includes an event broadcast receiver, an interface refresh interface, an interface for interacting with application services, and the like.
  • the event broadcast receiver is used to monitor various control events of the target widget.
  • the application widget management 12 can notify the target application 11 of the control event of the target widget monitored by the event broadcast receiver.
  • the interface refresh interface is used to trigger the interface refresh process.
  • the interface refresh interface is used to call the application widget service 13, and obtain the interface refresh data of the target widget through the application widget service 13, and the interface refresh data is used to indicate the refreshed display interface of the target widget.
  • the application service interaction interface is used for service interaction with the target application 11 .
  • the application widget service (APP widget service) 13 is responsible for the related business management of widgets 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 acquired, and the interface-related data is used to indicate the display interface of the target widget. Or, when it is determined that the display interface of the target widget needs to be refreshed, the interface refresh data of the target widget is obtained. Or, it is responsible for recording widget-related data, etc.
  • the application widget service 13 includes a widget add interface and a widget refresh interface.
  • the widget adds an interface to obtain interface-related data of the target widget.
  • the widget refresh interface is used to obtain the interface refresh data of the target widget.
  • the application widget service 13 also has a widget data record management function, and the widget data record management function is used to record widget related data, such as recording widget addition data or widget refresh data.
  • the first terminal 10 determines that the display interface of the target widget needs to be refreshed, it can call the interface refresh interface of the application widget management 12, and send a refresh message to the application widget service 13 through the called interface refresh interface.
  • the application widget service 13 calls the widget refresh interface of the application widget service 13, and obtains the 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 add request or a widget refresh request to the second terminal 20 . Or, it is responsible for receiving control events of the widget of the target application sent by the second terminal 20, and the like. In addition, the cross-device service 14 can also package the interface-related data or interface refresh data of the target widget, or query the device that establishes a connection with the first terminal 10 or the widget-added device, so as to query the establishment of a connection with the first terminal 10. add the device information of the device or widget, or whether the device supports the function of adding widgets across devices, etc. The device information includes a device type, a software version or a system version of the device, and the like. Supporting the function of adding widgets across devices means that widgets can be added based on widget adding requests sent by other devices. Widget adding devices refers to devices that add widgets across devices.
  • the cross-device service 14 includes a widget add interface, a widget refresh interface, and a widget control event transmission interface.
  • the widget adding interface is used to send a widget adding request to the second terminal 20, and the widget adding request carries the interface related data of the target widget.
  • the widget adding interface is further configured to package the interface related data of the target widget, so as to send a widget adding request carrying the packaged interface related data to the second terminal 20 .
  • the widget refresh interface is used to send a widget refresh request to the second terminal 20, where the widget refresh request carries the interface refresh data of the target widget.
  • the widget refresh interface is further configured to package 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 to transmit the control events 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 .
  • the cross-device service 14 further includes a widget adding device query interface, and the widget adding device query interface is used to query the connected device or the widget added device to query the device information of the connected device or the widget added device.
  • the desktop launcher 21 is responsible for the display frame of the widget and the processing and transmission of the control events of the widget.
  • the desktop launcher 21 may be a desktop launcher (Launcher) similar to the Android system.
  • 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 refresh data of the target widget sent by the first terminal 10, the display interface of the target widget is refreshed. Or, if a designated operation on the target widget is detected, the control event of the target widget is sent to the cross-device service 22 .
  • the desktop launcher 21 includes a widget interface refresh interface, and the widget interface refresh interface is used to refresh the 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 the data sent by the first terminal 10
  • a widget add request or a widget refresh request is responsible for sending the widget event of the widget of the target application to the first terminal 10, and the like.
  • 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 used for receiving a widget adding request, and sending the widget adding request to the desktop launcher 21 to instruct the desktop launcher 21 to create a display interface of the target widget.
  • the widget interface refresh interface is used to receive a widget refresh request, and send the widget refresh request to the desktop launcher 21 to instruct the desktop launcher 21 to refresh the display interface of the target widget.
  • the widget control event transmission interface is used to transmit the control events of the target widget. For example, the control event of the target widget is sent to the first terminal 10 .
  • the first terminal may also provide the user with an operation interface for adding widgets to other devices, so that the user can easily add widgets to other devices through the operation interface.
  • widget may include one or more widget identifiers, and the user may select the widget identifier of the target widget to be added from the one or more widget identifiers.
  • the widget identifier is used to uniquely identify the widget, and may be the name of the widget, an identity document (ID), an icon, or the like, which is not limited in this embodiment of the present application.
  • the operation interface may further include device identifiers of one or more devices, and the user can select the device identifier of the second terminal to which the target widget is to be added from the device identifiers of the one or more devices, so as to add the target widget to in the second terminal.
  • the device identifier is used to uniquely identify the corresponding device, and may be the model, name, or ID of the device.
  • the operation interface can be triggered by the user through a widget adding operation, and the widget adding operation can be an operation of long-pressing a blank area of the display interface such as the main interface, or an operation of clicking to add a widget option in the setting menu, etc.
  • the embodiment of the present application also applies to this. Not limited.
  • the following embodiments of the present application will take the first terminal as a mobile phone and the second terminal as a smart watch as an example, and combine the drawings and application scenarios to introduce the process of adding widgets to the second terminal through the first terminal.
  • most smart watches have a display screen that can be touched, and the devices are small and can be worn for a long time. Therefore, adding widgets to such smart watches can quickly view information or implement quick operation functions through the added widgets.
  • 5 is a schematic diagram of a graphical user interface (graphical user interface, GUI) for adding widgets across devices provided by an embodiment of the present application.
  • 5 (a) shows the current output interface content 501 of the mobile phone in the unlocking mode, the interface content 501 displays a variety of applications (application, App), such as music, camera, settings and video, etc. application. It should be understood that the interface content 501 may further include other more application programs, which are not limited in this embodiment of the present application.
  • the widget adding operation can be used to trigger the mobile phone to display the widget adding interface, so that the user can select the desired widget through the widget adding interface.
  • FIG. 5 shows a desktop setting interface 502
  • the desktop setting interface 502 includes setting options such as wallpaper, widgets, switching effects, and desktop settings. Among them, widgets are used to add widgets.
  • the user can click the widget option, and in response to the user's click operation, the mobile phone displays a widget adding interface.
  • the widget adding interface may include one or more widget identifiers, and the user may select the target widget to be added based on the one or more widget identifiers.
  • FIG. 5 shows a widget adding interface 503 .
  • the widget adding interface 503 includes icons of a plurality of widgets, such as icons of widget1 , widget2 and widget3 . It should be understood that the widget adding interface 503 may further include icons of other more widgets, 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 widget icons. As shown in (c) of Figure 5, the user clicks the icon of widget2, and in response to the user's click operation, the mobile phone displays a device selection interface, and the device selection interface displays the device identifiers of the devices that can be added. In Identification, select the device identification of the device to which you want to add widget2 to add widget2 to the devices identified by the selected device identification.
  • the device that can be added is a device that has established a connection with the mobile phone, or a device that has established a connection with the mobile phone and supports adding a widget function across devices.
  • FIG. 5 shows a device selection interface 504, the device selection interface 504 includes options such as 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 further include other more addable devices, which are not limited in this embodiment of the present application.
  • the device 1 may display the widget addition inquiry information, and the widget addition inquiry information is used to prompt the user whether to agree to add the widget in the mobile phone.
  • FIG. 6 is a schematic diagram of another graphical user interface for adding a widget across devices provided by an embodiment of the present application.
  • the smart watch can display the widget addition query interface 601 as shown in (a) of FIG. 6 .
  • the widget adding query interface 601 displays the widget adding query information: whether to agree to add the widget of the mobile phone, as well as the consent option and the cancellation option. If the user agrees to add the widget of the mobile phone, click the consent option, and in response to the user's click operation, the smart watch will send a confirmation adding message to the mobile phone, and the confirmation adding message is used to indicate the consent to add the widget of the mobile phone.
  • the mobile phone After the mobile phone receives the confirmation adding message sent by the smart watch, it can send a widget adding request to the smart watch, and the widget adding request carries the 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 to indicate that the mobile phone is transmitting interface-related data of widget2.
  • Figure (b) in FIG. 6 shows a data transmission interface 602 of a smart watch, and the data transmission interface 602 displays data transmission information: widget data transmission is in progress.
  • the smart watch can also display data receiving information, and the data receiving information is used to indicate that the smart watch is receiving the interface-related data of the widget2.
  • FIG. 6 shows a data receiving interface 603 of a smart watch, and the data receiving interface 603 displays data receiving information: widget data receiving.
  • the smart watch After the smart watch receives the data, it can add widget2 to a certain display interface of the smart watch according to the received interface-related data of widget2.
  • the display interface for adding widget2 may be a designated interface, or may be selected by the user.
  • the user may select the display interface to which the widget2 is to be added by sliding the display interface left and right.
  • Figure (d) in Figure 6 shows a display interface 604 of a smart watch.
  • the user can slide the display interface in the direction shown in Figure (d) in Figure 6 , in response to the user's sliding operation, the smart watch can display other display interfaces.
  • the display interface selected by the user may also display a widget addition entry, and the user can trigger the smart watch to add widget2 on the current display interface by triggering the widget addition entry.
  • the widget addition entry may be the plus sign shown in (d) of FIG. 6 .
  • the user wants to add widget2 on the current display interface, the user can click the plus sign shown in (d) in Figure 6.
  • the smart watch based on the received interface-related data of widget2, in the current Add widget2 to the display interface.
  • FIG. 6 shows a display interface 605 after adding widget2, and the display interface 605 displays the display interface of widget2.
  • the user can also control the target application in the mobile phone by operating the widget2 in the smartwatch, and the target application refers to the application associated with the widget2.
  • the widget2 control event can be triggered, and the smartwatch sends the triggered widget2 control event to the mobile phone, and the target application in the mobile phone executes the corresponding business based on the received control event, and sends the business data to the mobile phone.
  • the target widget added by the first terminal to the second terminal is a widget associated with the target application installed by the first terminal, that is, the target widget may be any widget of the target application installed by the first terminal .
  • the target widget has part of the functionality of the target application.
  • the target application may be a music application, a video application, or a map application, or the like.
  • the widget of the music application can be a music playing interface of the music application, and is used to realize information viewing and playback control of the music application.
  • the widget of the video application may be a video playback interface of the video application, and is used to realize information viewing and playback control of the video application.
  • the widget of the map application can be the navigation interface of the map application, and is used to realize the display guidance function of the 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 are not limited in this embodiment of the present application.
  • the target widget added to the smart watch is illustrated by taking the mobile phone as an example of adding the target widget of the target application to the smart watch.
  • FIG. 7 is a schematic diagram of a graphical user interface of a music application and a widget of the music application provided by an embodiment of the present application.
  • FIG. 7 shows 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 song title, song album cover, lyrics, player playing, previous/next song, favorite, list play order, and setting 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 present application.
  • Figure (b) in Figure 7 shows a display interface 702 after adding a widget of a music application to a smart watch.
  • the music playback interface includes buttons such as song title, song album cover, player playback, previous/next track, favorites, list playback order, setting menu, etc., which are used to realize information viewing and playback control of music applications. For example, based on the widget of the music application added by the smart watch, the user can directly switch the previous or next song, adjust the playback progress of the song, and switch the song collection and playback status. It should be understood that the display interface of the widget of the music application may also be other interface content, which is not limited in this 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 provided by an embodiment of the present application.
  • Figure (a) in FIG. 8 shows a video playback interface 801 of a video application output by a mobile phone when a video application is opened.
  • the video playback interface 801 displays buttons such as video name, video image, player playback, volume adjustment, zoom, download, and favorite. It should be understood that the video playing interface 801 may further include other more data and function buttons, which are not limited in this embodiment of the present application.
  • Figure (b) in Figure 8 shows a display interface 802 after adding a widget of a video application to a smart watch.
  • the display interface of the widget of a video application is abbreviated
  • the video playback interface including the video screen and the playback buttons of the player, is used to realize the information viewing and playback control of the video application. Users can directly switch videos, adjust the video playback progress, adjust the volume, adjust the brightness, and switch the playback status based on the widget of the music application added by the smart watch.
  • the display interface of the widget of the video application may also be other interface content, which is not limited in this embodiment of the present application.
  • the user can control the playback progress, volume or brightness of the video application by rotating the knob of the smart watch to improve the control accuracy.
  • FIG. 9 is a schematic diagram of a graphical user interface of a map application and a widget of the map application provided by an embodiment of the present application.
  • (a) of FIG. 9 shows 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 such as navigation direction, road information, exit, and settings. 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) shows a display interface 902 after adding a map application widget to the smart watch. As shown in Fig.
  • the display interface of the map application widget is abbreviated Navigation interface, including navigation direction, road and other important navigation information, is used to realize the display guidance function of navigation route.
  • the display interface of the widget of the map application can be refreshed according to a specified strategy, such as periodic refresh, 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 content, which is not limited in this embodiment of the present application.
  • FIG. 10 is a flowchart of a method for adding widgets provided by an embodiment of the present application.
  • the interaction subjects of the method are a first terminal and a second terminal. Referring to Figure 10, the method includes:
  • Step 1001 The first terminal determines a target widget to be added, and the target widget is a widget associated with an 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 can be any widget of the target application.
  • the target widget has some functions of the target application, and the display interface of the target widget includes some data and/or controls related to the target application.
  • the controls in the target widget can trigger certain functions of the target application.
  • the target application may be a music application, a video application, or a map application, etc., of course, it may also be other applications that can provide widgets.
  • the widget of the music application may be the music playing interface of the music application;
  • the widget of the video application may be the video playing interface of the video application;
  • the widget of the map application may be the navigation interface of the map application, and so on.
  • the target widget may also be other display interface associated with the target application, which is not limited in this embodiment of the present application.
  • the target widget to be added may be set by default by the first terminal, or may be selected by the user.
  • the first terminal can display one or more widget identifiers, and the user can select a widget identifier from the one or more widget identifiers.
  • the first terminal can display the widget identifiers identified by the widget identifier selected by the user. The widget is determined to be the widget to be added.
  • the widget identifier is used to uniquely identify the corresponding widget, and may be the name of the widget, an identity document (ID), an icon, or the like, which is not limited in this embodiment of the present application.
  • the first terminal may display a widget adding interface, where the widget adding interface includes one or more widget identifiers. If a selection operation of any widget identifier in the widget adding interface is detected, the widget identified by the selected widget identifier is determined as the widget to be added.
  • the widget adding interface may be the widget adding interface 503 shown in (c) in FIG. 5 .
  • the widget addition operation may be a click operation, a sliding operation, a voice operation, or a gesture operation, and the like.
  • the widget adding operation may be an operation of long-pressing a blank area of the main interface, or an operation of clicking a widget, etc., which is not limited in this embodiment of the present application.
  • widgets are used to trigger adding widgets.
  • Step 1002 If the first terminal receives an instruction to add the target widget to the second terminal, it acquires interface-related data of the target widget, and the interface-related data is used to indicate the display interface of the target widget.
  • 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 to indicate 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 controls are included in the target widget.
  • the widget display data includes a layout file of the target widget, a configuration file for configuring the interface size of the target widget, a configuration file for configuring the type and position of each control on the target widget, and an icon file for each control on the target widget and one or more of the color definition files.
  • the widget control data is used to indicate one or more of the widget objects and widget events of each widget on the target widget.
  • the control event of the control includes the response event triggered by the control, such as the click response event.
  • the widget control data includes one or more of a configuration file for configuring control objects of each control on the target widget, and one or more configuration files for configuring control events for each control on the target widget.
  • widget control data can be configured through a defined Remount View object.
  • the Remount View object can contain one or more of the control objects and control events of each control on the target widget.
  • the instruction to add the target widget to the second terminal may be triggered by a device selection operation, and the device selection operation may be a click operation, a slide operation, a voice operation, a gesture operation, or the like.
  • the first terminal may display terminal identifiers of one or more terminals. If a selection operation of any terminal identification among the displayed one or more terminal identifications is detected, it is determined that an instruction to add the target widget to the terminal identified by the selected terminal identification is received, and the terminal identified by the selected terminal identification is second terminal.
  • one or more terminals are terminals that have established connections with the first terminal.
  • one or more terminals are terminals that have established a short-range wireless communication connection with the first terminal, such as a terminal that has established a short-range wireless communication connection with the first terminal through Bluetooth or WIFI.
  • 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 that supports the function of adding widgets across devices refers to a terminal that can add widgets based on widget adding requests sent by other devices.
  • the first terminal may first search for a terminal that has established a connection with the first terminal, and then determine a terminal that supports the function of adding widgets across devices from the searched terminals, and obtain one or more terminals. terminal, and then display the terminal identifiers of the one or more terminals.
  • the operation of determining a terminal that supports adding a widget function across devices from the searched terminals may include the following implementations:
  • the first implementation manner for any terminal that is searched, the device information of the terminal is obtained, and according to the device information of the terminal, it is determined whether the terminal supports adding a widget function across devices.
  • the device information of the terminal includes one or more of the type of the terminal, the software version or the system version of the terminal. For example, whether the terminal supports adding a widget across devices can be determined according to the device information of the terminal and the correspondence between the stored device information and the support information of whether adding a widget across devices is supported.
  • the second implementation manner for any terminal that is searched, the device tag of the terminal is obtained, and according to the device tag of the terminal, it is determined whether the terminal supports adding a widget function across devices.
  • the device tag of the terminal is used to indicate whether the terminal supports adding a widget function across devices.
  • the device tag of the terminal can be obtained by sending the terminal. For example, after establishing a connection with the first terminal, the terminal may determine whether the terminal supports adding a widget function across devices according to the device information of the local terminal, generate a device tag of the terminal based on whether the terminal supports adding a widget function across devices, and then pass The established connection transmits the terminal's device tag to the first terminal. After receiving the device tag of the terminal, the first terminal may store the device tag of the terminal, so as to subsequently determine whether the terminal supports adding a widget function across devices based on the stored device tag.
  • the first terminal may use the cross-device service 14 to query whether the connected terminal supports adding a widget function across devices.
  • a device query interface for adding a widget to the cross-device service 14 can be used to query whether the connected device supports the function of adding a widget across the device.
  • the first terminal may further store the addition data of the target widget.
  • the first terminal may store the added data of the target widget by applying the widget service 13 , for example, creating a record of adding data of the target widget by applying the widget service 13 .
  • the added data of the target widget may include one or more of the following data: the widget identifier of the target widget, the added event and the added time, etc., and of course other added data of the target widget, which is not made in this embodiment of the present application. limited.
  • Step 1003 The first terminal sends a widget add request to the second terminal, the widget add request carries the interface related data, and the widget add request is used to request the second terminal to add a target widget based on the interface related data.
  • the first terminal may first package the interface-related data of the target widget, and then send a widget add request to the second terminal, where the widget add request carries the packaged interface related data.
  • the first terminal may send a widget addition request to the second terminal by adding the service 14 across devices.
  • the interface-related data of the target widget is packaged, and a widget-adding request carrying the packaged interface-related data is sent to the second terminal.
  • a widget addition confirmation message may be sent to the second terminal first.
  • the second terminal may display widget addition inquiry information, and the widget addition inquiry information is used to prompt the user whether to agree to add the target widget from the first terminal. If the second terminal detects the user's confirmation adding operation based on the displayed widget adding query information, it sends a confirmation adding message to the first terminal, where the confirmation adding message is used to indicate that the target widget is approved to be added from the first terminal. After receiving the confirmation adding message, the first terminal obtains the interface-related data of the target widget, and sends the interface-related data of the target widget to the second terminal.
  • Step 1004 The second terminal receives the widget addition request sent by the first terminal, and adds a target widget to the second terminal based on the interface-related data.
  • the first terminal may add a target widget to 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 on the display interface of the second terminal.
  • the display interface of the target widget may occupy all or part of the area of the display interface of the second terminal, which is not limited in this embodiment of the present application.
  • 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 may be set by default by the second terminal, or may 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 of the target widget to be added may be determined based on the user's interface selection operation, and then based on the interface-related data, add the target display interface to the target display interface. target widget.
  • the interface selection operation may be a click operation, a sliding operation, a voice operation, or a gesture operation, etc., which is not limited in this embodiment of the present application.
  • the interface selection operation may be a long-press operation on a blank area of the currently displayed interface after sliding the display interface to the left or right, or a click operation to add an entry to a widget in the currently displayed interface, etc.
  • the operation of adding the target widget in the second terminal includes: 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 realize the display interface of the target widget in the second terminal. Add target widget.
  • the operation of creating the display interface of the target widget on the display interface of the second terminal includes: creating a widget view object, and creating a display area of the widget view object on the display interface of the second terminal; Create an entity view corresponding to the interface-related data; add the entity view to the display area of the widget view object to obtain the display interface of the target widget, thereby completing the display of the target widget on the second terminal.
  • the widget view object can be the APP Widget Host View object
  • the entity view can be the entity View.
  • the second terminal may create an entity view corresponding to the interface-related data according to the widget display data in the interface-related data.
  • the second terminal may receive a widget addition request sent by the first terminal through the cross-device service 22 , and then, through the desktop launcher 21 , add a target to the second terminal based on the interface-related data of the target widget widget.
  • the cross-device service 22 can send the widget adding request to the desktop launcher 21, and the desktop launcher 21 can display the frame through the widget and add the target widget in the second terminal.
  • the second terminal may also send an addition success notification to the first terminal, where the addition success notification is used to indicate the second terminal The device has successfully added the target widget.
  • the first terminal may also store the device information of the second terminal that successfully added the target widget.
  • 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.
  • the device information of the second terminal to which the target widget is successfully added may be stored in the widget database through the application widget service of the first terminal.
  • the user can 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 can be realized.
  • the cross-device operation flow of the target widget may include the following steps 1005-1009.
  • Step 1005 If the second terminal detects a widget operation for the added target widget, it sends a control event of the target widget triggered by the widget operation to the first terminal.
  • the widget operation refers to the operation on the target widget, which is used to trigger the control event of the target widget.
  • the widget operation may be a triggering operation on any control in the target widget, such as a click operation or a sliding operation on any control in the target widget.
  • the widget operation may also be a triggering operation on a physical key of the first terminal, or a rotating operation on a knob of the first terminal, or the like, during the process of displaying the target widget on the first terminal.
  • the widget operation may also be other operations targeting the target widget, such as voice operation or gesture operation, which is not limited in this embodiment of the present application.
  • sending the control event of the target widget triggered by the widget operation to the first terminal includes: if a triggering operation on the first control of the target widget is detected, based on The interface-related data determines a control event corresponding to the first control; and sends the control event corresponding to the first control to the first terminal.
  • the triggering operation of the first control may be a click operation or a sliding operation on the first control, and may also be a voice operation or a gesture operation, which is not limited in this embodiment of the present application.
  • the first control is any control of the target widget.
  • the second terminal may trigger a broadcast-like message, and then send the message to the first terminal.
  • the message carries the control event of the target widget triggered by the specified operation.
  • the second terminal can use the desktop launcher 21 to detect the widget operation for the added target widget. If the widget operation for the added target widget is detected, the widget control of the desktop launcher 21 is used to detect the widget operation.
  • the event sending interface sends the control event of the target widget triggered by the widget operation to the cross-device service 22, and sends the control event to the first terminal through the cross-device service 22.
  • Step 1006 The first terminal receives the control event of the target widget sent by the second terminal, and triggers the target application to execute the service corresponding to the control event.
  • the target application is a music application
  • the target widget is the widget of the music application
  • the control event is a click event on the switch to the next song button in the widget of the music application
  • the music application can be triggered to switch to the next song.
  • the first terminal may receive the control event of the target widget sent by the second terminal through the cross-device service in the application framework layer.
  • the first terminal can monitor the control event of the target widget through the application widget management in the application 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.
  • the first terminal may receive the control event of the target widget sent by the second terminal through the cross-device service 14 .
  • the first terminal can 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, the target application 11 is triggered to execute the service corresponding to the widget event.
  • Step 1007 After the target application executes the service corresponding to the control event, if it is determined that the target widget needs to perform interface refresh based on the service executed by the target application, the first terminal obtains the interface refresh data of the target widget, and the interface refresh data is used to indicate the target The refreshed display interface of the widget.
  • the interface refresh data of the target widget may include one or more of widget display data and widget control data of the target widget.
  • the first terminal may obtain interface refresh data of the target widget through the application widget service in the application framework layer. As shown in FIG. 4 , the first terminal may acquire interface refresh data of the target widget by applying the widget refresh interface of the widget service 13 .
  • Step 1008 The first terminal sends a widget refresh request to the second terminal, the widget refresh request carries the interface refresh data, and the widget refresh request is used to request the second terminal to refresh the display interface of the target widget based on the interface refresh data.
  • the first terminal before the first terminal sends the widget refresh request to the second terminal, it can package 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 packaged interface. Refresh data.
  • the first terminal may send a widget refresh request to the second terminal through the cross-device service of the application framework layer.
  • the first terminal can package 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 packaged interface refresh data to the second terminal.
  • Step 1009 The second terminal receives the widget refresh request sent by the first terminal, and refreshes the display interface of the target widget based on the interface refresh data.
  • the second terminal may receive the widget refresh request sent by the first terminal through the cross-device service 22 , and then use the desktop launcher 21 to refresh the display interface of the target widget based on the interface refresh data of the target widget. refresh.
  • the cross-device service 22 can add and refresh the widget and send it to the desktop launcher 21, and the desktop launcher 21 can refresh the target widget through the widget display framework.
  • a widget of a music application is added to the smart watch through a mobile phone, and the widget of the music application added to the smart watch is the music playing interface shown in (b) of FIG. 7 .
  • the user can directly control the music application in the mobile phone to realize the switching of the previous or next song, the adjustment of the song playback progress, the song collection and the switching of the playback status by performing the widget operation on the widget of the music application added by the smart watch.
  • the widget operations may include triggering operations on controls in a widget of a music application added to the smart watch, or operations on physical buttons or knobs of the smart watch, and the like.
  • the cross-device operation flow of the widget of a music application includes:
  • the smart watch In response to the user's click operation, the smart watch sends a control event triggered by the click operation to the mobile phone.
  • the mobile phone After the mobile phone receives the control event, it triggers the music application in the mobile phone to execute the service of switching to the next song, and sends the interface refresh data after switching to the next song to the smart watch.
  • the smart watch After receiving the interface refresh data, the smart watch refreshes the widget of the music application based on the interface refresh data, so as to refresh the display interface of the widget of the music application to the display interface after switching to the next song.
  • 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 the video playing interface shown in (b) of FIG. 8 .
  • the user can directly control the video application in the mobile phone to realize the functions of video switching, video playback progress adjustment, volume adjustment, brightness adjustment and playback status switching by performing widget operation on the widget of the video application added by the smart watch.
  • the widget operations may include triggering operations on controls in the widgets of the video application added by the smart watch, or operations on physical buttons or knobs of the smart watch, and the like.
  • the cross-device operation flow of the widget of a video application includes:
  • the smart watch sends a control event triggered by the rotation operation to the mobile phone.
  • the control event can be a control event that is triggered by rotating the knob by 1° and drives the playback progress bar to change by 0.5.
  • the mobile phone After the mobile phone receives the control event, it triggers the video application in the mobile phone to adjust the playback progress, completes the change of the playback progress bar, and sends the interface refresh data after the playback progress adjustment to the smart watch.
  • the smart watch After receiving the interface refresh data, the smart watch refreshes the widget of the video application based on the interface refresh data, so as to refresh the display interface of the widget of the video application to the display interface after the playback progress is adjusted.
  • a widget of a map application is added to the smart watch through a mobile phone, and the widget of the map application added to the smart watch is the navigation interface shown in (b) of FIG. 9 .
  • the user can quickly view the navigation information through the widget of the map application added to the smart watch.
  • the widget of the map application can also be refreshed according to a specified strategy, such as periodic refresh, so as to display the latest navigation interface to the user.
  • the cross-device operation flow of the widget of the map application includes:
  • the map application in the mobile phone After the map application in the mobile phone starts to navigate, it periodically sends the interface refresh data of the widget of the map application to the smart watch, that is, periodically sends the refreshed navigation data to the smart watch.
  • the map application in the mobile phone is refreshed every 1 second, and the interface refresh data of the widget of the map application is sent to the smart watch.
  • the smart watch After receiving the interface refresh data, the smart watch refreshes the widget of the map application based on the interface refresh data to refresh the display interface of the widget of the map application to the latest navigation interface, thereby completing the refresh of the navigation interface.
  • widgets of the above-mentioned third-party applications such as music applications, video applications, and map applications can usually only be added to the mobile phone, occupying the display space of the mobile phone desktop. If the user wants to implement the widget-related functions of the above-mentioned third-party application, he needs to take out the mobile phone, unlock the mobile phone, and find the widget of the third-party application by sliding the desktop several times before operating the related functions of the widget.
  • the currently installed widgets on smart watches are usually fixed and customized widgets for smart watches. The functions and display data of the installed widgets are relatively simple. For other widgets that can be added to a large number of third-party applications on mobile phones, smart watches do not support widgets. Added, flexible lower.
  • the widgets of the above target applications can be added to the smart watch through the mobile phone, so that the widgets of third-party applications can be arbitrarily added to the smart watch, which expands the widget adding method and enhances the functionality of a smart watch.
  • the user can view and operate the added widget by lifting the smart watch, which facilitates the user's operation.
  • the smart watch For example, in the scene of driving a vehicle, if you use the map application of the mobile phone to view the navigation information, you need to fix the mobile phone on the bracket of the vehicle for viewing; in the scene of riding, if you use the map application of the mobile phone to view the navigation information, because A mobile phone holder is rarely installed on a bicycle, so it is necessary to hold a mobile phone for viewing while riding.
  • the above method of viewing through a mobile phone is very inconvenient for users, and there are potential safety hazards.
  • a widget of a map application can be added to a smart watch through a mobile phone.
  • the map application added in the smart watch can be added to the smart watch.
  • the widget can quickly view the navigation information, which facilitates the user's operation and reduces security risks to a certain extent.
  • the widget of the target application can be added to the second terminal through the first terminal, which realizes the cross-device addition of the widget, so that the second terminal can also add the widget of the target application without installing the target application. , thereby reducing the consumption of storage resources and processing resources of the second terminal by the installation target application, and expanding the way of adding widgets.
  • the application data of the target application in the first terminal can also be quickly viewed through the widget added by the second terminal, which avoids the target application or the widget of the target application from affecting the interface display space of the first terminal. occupied.
  • the target application of the first terminal can also be manipulated, such as triggering the relevant functions of the target application in the first terminal, which facilitates the user's operation and expands the usage mode of the widget.
  • FIG. 11 is a schematic flowchart of a widget adding process provided by an embodiment of the present application.
  • the widget adding process includes:
  • Step 1101 The user opens the widget adding interface of the first terminal, and selects the target widget to add the target application based on the widget adding interface.
  • Step 1102 The first terminal searches for a connected device that supports adding a widget function across devices through the cross-device service 14.
  • the widget adding device query interface of the cross-device service 14 can be invoked, and the device adding device query interface can be added through the widget to search for connected devices that support the cross-device adding widget function.
  • Step 1103 The first terminal displays the device identification of the searched device.
  • the device model of the searched device is displayed.
  • Step 1104 Based on the displayed device identification, the user selects the second terminal to which the target widget is to be added from the searched devices.
  • Step 1105 Based on the user's selection operation, the first terminal invokes the widget adding interface of the application widget service 13 to trigger the widget adding process.
  • Step 1106 The first terminal creates an add data record of the target widget by applying the widget service 13, so that the data and control events of the target widget can be sent to the corresponding widget when the widget operation is performed on the target widget later.
  • the addition data record of the target widget may include one or more of the following data: a widget identifier of the target widget, an addition event, an addition time, and the like.
  • Step 1107 The first terminal judges whether the triggered widget adding process is a cross-device adding widget process by applying the widget service 13, and if it is a cross-device adding widget process, obtains interface-related data of the target widget.
  • the first terminal may also display a local addition option for adding the target widget to the first terminal, and the user may also select the local addition option to add the target widget to the second terminal.
  • the triggered widget adding process is the process of adding a widget locally.
  • the first terminal can add the target widget to the first terminal by applying the widget service 13 .
  • the triggered widget addition process is the process of adding a widget across devices.
  • the target widget can be obtained by applying the widget service 13 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 addition request to the second terminal through the cross-device service 14, and the widget addition request carries the interface related data of the target widget, so as 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 Based on the interface-related data of the target widget carried in the widget add request, the second terminal adds the target widget to the second terminal through the desktop launcher 21.
  • the second terminal may send the widget addition request to the desktop launcher 21 .
  • the desktop launcher 21 may add the target widget to the second terminal based on the interface-related data of the target widget carried in the widget addition request.
  • Step 1111 After successfully adding the target widget, 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 second terminal has successfully added the target widget.
  • Step 1112 After receiving the notification of successful addition, the first terminal may store the device information of the second terminal that successfully added the target widget by using 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.
  • FIG. 11 is only an exemplary illustration of a widget adding process provided by an embodiment of the present application, and does not limit the widget adding process. It should be understood that the process of the widget adding process may also be other processes, which are not limited in this embodiment of the present application.
  • FIG. 12 is a schematic flowchart of a widget refresh process provided by an embodiment of the present application.
  • the widget refresh process includes:
  • Step 1201 The user clicks the control in the target widget added by the second terminal to trigger the related function.
  • Step 1202 The second terminal detects whether the first terminal where the target application corresponding to the target widget is located is connected to the second terminal based on the user's click operation.
  • step 1203 is performed.
  • Step 1203 The second terminal sends the control event of the target widget triggered by the user's click operation 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 can monitor the control event of the target widget, and if the control event of the target widget is monitored, execute the service corresponding to the control event.
  • the target application 11 can 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, a refresh message is sent to the application widget service 13 through the widget service management 12 .
  • Step 1206 The application widget service 13 acquires the interface refresh data of the target widget based on the refresh message.
  • 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, it can obtain the interface refresh data of the target widget through the application widget service 13 .
  • the interface refresh data of the target widget may be sent to the application widget service 13 of the target application 11 .
  • the interface refresh 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 refresh data of the target widget to the second terminal through the cross-device service 14.
  • the first terminal may first determine whether the second terminal to which the target widget is added is connected to the first terminal. If not connected, do not respond. If connected, the interface refresh data of the target widget is sent to the second terminal through the cross-device service 14 .
  • Step 1208 The second terminal refreshes the display interface of the target widget based on the received interface refresh data of the target widget.
  • the second terminal may refresh the display interface of the target widget through the widget display frame of the desktop launcher 21 .
  • 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 are not limited in this embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of an apparatus for adding widgets provided by an embodiment of the present application.
  • the apparatus may be implemented by software, hardware, or a combination of the two as part or all of a computer device, and the computer device may be the one shown in FIG. 1 .
  • the first terminal 10 Referring to FIG. 13 , the apparatus includes: a first determining module 1301 , a first acquiring module 1302 and a first sending module 1303 .
  • a first determining module configured to perform step 1001 in the above-mentioned embodiment of FIG. 10 ;
  • a first acquisition module configured to perform step 1002 in the above-mentioned embodiment of FIG. 10 ;
  • the first sending module is configured to perform step 1003 in the above-mentioned embodiment of FIG. 10 .
  • the device also includes:
  • a display module configured to display terminal identifiers of one or more terminals, where the one or more terminals have established connections with the first terminal;
  • the second determining module is configured to, if a selection operation of any terminal identifier in the displayed one or more terminal identifiers is detected, determine that an instruction to add the target widget to the terminal identified by the selected terminal identifier is received, The terminal identified by the selected terminal identifier is the second terminal.
  • the device also includes:
  • a search module configured to search for a terminal that has established a connection with the first terminal
  • the third determining module is configured to determine a terminal that supports adding a widget function across devices from the searched terminals, and obtain the one or more terminals.
  • the terminal supporting adding a widget function across devices refers to a terminal that can be sent based on other devices.
  • the widget adds a terminal that requests to add a 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 the layout of the target widget, the interface size of the target widget, and the type, location, icon, and color of each control on the target widget; the The widget control data is used to indicate one or more of the widget objects and widget events of each widget on the target widget.
  • the device also includes:
  • the trigger module is configured to execute step 1006 in the above embodiment of FIG. 10 .
  • the device also includes:
  • the second acquisition module is configured to perform step 1007 in the above-mentioned embodiment of FIG. 10;
  • the second sending module is configured to perform step 1008 in the above embodiment of FIG. 10 .
  • the widget of the target application can be added to the second terminal through the first terminal, which realizes the cross-device addition of the widget, so that the second terminal can also add the widget of the target application without installing the target application. , thereby reducing the consumption of the storage resources and processing resources of the second terminal by the installation target application, and expanding the way of adding widgets.
  • the application data of the target application in the first terminal can also be quickly viewed through the widget added by the second terminal, which avoids the target application or the widget of the target application from affecting the interface display space of the first terminal. occupied.
  • the target application of the first terminal can also be manipulated, such as triggering the relevant functions of the target application in the first terminal, thereby facilitating the user's operation and expanding the usage mode of the widget.
  • FIG. 14 is a schematic structural diagram of another apparatus for adding widgets provided by an embodiment of the present application.
  • the apparatus may be implemented by software, hardware, or a combination of the two as part or all of a computer device, and the computer device may be the one shown in FIG. 1 . the second terminal 20.
  • the apparatus includes: a receiving module 1401 and an adding module 1402 .
  • the receiving module 1401 and the adding module 1402 are configured to perform step 1004 in the above embodiment of FIG. 10 .
  • a display interface of the target widget is created on the display interface of the second terminal.
  • the entity view is added to the display area to obtain the 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 the layout of the target widget, the interface size of the target widget, and the type, location, icon, and color of each control on the target widget; the The widget control data is used to indicate one or more of the widget objects and widget events of each widget on the target widget.
  • the device also includes:
  • the sending module is configured to execute step 1005 in the above embodiment of FIG. 10 .
  • the sending module is used to:
  • a control event corresponding to the first control is determined based on the interface-related data, and the first control is any control of the target widget;
  • the device also includes:
  • the refresh module is configured to perform step 1009 in the above-mentioned embodiment of FIG. 10 .
  • the widget of the target application can be added to the second terminal through the first terminal, which realizes the cross-device addition of the widget, so that the second terminal can also add the widget of the target application without installing the target application. , thereby reducing the consumption of the storage resources and processing resources of the second terminal by the installation target application, and expanding the way of adding widgets.
  • the application data of the target application in the first terminal can also be quickly viewed through the widget added by the second terminal, which avoids the target application or the widget of the target application from affecting the interface display space of the first terminal. occupied.
  • the target application of the first terminal can also be manipulated, such as triggering the relevant functions of the target application in the first terminal, thereby facilitating the user's operation and expanding the usage mode of the widget.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, special purpose computer, computer network or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server or data center by wired (eg coaxial cable, optical fiber, Digital Subscriber Line, DSL) or wireless (eg: 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 integrated.
  • the available media may be magnetic media (eg: floppy disk, hard disk, magnetic tape), optical media (eg: Digital Versatile Disc (DVD)) or semiconductor media (eg: Solid State Disk (SSD)) Wait.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

一种添加widget的方法、装置及计算机可读存储介质,属于终端技术领域。方法包括:第一终端(10)确定待添加的目标widget,目标widget是与已安装的目标应用关联(1001);若接收到将目标widget添加至第二终端(20)的指令,则获取目标widget的界面相关数据,界面相关数据用于指示目标widget的显示界面(1002);向第二终端(20)发送widget添加请求,widget添加请求携带该界面相关数据(1003),以请求第二终端(20)基于该界面相关数据在第二终端(20)中添加目标widget。通过第一终端(10)来为第二终端(20)添加目标应用的widget,实现了widget的跨设备添加,使得第二终端(20)在不安装目标应用的情况下,也能够添加目标应用的widget,节省了第二终端(20)的存储资源和处理资源,扩展了widget的添加方式。

Description

添加widget的方法、装置及计算机可读存储介质
本申请要求于2020年12月07日提交国家知识产权局、申请号为202011419518.0、申请名称为“添加widget的方法、装置及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,特别涉及一种添加widget的方法、装置及计算机可读存储介质。
背景技术
微件(widget)是一种窗口小部件,可以添加在终端的某个显示界面上使用,如可以添加在桌面上来使用,从而增加桌面的功能性。比如,widget可以是时钟、备忘录或天气预报等。另外,widget还可以与某个应用关联,与应用关联的widget具有应用的部分功能。比如,一个应用可以提供一个或多个widget。用户直接与应用的widget进行交互即可实现该应用的部分功能,从而方便了用户的操作。
相关技术中,终端中已安装的应用才提供有关联widget的添加入口,也即是,若用户想要在终端中添加某个应用的widget,则需要先在终端中安装该应用,之后才能添加该应用的widget。但是,应用的安装数据将会占用终端较多的存储资源,且应用的运行也会耗费终端较多的处理资源,因此对于智能手表等终端来说,如果先安装应用再添加应用的widget,会影响终端的性能。
发明内容
本申请提供了一种添加widget的方法、装置及计算机可读存储介质,可以解决相关技术中终端添加应用的widget耗费存储资源和处理资源的问题。所述技术方案如下:
第一方面,提供了一种添加widget的方法,所述方法包括:确定待添加的目标widget,目标widget与已安装的目标应用关联;若接收到将目标widget添加至第二终端的指令,则获取目标widget的界面相关数据,向第二终端发送widget添加请求,widget添加请求携带目标widget的界面相关数据,用于请求第二终端基于该界面相关数据在第二终端中添加目标widget。
本申请实施例中,可以通过第一终端来为第二终端添加目标应用的widget,实现了widget的跨设备添加,使得第二终端在不安装目标应用的情况下也能够添加目标应用的widget,从而减少了安装目标应用对第二终端的存储资源和处理资源的耗费,扩展了widget的添加方式。
其中,目标应用可以为第一终端安装的任一应用,且目标应用关联有一个或多个widget。目标widget可以为目标应用的任一widget。目标widget具有目标应用的部分功能,目标widget的显示界面包括与目标应用相关的部分数据和/或控件。目标widget 中的控件能够触发目标应用的某些功能。
比如,目标应用可以为音乐应用、视频应用或地图应用等,当然也可以为能够提供widget的其他应用。音乐应用的widget可以为音乐应用的音乐播放界面;视频应用的widget可以为视频应用的视频播放界面;地图应用的widget可以为地图应用的导航界面等。应理解,目标widget还可以为与目标应用关联的其他显示界面,本申请实施例对此不作限定。
目标widget界面相关数据用于指示目标widget的显示界面。目标widget的界面相关数据可以包括widget显示数据和widget控制数据中的一种或多种。
widget显示数据用于指示目标widget的布局、目标widget的界面大小、目标widget上各个控件的类型、位置、图标、颜色中的一种或多种。目标widget的布局用于指示目标widget的结构,比如用于指示目标widget中包括哪些数据和控件等。作为一个示例,widget显示数据包括目标widget的布局文件、用于配置目标widget的界面大小的配置文件、用于配置目标widget上各个控件的类型和位置的配置文件、目标widget上各个控件的图标文件和颜色定义文件中的一种或多种。
widget控制数据用于指示目标widget上各个控件的控件对象、控件事件中的一种或多种。控件的控件事件包括控件被触发的响应事件。作为一个示例,widget控制数据包括用于配置目标widget上各个控件的控件对象的配置文件,以及用于配置目标widget上各个控件的控件事件的配置文件中的一种或多种。作为一个示例,widget控制数据可以通过定义的Remount View对象进行配置。Remount View对象可以包含目标widget上各个控件的控件对象和控件事件中的一种或多种。
需要说明的是,待添加的目标widget可以由终端默认设置,也可以由用户选择得到。比如,第一终端可以显示一个或多个widget标识,用户可以从这一个或多个widget标识选择一个widget标识,响应于用户的选择操作,第一终端即可将用户选择的widget标识所标识的widget确定为待添加的widget。
作为一个示例,若检测到widget添加操作,则第一终端可以显示widget添加界面,widget添加界面包括一个或多个widget标识。若检测到对widget添加界面中任一widget标识的选择操作,则将选择的widget标识所标识的widget确定为待添加的widget。
其中,widget添加操作可以为点击操作、滑动操作、语音操作或手势操作等。比如,widget添加操作可以为长按主界面的空白区域的操作,或者为点击窗口小工具的操作等,本申请实施例对此不作限定。其中,窗口小工具用于触发添加widget。
在一种可能的实现方式中,第一终端在确定待添加的目标widget之后,还可以显示一个或多个终端的终端标识。若检测到对显示的一个或多个终端标识中任一终端标识的选择操作,则确定接收到将目标widget添加至选择的终端标识所标识的终端的指令,选择的终端标识所标识的终端为第二终端。
其中,一个或多个终端为已与第一终端建立连接的终端。比如,一个或多个终端为已与第一终端建立近距离无线通信连接的终端,如通过蓝牙或WIFI等与第一终端建立近距离无线通信连接的终端。
可选地,一个或多个终端为已与第一终端建立连接,且支持跨设备添加widget功 能的终端。其中,支持跨设备添加widget功能的终端是指能够基于其他设备发送的widget添加请求添加widget的终端。
作为一个示例,第一终端在确定待添加的目标widget之后,可以先搜索已与第一终端建立连接的终端,然后从搜索到的终端中确定支持跨设备添加widget功能的终端,得到一个或多个终端,再显示这一个或多个终端的终端标识。
作为一个示例,第一终端向第二终端发送widget添加请求之前,可以先对目标widget的界面相关数据进行打包处理,再向第二终端发送widget添加请求,该widget添加请求携带打包处理后的界面相关数据。
在一种可能的实现方式中,第一终端在向第二终端发送widget添加请求之后,若接收到第二终端发送的目标widget的控件事件,还可以触发目标应用执行控件事件对应的业务。
也即是,第二终端可以基于添加的目标widget,对第一终端中的目标应用进行操控,从而通过添加的widget实现了目标应用的跨设备操控,提高了widget的灵活性。
其中,目标widget的控件事件可以由针对第二终端中添加的目标widget的widget操作触发。widget操作是指针对目标widget的操作,用于触发目标widget的控件事件。比如,widget操作可以是对目标widget中任一控件的触发操作,如对目标widget中任一控件的点击操作或滑动操作等。或者,widget操作也可以是在第一终端显示目标widget的过程中,对第一终端的物理按键的触发操作,或对第一终端的旋钮的旋转操作等。当然,widget操作也可以为其他针对widget的操作,如语音操作或手势操作等,本申请实施例对此不作限定。
在一种可能的实现方式中,第一终端在目标应用执行该控件事件对应的业务之后,若基于目标应用执行的业务确定目标widget需要进行界面刷新,则还可以获取目标widget的界面刷新数据,向第二终端发送widget刷新请求,widget刷新请求携带该界面刷新数据,以请求第二终端基于该界面刷新数据对目标widget的显示界面进行刷新。其中,该界面刷新数据用于指示目标widget刷新后的显示界面。
如此,可以通过第一终端,对第二终端中的目标widget进行刷新,从而可以实现widget跨设备刷新,进一步提高了widget的灵活性。
第二方面,提供了一种添加widget的装置,所述添加widget的装置具有实现上述第一方面中添加widget的方法行为的功能。所述添加widget的装置包括至少一个模块,所述至少一个模块用于实现上述第一方面所提供的添加widget的方法。
第三方面,提供了一种添加widget的装置,所述添加widget的装置的结构中包括处理器和存储器,所述存储器用于存储支持添加widget的装置执行上述第一方面所提供的添加widget的方法的程序,以及存储用于实现上述第一方面所述的添加widget的方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序。所述添加widget的装置还可以包括通信总线,所述通信总线用于在所述处理器与所述存储器之间建立连接。
第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的添加widget的方 法。
第五方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的添加widget的方法。
上述第二方面、第三方面、第四方面和第五方面所获得的技术效果与上述第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。
第六方面,提供了一种添加widget的方法,所述方法包括:接收第一终端发送的widget添加请求,widget添加请求携带目标widget的界面相关数据,该界面相关数据用于指示所述目标widget的显示界面,目标widget与第一终端安装的目标应用关联;基于该界面相关数据,在第二终端中添加目标widget。
本申请实施例中,可以通过第一终端来为第二终端添加目标应用的widget,实现了widget的跨设备添加,使得第二终端在不安装目标应用的情况下也能够添加目标应用的widget,从而减少了安装目标应用对第二终端的存储资源和处理资源的耗费,扩展了widget的添加方式。
第一终端可以基于该界面相关数据,在第二终端的显示界面中添加目标widget。在第二终端的显示界面中添加目标widget后,可以在第二终端的显示界面中显示目标widget的显示界面。其中,目标widget的显示界面可以占据第二终端的显示界面的全部或部分区域,本申请实施例对此不作限定。
其中,用于添加目标widget的显示界面可以由第二终端默认设置,也可以由用户选择得到。比如,在基于该界面相关数据,在第二终端中添加目标widget之前,可以基于用户的界面选择操作,确定待添加目标widget的目标显示界面,然后基于该界面相关数据,在目标显示界面中添加目标widget。
需要说明的是,该界面选择操作可以为点击操作、滑动操作、语音操作或手势操作等,本申请实施例对此不作限定。比如,该界面选择操作可以在向左或向右滑动显示界面后,对当前显示界面的空白区域的长按操作,或者对当前显示界面中的widget添加入口的点击操作等。
在一种可能的实现方式中,基于该界面相关数据,在第二终端中添加目标widget的操作包括:基于该界面相关数据,在第二终端的显示界面上创建目标widget的显示界面,以实现在第二终端中添加目标widget。
作为一个示例,基于该界面相关数据,在第二终端的显示界面上创建目标widget的显示界面的操作包括:创建widget视图对象,以及在第二终端的显示界面上创建widget视图对象的显示区域;创建与该界面相关数据对应的实体视图;将该实体视图添加在widget视图对象的显示区域中,得到目标widget的显示界面,从而完成目标widget在第二终端的显示。
其中,widget视图对象可以为APP Widget Host View对象,实体视图可以为实体View。第二终端可以根据该界面相关数据中的widget显示数据,创建与该界面相关数据对应的实体视图。
在一种可能的实现方式中,第二终端在基于该界面相关数据,在第二终端中成功添加目标widget之后,还可以向第一终端发送添加成功通知,该添加成功通知用于指 示第二设备已成功添加目标widget。
第一终端接收到该添加成功通知之后,还可以存储成功添加目标widget的第二终端的设备信息。比如,通过第一终端的应用widget服务存储成功添加目标widget的第二终端的设备信息。示例地,可以通过第一终端的应用widget服务,将成功添加目标widget的第二终端的设备信息存储在widget数据库中。
第一终端接收到该添加成功通知之后,还可以存储成功添加目标widget的第二终端的设备信息。比如,通过第一终端的应用widget服务存储成功添加目标widget的第二终端的设备信息。示例地,可以通过第一终端的应用widget服务,将成功添加目标widget的第二终端的设备信息存储在widget数据库中。
另外,在第二终端中添加目标widget之后,用户还可以通过对第二终端中的目标widget进行操作,来控制第一终端中的目标应用,也即是,能够实现目标widget的跨设备操作。
在一种可能的实现方式中,基于该界面相关数据,在第二终端中添加目标widget之后,第二终端若检测到针对目标widget的widget操作,则向第一终端发送该widget操作触发的目标widget的控件事件。
其中,widget操作是指针对目标widget的操作,用于触发目标widget的控件事件。比如,widget操作可以是对目标widget中任一控件的触发操作,如对目标widget中任一控件的点击操作或滑动操作等。或者,widget操作也可以是在第一终端显示目标widget的过程中,对第一终端的物理按键的触发操作,或对第一终端的旋钮的旋转操作等。当然,widget操作也可以为其他针对widget的操作,如语音操作或手势操作等,本申请实施例对此不作限定。
作为一个示例,若检测到针对添加的目标widget的widget操作,则向第一终端发送该widget操作触发的目标widget的控件事件包括:若检测到对目标widget的第一控件的触发操作,则基于该界面相关数据确定第一控件对应的控件事件;将第一控件对应的控件事件发送给第一终端。
其中,第一控件的触发操作可以为对第一控件的点击操作或滑动操作,也可以为语音操作或手势操作等,本申请实施例对此不作限定。第一控件为目标widget的任一控件。
作为一个示例,若基于添加的目标widget检测到指定操作,第二终端可以触发一个类似广播的消息,然后将该消息发送给第一终端。其中,该消息携带指定操作触发的目标widget的控件事件。
在一种可能的实现方式中,在向第一终端发送所述指定操作触发的目标widget的控件事件之后,若接收第一终端发送的widget刷新请求,第二终端还可以基于widget刷新请求携带的目标widget的界面刷新数据,对目标widget的显示界面进行刷新。
其中,widget刷新请求携带目标widget的界面刷新数据,该界面刷新数据用于指示目标widget刷新后的显示界面。该界面刷新数据可以包括widget显示数据和widget控制数据中的一种或多种。
也即是,第二终端可以基于添加的目标widget,对第一终端中的目标应用进行操 控,从而通过添加的widget实现了目标应用的跨设备操控,提高了widget的灵活性。在第二终端对第一终端中的目标应用进行操控之后,第一终端还可以根据第二终端的操控,对第一终端中添加的目标widget进行刷新,从而可以实现widget跨设备刷新,进一步提高了widget的灵活性。
第七方面,提供了一种添加widget的装置,所述添加widget的装置具有实现上述第六方面中添加widget的方法行为的功能。所述添加widget的装置包括至少一个模块,所述至少一个模块用于实现上述第六方面所提供的添加widget的方法。
第八方面,提供了一种添加widget的装置,所述添加widget的装置的结构中包括处理器和存储器,所述存储器用于存储支持添加widget的装置执行上述第六方面所提供的添加widget的方法的程序,以及存储用于实现上述第六方面所述的添加widget的方法所涉及的数据。所述处理器被配置为用于执行所述存储器中存储的程序。所述添加widget的装置还可以包括通信总线,所述通信总线用于在所述处理器与所述存储器之间建立连接。
第九方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第六方面所述的添加widget的方法。
第十方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第六方面所述的添加widget的方法。
上述第七方面、第八方面、第九方面和第十方面所获得的技术效果与上述第六方面中对应的技术手段获得的技术效果近似,在这里不再赘述。
第十一方面,提供了一种添加widget的系统,包括:第一终端和第二终端,其中,所述第一终端用于上述第一方面所述的添加widget的方法;所述第二终端用于执行上述第二方面所述的添加widget的方法。
附图说明
图1是本申请实施例提供的一种添加widget的系统示意图;
图2是本申请实施例提供的一种终端的结构示意图;
图3是本申请实施例提供的一种终端的软件结构框图;
图4是本申请实施例提供的一种添加widget的系统的系统架构图;
图5是本申请实施例提供的一种跨设备添加widget的图形用户界面;
图6是本申请实施例提供的另一种跨设备添加widget的图形用户界面;
图7是本申请实施例提供的一种音乐应用以及音乐应用的widget的图形用户界面示意图;
图8是本申请实施例提供的一种视频应用以及视频应用的widget的图形用户界面示意图;
图9是本申请实施例提供的一种地图应用以及地图应用的widget的图形用户界面示意图;
图10是本申请实施例提供的一种添加widget的方法流程图;
图11是本申请实施例提供的一种widget添加过程的流程示意图;
图12是本申请实施例提供的一种widget刷新过程的流程示意图;
图13是本申请实施例提供的一种添加widget的装置的结构示意图;
图14是本申请实施例提供的另一种添加widget的装置的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。
本申请实施例提供的方法应用于添加widget的系统中。请参考图1,图1是本申请实施例提供的一种添加widget的系统示意图。如图1所示,该系统包括第一终端10和第二终端20,第一终端10和第二终端20可以通过有线网络或有线网络进行连接。
其中,第一终端10安装有目标应用,目标应用具有一个或多个widget,以供用户进行添加。目标应用可以为任一能够提供widget的应用,如音乐应用、视频应用或导航应用等,本申请实施例对此不作限定。第二终端20为需要添加目标widget的终端,目标widget为目标应用的widget。
本申请实施例中,当用户想要为第二终端20添加目标应用的widget时,可以通过第一终端10为第二终端20添加目标应用的widget,使得第二终端20在未安装目标应用的情况下,也能够成功添加目标应用的widget。如此,可以节省第二终端20的存储资源和处理资源,避免第二终端20需要先安装目标应用才能添加目标应用的widget,扩展了widget的添加方式,提高了灵活性,能够满足用户的多样化需求。
也即是,本申请实施例可以实现通过一个设备来为另一个设备添加widget。为了便于说明,本申请实施例将通过一个设备来为另一个设备添加widget称为跨设备添加widget。
其中,第一终端10和第二终端20可以为手机、平板电脑、可穿戴设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等终端,可穿戴设备可以为智能手表或智能手环等,本申请实施例对第一终端10和第二终端20的类型不作限定。图1仅是以第一终端10为手机、第二终端20为智能手表为例,第一终端10和第二终端20还可以为其他类型。
作为一个示例,第一终端10为硬件性能较高的终端,如手机、平板电脑、笔记本电脑或计算机等。第二终端10为硬件性能较低的终端,如AR/VR设备、车载设备或可穿戴设备等。如此,可以在硬件性能较高的终端中安装目标应用,然后通过硬件性 能较高的终端为硬件性能较低的终端跨设备添加目标应用的widget。
比如,第一终端10为手机,第二终端20为智能手表,通过手机来为智能手表添加目标应用的widget。由于智能手表的硬件性能不像手机那么高,如果安装了目标应用,目标应用的安装数据将会占用智能手表较多的存储资源,且目标应用的运行也会耗费智能手表较多的处理资源,影响智能手表的性能,因此为了节省智能手表的存储资源和处理资源,可以通过手机来为智能手表添加目标应用的widget。
需要说明的是,目标widget具有目标应用的部分功能。也即是,目标widget是目标应用的一种快捷方式,其包括目标应用的部分显示界面和部分控制功能。目标widget可以被添加到第二终端20的某一显示界面中。目标widget被添加到第二终端20的某一显示界面后,目标widget的显示界面占据第二终端20的显示界面的全部或部分区域。目标widget的显示界面包括目标应用的相关数据和/或控件。目标widget中的控件用于触发目标应用的某些功能。
在第二终端20中添加目标widget后,用户还可以通过对第二终端20中的目标widget进行操作,来控制第一终端10中的目标应用。比如,用户可以通过点击第二终端20中的目标widget的控件,来触发第一终端10中的目标应用执行相应的功能,实现对目标应用的远程操控。
接下来,对终端的结构进行介绍。请参考图2,图2是本申请实施例提供的一种终端100的结构示意图。终端100可以为上述图1中的第一终端10或第二终端20。其中,第一终端10用于提供业务的主要运行系统资源,可以包括处理器、存储器和网络服务等。第二终端10具有显示屏幕,以及能够接收各类输入事件,输入事件包括但不限于屏幕触控、按钮点击、旋钮旋转等操作事件。
如图2所示,终端100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请实施例示意的结构并不构成对终端100的具体限定。在本申请另一些实施例中,终端100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独 立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是终端100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现终端100的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现终端100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现终端100的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为终端100充电,也可以用于终端100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他终端,例如AR设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对终端100的结构限定。在本申请另一些实施例中,终端100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过终端100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为终端供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
终端100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。终端100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在终端100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处 理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在终端100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,终端100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得终端100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
终端100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,终端100可以包括1个或N个显示屏194,N为大于1的正整数。
终端100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传 递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,终端100可以包括1个或N个摄像头193,N为大于1的正整数。
在一些可能的情况中,摄像头193可以作为手势采集模块来采集用户的手势操作。摄像头193可以包括前置摄像头和/或后置摄像头。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当终端100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。终端100可以支持一种或多种视频编解码器。这样,终端100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现终端100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展终端100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行终端100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
终端100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。终端100的按键190可以包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM卡。
此外,终端100还包括各种不同传感器,例如,压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。陀螺仪传感器180B可以用于确定终端100的运动姿态。气压传感器180C用于测量气压。磁传感器180D包括霍尔传感器。加速度传感器180E可检测终端100在各个方向上(一般为三轴)加速度的大小。距离传感器180F,用于测量距离。终端100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,终端100可以利用距离传感器180F测距以实现快速对焦。接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。环境光传感器180L用于感知环境光亮度。终端100可以根据感知的环境光亮度自适应调节显示屏194亮度。指纹传感器180H用于采集指纹。终端100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。骨传导传感器180M可以获取振动信号。温度传感器180J,用于检测温度。例如,温度传感器180J可以是非接触式红外温度传感器,该非接触式红外温度传感器可以利用红外线来测量物体的温度。
终端100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明终端100的软件结构。
图3是本申请实施例提供的一种终端100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。如图3所示,应用程序包可以包括视频,相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层还可以称为系统服务框架层。应用程序框架层包括一些预先定义的函数。如图3所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供终端100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文 件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,终端振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),二维图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
二维图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。例如传感器驱动用于调用红外温度传感器,摄像头驱动可以启动摄像头采集图像。
接下来,结合上述图3对添加widget的系统的系统架构进行介绍。请参考图4,图4是本申请实施例提供的一种添加widget的系统的系统架构图。
如图4所示,第一终端10包括应用程序层和应用程序框架层,应用程序框架层也称系统服务框架层。第一终端10的应用程序层包括目标应用11和应用widget管理12。第一终端10的应用程序框架层包括应用widget服务13和跨设备服务14。第二终端20也包括应用程序层和应用程序框架层。第二终端20的应用程序层包括桌面启动器21。第二设备20的应用程序框架层包括跨设备服务22。
目标应用11可以为任一应用,负责实现应用业务功能。比如,目标应用11负责执行目标应用11的各类widget业务。
作为一个示例,目标应用11具有各类widget业务请求接口,目标应用11可以通过调用各类widget业务请求接口,来执行各类widget业务。比如,若目标应用11接收到目标widget的控件事件,则可以调用与该控件事件对应的widget业务请求接口,通过与该控件事件对应的widget业务请求接口,来执行与该控件事件对应的业务。
应用widget管理12负责应用端的widget相关业务管理。比如,负责监听目标widget的各类控件事件,将控件事件通知给目标应用11。或者,负责在确定目标widget的显示界面需要刷新时,触发目标widget的刷新流程。或者,负责与目标应用11进行业务交互等。应用widget管理12还可以称为应用widget提供者(APP widget provider)。示例的,应用widget管理12集成在目标应用11中。
作为一个示例,应用widget管理12包括事件广播接收器、界面刷新接口以及与应用业务交互接口等。其中,事件广播接收器用于监听目标widget的各类控件事件。应用widget管理12可以将通过事件广播接收器监听到的目标widget的控件事件通知给目标应用11。界面刷新接口用于触发界面刷新流程。比如,界面刷新接口用于调用应用widget服务13,通过应用widget服务13获取目标widget的界面刷新数据,该界面刷新数据用于指示目标widget刷新后的显示界面。应用业务交互接口用于与目标应用11进行业务交互。
应用widget服务(APP widget service)13负责系统侧关于widget的相关业务管理。比如,在需要将目标widget添加至第二终端20时,获取目标widget的界面相关数据,该界面相关数据用于指示目标widget的显示界面。或者,在确定目标widget的显示界面需要进行刷新时,获取目标widget的界面刷新数据。或者,负责记录widget的相关数据等。
作为一个示例,应用widget服务13包括widget添加接口和widget刷新接口。widget添加接口用于获取目标widget的界面相关数据。widget刷新接口用于获取目标widget的界面刷新数据。可选地,应用widget服务13还具有widget数据记录管理功能,widget数据记录管理功能用于记录widget的相关数据,比如记录widget添加数据或widget刷新数据等。
示例地,若第一终端10确定目标widget的显示界面需要进行刷新,则可以调用应用widget管理12的界面刷新接口,通过调用的界面刷新接口向应用widget服务13发送刷新消息。应用widget服务13接收到刷新消息后,调用应用widget服务13的widget刷新接口,通过调用的widget刷新接口,获取目标widget的界面刷新数据。
跨设备服务14负责跨设备信息数据传输。比如,负责向第二终端20发送widget添加请求或widget刷新请求。或者,负责接收第二终端20发送的目标应用的widget的控件事件等。另外,跨设备服务14还可以对目标widget的界面相关数据或界面刷新数据进行打包处理,或者对与第一终端10建立连接的设备或者widget添加设备进行查询,以查询与第一终端10建立连接的设备或者widget添加设备的设备信息,或者设备是否支持跨设备添加widget功能等。其中,设备信息包括设备类型、设备的软件版本或系统版本等。支持跨设备添加widget功能是指能够基于其他设备发送的widget添加请求来添加widget。widget添加设备是指跨设备添加widget的设备。
作为一个示例,跨设备服务14包括widget添加接口、widget刷新接口和widget控件事件传输接口。widget添加接口用于向第二终端20发送widget添加请求,widget添加请求携带目标widget的界面相关数据。可选地,widget添加接口还用于对目标widget的界面相关数据进行打包处理,以向第二终端20发送携带打包处理后的界面相关数据的widget添加请求。widget刷新接口用于向第二终端20发送widget刷新请求, widget刷新请求携带目标widget的界面刷新数据。可选地,widget刷新接口还用于对目标widget的界面刷新数据进行打包处理,以向第二终端20发送携带打包处理后的界面刷新数据的widget刷新请求。widget控件事件传输接口用于传输目标widget的控件事件。比如,接收第二终端20发送的目标widget的控件事件,或者将目标widget的控件事件发送给应用widget管理12。
可选地,跨设备服务14还包括widget添加设备查询接口,widget添加设备查询接口用于对建立连接的设备或widget添加设备进行查询,以查询建立连接的设备或widget添加设备的设备信息。
桌面启动器21负责widget的显示框架以及widget的控件事件的处理传输。示例地,桌面启动器21可以为类似安卓系统的桌面启动器(Launcher)。
比如,桌面启动器21可以基于第一终端10发送的目标widget的界面相关数据,在第二终端20的显示界面上创建目标widget的显示界面。或者,基于第一终端10发送的目标widget的界面刷新数据,对目标widget的显示界面进行刷新。或者,若检测到对目标widget的指定操作,则向跨设备服务22发送目标widget的控件事件。示例地,桌面启动器21包括widget界面刷新接口,widget界面刷新接口用于对widget的显示界面进行刷新。
跨设备服务22负责跨设备信息数据传输。比如,负责接收第一终端10发送的
widget添加请求或widget刷新请求。或者,负责向第一终端10发送目标应用的widget的控件事件等。
作为一个示例,跨设备服务22包括widget接收接口、widget界面刷新接口和widget控件事件传输接口。其中,widget接收接口用于接收widget添加请求,将widget添加请求发送给桌面启动器21,以指示桌面启动器21创建目标widget的显示界面。widget界面刷新接口用于接收widget刷新请求,将widget刷新请求发送给桌面启动器21,以指示桌面启动器21对目标widget的显示界面进行刷新。widget控件事件传输接口用于传输目标widget的控件事件。比如,将目标widget的控件事件发送给第一终端10。
本申请实施例中,为了方便用户通过第一终端为第二终端添加widget,第一终端还可以为用户提供为其他设备添加widget的操作界面,以便用户通过该操作界面,方便地为其他设备添加widget。其中,该操作界面可以包括一个或多个widget标识,用户可以从这一个或多个widget标识中选择待添加的目标widget的widget标识。其中,widget标识用于唯一标识widget,可以为widget的名称、身份标识号(identity document,ID)或图标等,本申请实施例对此不作限定。另外,该操作界面还可以包括一个或多个设备的设备标识,用户可以从这一个或多个设备的设备标识中选择想要添加目标widget的第二终端的设备标识,以将目标widget添加至第二终端中。其中,设备标识用于唯一标识对应设备,可以为设备的型号、名称或ID等。该操作界面可以由用户通过widget添加操作触发,该widget添加操作可以为长按主界面等显示界面的空白区域的操作,或者点击设置菜单中添加widget选项的操作等,本申请实施例对此也不作限定。
为了便于理解,本申请以下实施例将以第一终端为手机、第二终端为智能手表为例,结合附图和应用场景,对通过第一终端为第二终端添加widget的过程进行介绍。目前,大多数智能手表具有可以触控的显示屏幕,而且设备体积小、可以长时间佩戴,因此在这类智能手表中添加widget,可以通过添加的widget快速查看信息或实现快捷操作功能。
图5是本申请实施例提供的一种跨设备添加widget的图形用户界面(graphical user interface,GUI)示意图。其中,图5中的(a)图示出了解锁模式下,手机当前输出的界面内容501,该界面内容501显示了多款应用程序(application,App),例如音乐、相机、设置和视频等应用程序。应理解,界面内容501还可以包括其他更多的应用程序,本申请实施例对此不作限定。当用户想要通过手机为其他设备添加widget时,可以通过widget添加操作,触发手机显示widget添加界面,以便用户通过widget添加界面选择想要添加的widget。
如图5中的(a)图所示,用户长按界面内容501中的空白区域,响应于用户的长按操作,手机将显示桌面设置界面。图5中的(b)图示出了桌面设置界面502,桌面设置界面502包括壁纸、窗口小工具、切换效果和桌面设置等设置选项。其中,窗口小工具用于添加widget。如图5中的(b)图所示,用户可以点击窗口小工具选项,响应于用户的点击操作,手机显示widget添加界面。其中,widget添加界面可以包括一个或多个widget标识,用户可以基于这一个或多个widget标识选择想要添加的目标widget。
图5中的(c)图示出了一种widget添加界面503,widget添加界面503包括多个widget的图标,如widget1、widget2和widget3的图标。应理解,widget添加界面503还可以包括其他更多的widget的图标,本申请实施例对此不作限定。用户可以从显示的widget的图标中选择想要添加的widget的图标。如图5中的(c)图所示,用户点击widget2的图标,响应于用户的点击操作,手机显示设备选择界面,设备选择界面显示有可添加的设备的设备标识,用户可以从显示的设备标识中选择想要将widget2添加到的设备的设备标识,以将widget2添加至选择的设备标识所标识的设备中。其中,可添加的设备为已与手机建立连接的设备,或者,已与手机建立连接且支持跨设备添加widget功能的设备。
图5中的(d)图示出了一种设备选择界面504,设备选择界面504包括添加到本地、添加到设备1、添加到设备2和添加到设备3等选项。应理解,设备选择界面504还可以包括其他更多的可添加的设备,本申请实施例对此不作限定。如图5中的(d)图所示,用户点击添加到设备1,响应于用户的点击操作,手机向设备1发送widget添加确认消息,widget添加确认消息可以携带手机的设备信息。设备1接收到widget添加确认消息后,可以显示widget添加询问信息,widget添加询问信息用于提示用户是否同意添加手机中的widget。
图6是本申请实施例提供的另一种跨设备添加widget的图形用户界面示意图。假设设备1为智能手表,在接收到手机发送的widget添加确认消息后,智能手表可以显示如图6中的(a)图所示的widget添加询问界面601。widget添加询问界面601显示有widget添加询问信息:是否同意添加手机的widget,以及同意选项和取消选项。若 用户同意添加手机的widget,则点击同意选项,响应于用户的点击操作,智能手表将向手机发送确认添加消息,该确认添加消息用于指示同意添加手机的widget。
手机接收到智能手表发送的确认添加消息后,即可向智能手表发送widget添加请求,widget添加请求携带widget2的界面相关数据。另外,手机在发送widget添加请求的过程中,还可以显示数据传输信息,数据传输信息用于指示手机正在传输widget2的界面相关数据。图6中的(b)图示出了一种智能手表的数据传输界面602,数据传输界面602显示有数据传输信息:widget数据传输中。
另外,智能手表在接收手机传输的widget数据的过程中,还可以显示数据接收信息,数据接收信息用于指示智能手表正在接收widget2的界面相关数据。图6中的(c)图示出了一种智能手表的数据接收界面603,数据接收界面603显示有数据接收信息:widget数据接收中。智能手表接收完数据后,可以根据接收到的widget2的界面相关数据,在智能手表的某个显示界面中添加widget2。其中,添加widget2的显示界面可以为指定界面,也可以由用户进行选择。
作为一个示例,用户可以通过左右滑动显示界面的方式,来选择想要添加widget2的显示界面。图6中的(d)图示出了一种智能手表的显示界面604,如图6中的(d)图所示,用户可以按照图6中的(d)图所示的方向滑动显示界面,响应于用户的滑动操作,智能手表可以显示其他显示界面。另外,用户选择的显示界面上还可以显示有widget添加入口,用户可以通过触发widget添加入口,来触发智能手表在当前显示界面上添加widget2。比如,widget添加入口可以为图6中的(d)图所示的加号。若用户想要在当前显示界面上添加widget2,用户可以点击图6中的(d)图所示的加号,响应于用户的点击操作,智能手表基于接收到的widget2的界面相关数据,在当前显示界面上添加widget2。图6中的(e)图示出了一种添加widget2后的显示界面605,显示界面605显示有widget2的显示界面。
在智能手表中添加widget2之后,用户还可以通过对智能手表中的widget2进行操作,来控制手机中的目标应用,目标应用是指与widget2关联的应用。比如,可以通过对智能手表中widget2进行操作,触发widget2的控件事件,智能手表将触发的widget2的控件事件发送给手机,手机中的目标应用基于接收的控件事件执行相应的业务,并将业务数据返回给智能手表。
本申请实施例中,通过第一终端为第二终端添加的目标widget是与第一终端安装的目标应用关联的widget,也即是,目标widget可以为第一终端安装的目标应用的任一widget。目标widget具有目标应用的部分功能。
示例地,目标应用可以为音乐应用、视频应用或地图应用等。音乐应用的widget可以为音乐应用的音乐播放界面,用于实现对音乐应用的信息查看和播放控制等。视频应用的widget可以为视频应用的视频播放界面,用于实现对视频应用的信息查看和播放控制等。地图应用的widget可以为地图应用的导航界面,用于实现对导航路线的显示指导功能等。应理解,目标widget还可以为与目标应用关联的其他显示界面,可以具有目标应用的其他相关功能,本申请实施例对此不作限定。
接下来,以通过手机为智能手表中添加目标应用的目标widget为例,对智能手表中添加的目标widget进行举例说明。
请参考图7,图7是本申请实施例提供的一种音乐应用以及音乐应用的widget的图形用户界面示意图。其中,图7中的(a)图示出了一种手机在打开音乐应用的情况下,输出的音乐应用的音乐播放界面701。音乐播放界面701显示有歌名、歌曲专辑封面、歌词、播放器的播放、上一首/下一首、收藏、列表播放顺序、设置菜单等按钮。应理解,音乐播放界面701还可以包括其他更多的数据和功能按钮,本申请实施例对此不作限定。图7中的(b)图示出了一种在智能手表中添加音乐应用的widget后的显示界面702,如图7中的(b)图所示,音乐应用的widget的显示界面为简略的音乐播放界面,包括歌名、歌曲专辑封面、播放器的播放、上一首/下一首、收藏、列表播放顺序、设置菜单等按钮,用于实现对音乐应用的信息查看和播放控制等。比如,用户可以基于智能手表添加的音乐应用的widget,直接进行上一首或下一首歌曲的切换、歌曲播放进度的调节、歌曲收藏以及播放状态的切换等。应理解,音乐应用的widget的显示界面还可以为其他界面内容,本申请实施例对此不作限定。
请参考图8,图8是本申请实施例提供的一种视频应用以及视频应用的widget的图形用户界面示意图。其中,图8中的(a)图示出了一种手机在打开视频应用的情况下,输出的视频应用的视频播放界面801。视频播放界面801显示有视频名称、视频画面、播放器的播放、音量调节、缩放、下载、收藏等按钮。应理解,视频播放界面801还可以包括其他更多的数据和功能按钮,本申请实施例对此不作限定。图8中的(b)图示出了一种在智能手表中添加视频应用的widget后的显示界面802,如图8中的(b)图所示,视频应用的widget的显示界面为简略的视频播放界面,包括视频画面、播放器的播放等按钮,用于实现对视频应用的信息查看和播放控制等。用户可以基于智能手表添加的音乐应用的widget,直接进行视频的切换、视频播放进度的调节、音量的调节、亮度的调节以及播放状态的切换等。应理解,视频应用的widget的显示界面还可以为其他界面内容,本申请实施例对此不作限定。比如,用户可以通过旋转智能手表的旋钮来控制视频应用的播放进度、音量或亮度等,提高控制的精准度。
请参考图9,图9是本申请实施例提供的一种地图应用以及地图应用的widget的图形用户界面示意图。其中,图9中的(a)图示出了一种手机在打开地图应用的情况下,输出的地图应用的导航界面901。导航界面901显示有导航方向、道路信息、退出以及设置等按钮。应理解,导航界面901还可以包括其他更多的数据和功能按钮,本申请实施例对此不作限定。图9中的(b)图示出了一种在智能手表中添加地图应用的widget后的显示界面902,如图9中的(b)图所示,地图应用的widget的显示界面为简略的导航界面,包括导航方向、所在道路等重要导航信息,用于实现导航路线的显示指导功能。地图应用的widget的显示界面可以按照指定策略进行刷新,比如周期性进行刷新,以便向用户显示最新的导航界面。应理解,地图应用的widget的显示界面还可以为其他界面内容,本申请实施例对此不作限定。
接下来,结合附图对本申请实施例提供的添加widget的方法进行详细阐述。
图10是本申请实施例提供的一种添加widget的方法流程图,该方法的交互主体为第一终端和第二终端。参见图10,该方法包括:
步骤1001:第一终端确定待添加的目标widget,目标widget是与已安装的目标应 用关联的widget。
目标应用可以为第一终端安装的任一应用,且目标应用关联有一个或多个widget。目标widget可以为目标应用的任一widget。目标widget具有目标应用的部分功能,目标widget的显示界面包括与目标应用相关的部分数据和/或控件。目标widget中的控件能够触发目标应用的某些功能。
比如,目标应用可以为音乐应用、视频应用或地图应用等,当然也可以为能够提供widget的其他应用。音乐应用的widget可以为音乐应用的音乐播放界面;视频应用的widget可以为视频应用的视频播放界面;地图应用的widget可以为地图应用的导航界面等。应理解,目标widget还可以为与目标应用关联的其他显示界面,本申请实施例对此不作限定。
需要说明的是,待添加的目标widget可以由第一终端默认设置,也可以由用户选择得到。比如,第一终端可以显示一个或多个widget标识,用户可以从这一个或多个widget标识选择一个widget标识,响应于用户的选择操作,第一终端即可将用户选择的widget标识所标识的widget确定为待添加的widget。
再者,widget标识用于唯一标识对应widget,可以为widget的名称、身份标识号(identity document,ID)或图标等,本申请实施例对此不作限定。
作为一个示例,若检测到widget添加操作,则第一终端可以显示widget添加界面,widget添加界面包括一个或多个widget标识。若检测到对widget添加界面中任一widget标识的选择操作,则将选择的widget标识所标识的widget确定为待添加的widget。比如,该widget添加界面可以为图5中的(c)所示的widget添加界面503。
需要说明的是,widget添加操作可以为点击操作、滑动操作、语音操作或手势操作等。比如,widget添加操作可以为长按主界面的空白区域的操作,或者为点击窗口小工具的操作等,本申请实施例对此不作限定。其中,窗口小工具用于触发添加widget。
步骤1002:第一终端若接收到将目标widget添加至第二终端的指令,则获取目标widget的界面相关数据,界面相关数据用于指示目标widget的显示界面。
需要说明的是,目标widget的界面相关数据可以包括widget显示数据和widget控制数据中的一种或多种。
widget显示数据用于指示目标widget的布局、目标widget的界面大小、目标widget上各个控件的类型、位置、图标、颜色中的一种或多种。目标widget的布局用于指示目标widget的结构,比如用于指示目标widget中包括哪些数据和控件等。作为一个示例,widget显示数据包括目标widget的布局文件、用于配置目标widget的界面大小的配置文件、用于配置目标widget上各个控件的类型和位置的配置文件、目标widget上各个控件的图标文件和颜色定义文件中的一种或多种。
widget控制数据用于指示目标widget上各个控件的控件对象、控件事件中的一种或多种。控件的控件事件包括控件被触发的响应事件,如点击响应事件等。作为一个示例,widget控制数据包括用于配置目标widget上各个控件的控件对象的配置文件,以及用于配置目标widget上各个控件的控件事件的配置文件中的一种或多种。作为一个示例,widget控制数据可以通过定义的Remount View对象进行配置。Remount View对象可以包含目标widget上各个控件的控件对象和控件事件中的一种或多种。
再者,将目标widget添加至第二终端的指令可以通过设备选择操作触发,设备选择操作可以为点击操作、滑动操作、语音操作或手势操作等。
作为一个示例,第一终端在确定待添加的目标widget之后,可以显示一个或多个终端的终端标识。若检测到对显示的一个或多个终端标识中任一终端标识的选择操作,则确定接收到将目标widget添加至选择的终端标识所标识的终端的指令,选择的终端标识所标识的终端为第二终端。
需要说明的是,一个或多个终端为已与第一终端建立连接的终端。比如,一个或多个终端为已与第一终端建立近距离无线通信连接的终端,如通过蓝牙或WIFI等与第一终端建立近距离无线通信连接的终端。
可选地,一个或多个终端为已与第一终端建立连接,且支持跨设备添加widget功能的终端。其中,支持跨设备添加widget功能的终端是指能够基于其他设备发送的widget添加请求添加widget的终端。
作为一个示例,第一终端在确定待添加的目标widget之后,可以先搜索已与第一终端建立连接的终端,然后从搜索到的终端中确定支持跨设备添加widget功能的终端,得到一个或多个终端,再显示这一个或多个终端的终端标识。
其中,从搜索到的终端中确定支持跨设备添加widget功能的终端的操作可以包括以下几种实现方式:
第一种实现方式:对于搜索到的任一终端,获取该终端的设备信息,根据该终端的设备信息,确定该终端是否支持跨设备添加widget功能。
需要说明的是,终端的设备信息包括终端的类型、终端的软件版本或系统版本中的一种或多种。示例地,可以根据该终端的设备信息,以及存储的设备信息与是否支持跨设备添加widget功能的支持信息之间的对应关系,来确定该终端是否支持跨设备添加widget功能。
第二种实现方式:对于搜索到的任一终端,获取该终端的设备标记,根据该终端的设备标记,确定该终端是否支持跨设备添加widget功能。其中,该终端的设备标记用于指示该终端是否支持跨设备添加widget功能。
需要说明的是,终端的设备标记可以由该终端发送得到。比如,该终端可以在与第一终端建立连接后,根据本端的设备信息,确定该终端是否支持跨设备添加widget功能,基于该终端是否支持跨设备添加widget功能生成该终端的设备标记,然后通过建立的连接向第一终端发送该终端的设备标记。第一终端接收到该终端的设备标记之后,可以对该终端的设备标记进行存储,以便后续基于存储的设备标记确定该终端是否支持跨设备添加widget功能。
作为一个示例,如图4所示,第一终端可以通过跨设备服务14来查询连接的终端是否支持跨设备添加widget功能。比如,可以通过跨设备服务14的widget添加设备查询接口,来查询连接的设备是否支持跨设备添加widget功能。
作为一个示例,第一终端接收到将目标widget添加至第二终端的指令之后,还可以存储目标widget的添加数据。如图4所示,第一终端可以通过应用widget服务13存储目标widget的添加数据,比如通过应用widget服务13创建目标widget的添加数据记录。
其中,目标widget的添加数据可以包括以下数据中的一种或多种:目标widget的widget标识、添加事件和添加时间等,当然还可以包括目标widget的其他添加数据,本申请实施例对此不作限定。
步骤1003:第一终端向第二终端发送widget添加请求,widget添加请求携带该界面相关数据,widget添加请求用于请求第二终端基于该界面相关数据添加目标widget。
作为一个示例,第一终端向第二终端发送widget添加请求之前,可以先对目标widget的界面相关数据进行打包处理,再向第二终端发送widget添加请求,该widget添加请求携带打包处理后的界面相关数据。
作为一个示例,如图4所示,第一终端可以通过跨设备添加服务14,向第二终端发送widget添加请求。比如,通过跨设备添加服务14的widget添加接口,对目标widget的界面相关数据进行打包处理,向第二终端发送携带打包处理后的界面相关数据的widget添加请求。
在另一实施例中,若接收到将目标widget添加至第二终端的指令,还可以先向第二终端发送widget添加确认消息。第二终端接收到widget添加确认消息后,可以显示widget添加询问信息,widget添加询问信息用于提示用户是否同意从第一终端添加目标widget。第二终端若基于显示的widget添加询问信息检测到用户的确认添加操作,则向第一终端发送确认添加消息,该确认添加消息用于指示同意从第一终端添加目标widget。第一终端接收到该确认添加消息后,再获取目标widget的界面相关数据,将目标widget的界面相关数据发送给第二终端。
步骤1004:第二终端接收第一终端发送的widget添加请求,基于该界面相关数据,在第二终端中添加目标widget。
第一终端可以基于该界面相关数据,在第二终端的显示界面中添加目标widget。在第二终端的显示界面中添加目标widget后,可以在第二终端的显示界面中显示目标widget的显示界面。其中,目标widget的显示界面可以占据第二终端的显示界面的全部或部分区域,本申请实施例对此不作限定。
以第二终端为智能手表为例,在智能手表中添加音乐应用的widget后的显示界面可以如图7中的(b)图所示。在智能手表中添加视频应用的widget后的显示界面可以如图8中的(b)图所示。在智能手表中添加地图应用的widget后的显示界面可以如图9中的(b)图所示。
其中,用于添加目标widget的显示界面可以由第二终端默认设置,也可以由用户选择得到。比如,在基于该界面相关数据,在第二终端中添加目标widget之前,可以基于用户的界面选择操作,确定待添加目标widget的目标显示界面,然后基于该界面相关数据,在目标显示界面中添加目标widget。
需要说明的是,该界面选择操作可以为点击操作、滑动操作、语音操作或手势操作等,本申请实施例对此不作限定。比如,该界面选择操作可以在向左或向右滑动显示界面后,对当前显示界面的空白区域的长按操作,或者对当前显示界面中的widget添加入口的点击操作等。
作为一个示例,基于该界面相关数据,在第二终端中添加目标widget的操作包括:基于该界面相关数据,在第二终端的显示界面上创建目标widget的显示界面,以实现 在第二终端中添加目标widget。
作为一个示例,基于该界面相关数据,在第二终端的显示界面上创建目标widget的显示界面的操作包括:创建widget视图对象,以及在第二终端的显示界面上创建widget视图对象的显示区域;创建与该界面相关数据对应的实体视图;将该实体视图添加在widget视图对象的显示区域中,得到目标widget的显示界面,从而完成目标widget在第二终端的显示。
其中,widget视图对象可以为APP Widget Host View对象,实体视图可以为实体View。第二终端可以根据该界面相关数据中的widget显示数据,创建与该界面相关数据对应的实体视图。
作为一个示例,如图4所示,第二终端可以通过跨设备服务22接收第一终端发送的widget添加请求,然后通过桌面启动器21,基于目标widget的界面相关数据在第二终端中添加目标widget。跨设备服务22接收第一终端发送的widget添加请求之后,可以将该widget添加请求发送给桌面启动器21,桌面启动器21可以通过widget显示框架,在第二终端中添加目标widget。
在一种可能的实现方式中,第二终端在基于该界面相关数据,在第二终端中成功添加目标widget之后,还可以向第一终端发送添加成功通知,该添加成功通知用于指示第二设备已成功添加目标widget。
第一终端接收到该添加成功通知之后,还可以存储成功添加目标widget的第二终端的设备信息。比如,通过第一终端的应用widget服务存储成功添加目标widget的第二终端的设备信息。示例地,可以通过第一终端的应用widget服务,将成功添加目标widget的第二终端的设备信息存储在widget数据库中。
另外,在第二终端中添加目标widget之后,用户还可以通过对第二终端中的目标widget进行操作,来控制第一终端中的目标应用,也即是,能够实现目标widget的跨设备操作。目标widget的跨设备操作流程可以包括如下步骤1005-1009。
步骤1005:第二终端若检测到针对添加的目标widget的widget操作,则向第一终端发送该widget操作触发的目标widget的控件事件。
其中,widget操作是指针对目标widget的操作,用于触发目标widget的控件事件。比如,widget操作可以是对目标widget中任一控件的触发操作,如对目标widget中任一控件的点击操作或滑动操作等。或者,widget操作也可以是在第一终端显示目标widget的过程中,对第一终端的物理按键的触发操作,或对第一终端的旋钮的旋转操作等。当然,widget操作也可以为其他针对目标widget的操作,如语音操作或手势操作等,本申请实施例对此不作限定。
作为一个示例,若检测到针对添加的目标widget的widget操作,则向第一终端发送该widget操作触发的目标widget的控件事件包括:若检测到对目标widget的第一控件的触发操作,则基于该界面相关数据确定第一控件对应的控件事件;将第一控件对应的控件事件发送给第一终端。
其中,第一控件的触发操作可以为对第一控件的点击操作或滑动操作,也可以为语音操作或手势操作等,本申请实施例对此不作限定。第一控件为目标widget的任一控件。
作为一个示例,若基于添加的目标widget检测到指定操作,第二终端可以触发一个类似广播的消息,然后将该消息发送给第一终端。其中,该消息携带指定操作触发的目标widget的控件事件。
作为一个示例,如图4所示,第二终端可以通过桌面启动器21检测针对添加的目标widget的widget操作,若检测到针对添加的目标widget的widget操作,则通过桌面启动器21的widget控件事件发送接口,将该widget操作触发的目标widget的控件事件发送给跨设备服务22,通过跨设备服务22将该控件事件发送给第一终端。
步骤1006:第一终端接收第二终端发送的目标widget的控件事件,触发目标应用执行该控件事件对应的业务。
假设目标应用为音乐应用,目标widget为音乐应用的widget,若该控件事件为对音乐应用的widget中切换至下一首歌曲按钮的点击事件,则即可触发音乐应用执行切换至下一首歌曲的业务。
作为一个示例,第一终端可以通过应用程序框架层中的跨设备服务接收第二终端发送的目标widget的控件事件。另外,第一终端可以通过应用程序层中的应用widget管理监听目标widget的控件事件,若监听到目标widget的控件事件,则触发目标应用执行该控件事件对应的业务。
作为一个示例,请参考图4,第一终端可以通过跨设备服务14接收第二终端发送的目标widget的控件事件。另外,第一终端可以通过应用widget管理12的事件广播接收器监听目标widget的控件事件,若监听到目标widget的控件事件,则触发目标应用11执行该控件事件对应的业务。
步骤1007:第一终端在目标应用执行该控件事件对应的业务之后,若基于目标应用执行的业务确定目标widget需要进行界面刷新,则获取目标widget的界面刷新数据,该界面刷新数据用于指示目标widget刷新后的显示界面。
其中,目标widget的界面刷新数据可以包括目标widget的widget显示数据和widget控制数据中的一种或多种。
作为一个示例,第一终端可以通过应用程序框架层中的应用widget服务,获取目标widget的界面刷新数据。如图4所示,第一终端可以通过应用widget服务13的widget刷新接口,来获取目标widget的界面刷新数据。
步骤1008:第一终端向第二终端发送widget刷新请求,widget刷新请求携带该界面刷新数据,widget刷新请求用于请求第二终端基于该界面刷新数据对目标widget的显示界面进行刷新。
作为一个示例,第一终端向第二终端发送widget刷新请求之前,可以先对目标widget的界面刷新数据进行打包处理,再向第二终端发送widget刷新请求,该widget刷新请求携带打包处理后的界面刷新数据。
作为一个示例,第一终端可以通过应用程序框架层的跨设备服务,向第二终端发送widget刷新请求。如图4所示,第一终端可以通过跨设备服务14的刷新接口,对目标widget的界面刷新数据进行打包处理,向第二终端发送携带打包处理后的界面刷新数据的widget刷新请求。
步骤1009:第二终端接收第一终端发送的widget刷新请求,基于该界面刷新数据, 对目标widget的显示界面进行刷新。
作为一个示例,如图4所示,第二终端可以通过跨设备服务22接收第一终端发送的widget刷新请求,然后通过桌面启动器21,基于目标widget的界面刷新数据对目标widget的显示界面进行刷新。跨设备服务22接收第一终端发送的widget刷新请求之后,可以将该widget添加刷新发送给桌面启动器21,桌面启动器21可以通过widget显示框架对目标widget进行刷新。
为了便于理解,接下来以目标widget为音乐应用的widget为例,结合附图7对音乐应用的widget的跨设备操作流程进行说明。如图7所示,通过手机为智能手表添加了音乐应用的widget,智能手表中添加的音乐应用的widget为图7中的(b)图所示的音乐播放界面。用户可以通过对智能手表添加的音乐应用的widget进行widget操作,直接控制手机中的音乐应用实现上一首或下一首歌曲的切换、歌曲播放进度的调节、歌曲收藏以及播放状态的切换等功能。widget操作可以包括对智能手表添加的音乐应用的widget中的控件的触发操作,或者对智能手表的物理按键或旋钮的操作等。
作为一个示例,音乐应用的widget的跨设备操作流程包括:
1)用户在智能手表添加的音乐应用的widget中点击下一首按钮。
2)响应于用户的点击操作,智能手表向手机发送点击操作触发的控件事件。
3)手机接收到该控件事件后,触发手机中的音乐应用执行切换至下一首歌曲的业务,并将切换至下一首歌曲后的界面刷新数据发送给智能手表。
4)智能手表接收到该界面刷新数据后,基于该界面刷新数据对音乐应用的widget进行刷新,以将音乐应用的widget的显示界面刷新为切换至下一首歌曲后的显示界面。
接下来以目标widget为视频应用的widget为例,结合附图8对视频应用的widget的跨设备操作流程进行说明。如图8所示,通过手机为智能手表添加了视频应用的widget,智能手表中添加的视频应用的widget为图8中的(b)图所示的视频播放界面。用户可以通过对智能手表添加的视频应用的widget进行widget操作,直接控制手机中的视频应用实现视频的切换、视频播放进度的调节、音量的调节、亮度的调节以及播放状态的切换等功能。widget操作可以包括对智能手表添加的视频应用的widget中的控件的触发操作,或者对智能手表的物理按键或旋钮的操作等。
作为一个示例,视频应用的widget的跨设备操作流程包括:
1)用户在智能手表中设置通过旋转旋钮控制视频播放进度。
2)用户旋转智能手表的旋钮,响应于用户的旋转操作,智能手表向手机发送旋转操作触发的控件事件。比如,该控件事件可以为旋钮旋转1°所触发的驱动播放进度条改变0.5的控件事件。
3)手机接收到该控件事件后,触发手机中的视频应用调整播放进度,完成播放进度条的改变,并将播放进度调整后的界面刷新数据发送给智能手表。
4)智能手表接收到该界面刷新数据后,基于该界面刷新数据对视频应用的widget进行刷新,以将视频应用的widget的显示界面刷新为播放进度调整后的显示界面。
接下来,以目标widget为地图应用的widget为例,结合附图9对地图应用的widget的跨设备操作流程进行说明。如图9所示,通过手机为智能手表添加了地图应用的widget,智能手表中添加的地图应用的widget为图9中的(b)图所示的导航界面。用 户可以通过对智能手表添加的地图应用的widget,快速查看导航信息。另外,地图应用的widget还可以按照指定策略进行刷新,比如周期性进行刷新,以便向用户显示最新的导航界面。
作为一个示例,地图应用的widget的跨设备操作流程包括:
1)手机中的地图应用开始导航后,周期性向智能手表发送地图应用的widget的界面刷新数据,即周期性地向智能手表发送刷新后的导航数据。
比如,手机中的地图应用每隔1秒进行一次刷新,并向智能手表发送地图应用的widget的界面刷新数据。
2)智能手表接收到该界面刷新数据后,基于该界面刷新数据对地图应用的widget进行刷新,以将地图应用的widget的显示界面刷新为最新的导航界面,从而完成导航界面的刷新。
相关技术中,上述音乐应用、视频应用和地图应用等第三方应用的widget通常只能添加在手机中,占据手机桌面的显示空间。若用户想要实现上述第三方应用的widget的相关功能,需要先拿出手机,对手机进行解锁,在多次滑动桌面找到第三方应用的widget,才能操作widget的相关功能。另外,目前智能手表安装的widget通常是为智能手表固定定制的widget,所安装的widget的功能和显示数据较为单一,对于其他能够添加在手机上的大量第三方应用的widget,智能手表并不支持添加,灵活的较低。而本申请实施例中通过跨设备添加widget的方式,可以通过手机将上述目标应用的widget添加在智能手表中,从而能够在智能手表中任意添加第三方应用的widget,扩展了widget添加方式,增强了智能手表的功能性。
另外,通过将上述目标应用的widget添加在智能手表中,用户抬起智能手表即可对添加的widget进行查看和操作,方便了用户的操作。比如,在驾驶车辆的场景中,如果使用手机的地图应用查看导航信息,则需要将手机固定在车辆的支架上进行查看;在骑行的场景下,如果使用手机的地图应用查看导航信息,由于自行车上很少会安装手机支架,也就需要边骑行边拿着手机进行查看,上述通过手机进行查看的方式对于用户来说非常不方便,且存在安全隐患。而通过本申请实施例提供的跨设备添加widget的方法,可以通过手机在智能手表中添加地图应用的widget,这样,用户抬起手腕上的智能手表,即可通过智能手表中添加的地图应用的widget快速查看导航信息,从而方便了用户的操作,在一定程度上减少了安全隐患。
本申请实施例中,可以通过第一终端来为第二终端添加目标应用的widget,实现了widget的跨设备添加,使得第二终端在不安装目标应用的情况下,也能够添加目标应用的widget,从而减少了安装目标应用对第二终端的存储资源和处理资源的耗费,扩展了widget的添加方式。另外,在第二终端添加的widget后,通过第二终端添加的widget还可以快速查看第一终端中目标应用的应用数据,避免了目标应用或目标应用的widget对第一终端的界面显示空间的占用。另外,通过第二终端添加的widget,还可以对第一终端的目标应用进行操控,比如触发第一终端中目标应用的相关功能,从而方便了用户的操作,扩展了widget的使用方式。
接下来,结合附图4对本申请实施例涉及的widget添加过程进行详细阐述。图11 是本申请实施例提供的一种widget添加过程的流程示意图,参见图11,widget添加过程包括:
步骤1101:用户打开第一终端的widget添加界面,基于widget添加界面选择添加目标应用的目标widget。
步骤1102:第一终端通过跨设备服务14,搜索已连接且支持跨设备添加widget功能的设备。
比如,可以调用跨设备服务14的widget添加设备查询接口,通过widget添加设备查询接口,搜索已连接且支持跨设备添加widget功能的设备。
步骤1103:第一终端显示搜索到的设备的设备标识。
比如,显示搜索到的设备的设备型号。
步骤1104:用户基于显示的设备标识,从搜索到的设备中选择待添加目标widget的第二终端。
步骤1105:第一终端基于用户的选择操作,调用应用widget服务13的widget添加接口,触发widget添加流程。
步骤1106:第一终端通过应用widget服务13创建目标widget的添加数据记录,以便之后在对目标widget进行widget操作时可以将目标widget的数据和控件事件发送给对应的widget。
其中,目标widget的添加数据记录可以包括以下数据中的一种或多种:目标widget的widget标识、添加事件和添加时间等。
步骤1107:第一终端通过应用widget服务13判断所触发的widget添加流程是否为跨设备添加widget的流程,若是跨设备添加widget的流程,则获取目标widget的界面相关数据。
另外,第一终端还可以显示将目标widget添加至第一终端的本地添加选项,用户还可以选择本地添加选项,以将目标widget添加至第二终端。
若检测到用户对本地添加选项的选择操作,则所触发的widget添加流程为本地添加widget的流程,这种情况下,第一终端可以通过应用widget服务13将目标widget添加至第一终端。若检测到用户对搜索到的设备的设备标识中任一设备标识的选择操作,则所触发的widget添加流程为跨设备添加widget的流程,这种情况下,可以通过应用widget服务13获取目标widget的界面相关数据,以将目标widget的界面相关数据发送给第二终端。
步骤1108:第一终端通过跨设备服务14,向第二终端发送widget添加请求,该widget添加请求携带目标widget的界面相关数据,以请求第二终端添加目标widget。
步骤1109:第二终端通过跨设备服务22,接收第一终端发送的widget添加请求。
步骤1110:第二终端基于该widget添加请求携带的目标widget的界面相关数据,通过桌面启动器21在第二终端中添加目标widget。
第二终端通过跨设备服务22,接收到第一终端发送的widget添加请求之后,可以将该widget添加请求发送给桌面启动器21。桌面启动器21可以基于该widget添加请求携带的目标widget的界面相关数据,在第二终端中添加目标widget。
步骤1111:第二终端在成功添加目标widget之后,通过跨设备服务22,向第一 终端发送添加成功通知,该添加成功通知用于指示第二终端已成功添加目标widget。
步骤1112:第一终端接收到该添加成功通知之后,可以通过应用widget服务13存储成功添加目标widget的第二终端的设备信息。
比如,通过应用widget服务13,将成功添加目标widget的第二终端的设备信息存储在widget数据库中。
需要说明的是,图11仅是本申请实施例提供的一种widget添加过程的示例性说明,并不对widget添加过程进行限定。应理解,widget添加过程的流程还可以为其他流程,本申请实施例对此不作限定。
接下来,结合附图4对本申请实施例涉及的widget刷新过程进行详细阐述。图12是本申请实施例提供的一种widget刷新过程的流程示意图,参见图12,widget刷新过程包括:
步骤1201:用户点击第二终端添加的目标widget中的控件,以便触发相关功能。
步骤1202:第二终端基于用户的点击操作,检测目标widget对应的目标应用所在的第一终端与第二终端是否连接。
如果第一终端与第二终端未连接,则不作响应。如果第一终端与第二终端已连接,则执行下述步骤1203。
步骤1203:第二终端将用户的点击操作触发的目标widget的控件事件,通过第一终端的跨设备服务14和应用widget服务13发送给第一终端的目标应用11。
步骤1204:第一终端的目标应用11可以监听目标widget的控件事件,若监听到目标widget的控件事件,则执行该控件事件对应的业务。
其中,目标应用11可以通过应用widget管理12监听目标widget的控件事件,若应用widget管理12监听到目标widget的控件事件,则触发目标应用11执行该控件事件对应的业务。
步骤1205:在目标应用11执行该控件事件对应的业务之后,若确定目标widget的显示界面需要进行刷新,则通过widget服务管理12向应用widget服务13发送刷新消息。
步骤1206:应用widget服务13基于该刷新消息,获取目标widget的界面刷新数据。
目标应用11在执行该控件事件对应的业务之后,若确定目标widget的显示界面需要进行刷新,则可以通过应用widget服务13获取目标widget的界面刷新数据。
若目标widget为跨设备添加的widget,则可以将目标widget的界面刷新数据发送给目标应用11的应用widget服务13。另外,若目标widget为第一终端本地添加的widget,则还可以将目标widget的界面刷新数据发送给本地的目标widget,以使本地的目标widget也能够对显示界面进行刷新。
步骤1207:第一终端通过跨设备服务14,将目标widget的界面刷新数据发送给第二终端。
第一终端在通过应用widget服务13获取目标widget的界面刷新数据之后,可以先判断添加目标widget的第二终端与第一终端是否已连接。若未连接,则不作响应。若已连接,通过跨设备服务14,将目标widget的界面刷新数据发送给第二终端。
步骤1208:第二终端基于接收的目标widget的界面刷新数据,对目标widget的显示界面进行刷新。
示例地,第二终端可以通过桌面启动器21的widget显示框架,对目标widget的显示界面进行刷新。
需要说明的是,图12仅是本申请实施例提供的一种widget刷新过程的示例性说明,并不对widget刷新过程进行限定。应理解,widget刷新过程的流程还可以为其他流程,本申请实施例对此不作限定。
图13是本申请实施例提供的一种添加widget的装置的结构示意图,该装置可以由软件、硬件或者两者的结合实现成为计算机设备的部分或者全部,该计算机设备可以为图1所示的第一终端10。参见图13,该装置包括:第一确定模块1301、第一获取模块1302和第一发送模块1303。
第一确定模块,用于执行上述图10实施例中的步骤1001;
第一获取模块,用于执行上述图10实施例中的步骤1002;
第一发送模块,用于执行上述图10实施例中的步骤1003。
可选地,该装置还包括:
显示模块,用于显示一个或多个终端的终端标识,所述一个或多个终端已与所述第一终端建立连接;
第二确定模块,用于若检测到对显示的一个或多个终端标识中任一终端标识的选择操作,则确定接收到将所述目标widget添加至选择的终端标识所标识的终端的指令,所述选择的终端标识所标识的终端为所述第二终端。
可选地,该装置还包括:
搜索模块,用于搜索已与所述第一终端建立连接的终端;
第三确定模块,用于从搜索到的终端中确定支持跨设备添加widget功能的终端,得到所述一个或多个终端,所述支持跨设备添加widget功能的终端是指能够基于其他设备发送的widget添加请求添加widget的终端。
可选地,所述界面相关数据包括widget显示数据和widget控制数据;
其中,所述widget显示数据用于指示所述目标widget的布局、所述目标widget的界面大小、所述目标widget上各个控件的类型、位置、图标、颜色中的一种或多种;所述widget控制数据用于指示所述目标widget上各个控件的控件对象、控件事件中的一种或多种。
可选地,该装置还包括:
触发模块,用于执行上述图10实施例中的步骤1006。
可选地,该装置还包括:
第二获取模块,用于执行上述图10实施例中的步骤1007;
第二发送模块,用于执行上述图10实施例中的步骤1008。
本申请实施例中,可以通过第一终端来为第二终端添加目标应用的widget,实现了widget的跨设备添加,使得第二终端在不安装目标应用的情况下,也能够添加目标应用的widget,从而减少了安装目标应用对第二终端的存储资源和处理资源的耗费, 扩展了widget的添加方式。另外,在第二终端添加的widget后,通过第二终端添加的widget还可以快速查看第一终端中目标应用的应用数据,避免了目标应用或目标应用的widget对第一终端的界面显示空间的占用。另外,通过第二终端添加的widget,还可以对第一终端的目标应用进行操控,比如触发第一终端中目标应用的相关功能,从而方便了用户的操作,扩展了widget的使用方式。
图14是本申请实施例提供的另一种添加widget的装置的结构示意图,该装置可以由软件、硬件或者两者的结合实现成为计算机设备的部分或者全部,该计算机设备可以为图1所示的第二终端20。参见图14,该装置包括:接收模块1401和添加模块1402。
接收模块1401和添加模块1402,用于执行上述图10实施例中的步骤1004。
可选地,添加模块1402用于:
基于所述界面相关数据,在所述第二终端的显示界面上创建所述目标widget的显示界面。
可选地,添加模块1402用于:
创建widget视图对象,以及在所述第二终端的显示界面上创建所述widget视图对象的显示区域;
创建与所述界面相关数据对应的实体视图;
将所述实体视图添加在所述显示区域中,得到所述目标widget的显示界面。
可选地,所述界面相关数据包括widget显示数据和widget控制数据;
其中,所述widget显示数据用于指示所述目标widget的布局、所述目标widget的界面大小、所述目标widget上各个控件的类型、位置、图标、颜色中的一种或多种;所述widget控制数据用于指示所述目标widget上各个控件的控件对象、控件事件中的一种或多种。
可选地,该装置还包括:
发送模块,用于执行上述图10实施例中的步骤1005。
可选地,发送模块用于:
若检测到对所述目标widget的第一控件的触发操作,则基于所述界面相关数据确定所述第一控件对应的控件事件,所述第一控件为所述目标widget的任一控件;
将所述第一控件对应的控件事件发送给所述第一终端。
可选地,该装置还包括:
刷新模块,用于执行上述图10实施例中的步骤1009。
本申请实施例中,可以通过第一终端来为第二终端添加目标应用的widget,实现了widget的跨设备添加,使得第二终端在不安装目标应用的情况下,也能够添加目标应用的widget,从而减少了安装目标应用对第二终端的存储资源和处理资源的耗费,扩展了widget的添加方式。另外,在第二终端添加的widget后,通过第二终端添加的widget还可以快速查看第一终端中目标应用的应用数据,避免了目标应用或目标应用的widget对第一终端的界面显示空间的占用。另外,通过第二终端添加的widget,还可以对第一终端的目标应用进行操控,比如触发第一终端中目标应用的相关功能,从 而方便了用户的操作,扩展了widget的使用方式。
需要说明的是:上述实施例提供的添加widget的装置在添加widget时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的添加widget的装置与添加widget的方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络或其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如:同轴电缆、光纤、数据用户线(Digital Subscriber Line,DSL))或无线(例如:红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质,或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如:软盘、硬盘、磁带)、光介质(例如:数字通用光盘(Digital Versatile Disc,DVD))或半导体介质(例如:固态硬盘(Solid State Disk,SSD))等。
以上所述为本申请提供的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (16)

  1. 一种添加微件widget的方法,其特征在于,应用于第一终端,所述方法包括:
    确定待添加的目标widget,所述目标widget是与已安装的目标应用关联的widget;
    若接收到将所述目标widget添加至第二终端的指令,则获取所述目标widget的界面相关数据,所述界面相关数据用于指示所述目标widget的显示界面;
    向所述第二终端发送widget添加请求,所述widget添加请求携带所述界面相关数据,所述widget添加请求用于请求所述第二终端基于所述界面相关数据添加所述目标widget。
  2. 如权利要求1所述的方法,其特征在于,所述确定待添加的目标widget之后,还包括:
    显示一个或多个终端的终端标识,所述一个或多个终端已与所述第一终端建立连接;
    若检测到对显示的一个或多个终端标识中任一终端标识的选择操作,则确定接收到将所述目标widget添加至选择的终端标识所标识的终端的指令,所述选择的终端标识所标识的终端为所述第二终端。
  3. 如权利要求2所述的方法,其特征在于,所述显示一个或多个终端的终端标识之前,还包括:
    搜索已与所述第一终端建立连接的终端;
    从搜索到的终端中确定支持跨设备添加widget功能的终端,得到所述一个或多个终端,所述支持跨设备添加widget功能的终端是指能够基于其他设备发送的widget添加请求添加widget的终端。
  4. 如权利要求1-3任一所述的方法,其特征在于,
    所述界面相关数据包括widget显示数据和widget控制数据;
    其中,所述widget显示数据用于指示所述目标widget的布局、所述目标widget的界面大小、所述目标widget上各个控件的类型、位置、图标、颜色中的一种或多种;所述widget控制数据用于指示所述目标widget上各个控件的控件对象、控件事件中的一种或多种。
  5. 如权利要求1-4任一所述的方法,其特征在于,所述向所述第二终端发送widget添加请求之后,还包括:
    接收所述第二终端发送的所述目标widget的控件事件;
    触发所述目标应用执行所述控件事件对应的业务。
  6. 如权利要求5所述的方法,其特征在于,所述方法还包括:
    在所述目标应用执行所述控件事件对应的业务之后,若基于所述目标应用执行的业务确定所述目标widget需要进行界面刷新,则获取所述目标widget的界面刷新数据,所述界面刷新数据用于指示所述目标widget刷新后的显示界面;
    向所述第二终端发送widget刷新请求,所述widget刷新请求携带所述界面刷新数据,所述widget刷新请求用于请求所述第二终端基于所述界面刷新数据对所述目标widget的显示界面进行刷新。
  7. 一种添加widget的方法,其特征在于,应用于第二终端,所述方法包括:
    接收第一终端发送的widget添加请求,所述widget添加请求携带目标widget的界面相关数据,所述界面相关数据用于指示所述目标widget的显示界面,所述目标widget是与所述第一终端已安装的目标应用关联的widget;
    基于所述界面相关数据,在所述第二终端中添加所述目标widget。
  8. 如权利要求7所述的方法,其特征在于,所述基于所述界面相关数据,在所述第二终端中添加所述目标widget,包括:
    基于所述界面相关数据,在所述第二终端的显示界面上创建所述目标widget的显示界面。
  9. 如权利要求8所述的方法,其特征在于,所述基于所述界面相关数据,在所述第二终端的显示界面上创建所述目标widget的显示界面,包括:
    创建widget视图对象,以及在所述第二终端的显示界面上创建所述widget视图对象的显示区域;
    创建与所述界面相关数据对应的实体视图;
    将所述实体视图添加在所述显示区域中,得到所述目标widget的显示界面。
  10. 如权利要求7-9任一所述的方法,其特征在于,
    所述界面相关数据包括widget显示数据和widget控制数据;
    其中,所述widget显示数据用于指示所述目标widget的布局、所述目标widget的界面大小、所述目标widget上各个控件的类型、位置、图标、颜色中的一种或多种;所述widget控制数据用于指示所述目标widget上各个控件的控件对象、控件事件中的一种或多种。
  11. 如权利要求7-10任一所述的方法,其特征在于,所述基于所述界面相关数据,在所述第二终端中添加所述目标widget之后,还包括:
    若检测到针对所述目标widget的widget操作,则向所述第一终端发送所述widget操作触发的所述目标widget的控件事件。
  12. 如权利要求11所述的方法,其特征在于,所述若检测到针对所述目标widget的widget操作,则向所述第一终端发送所述widget操作触发的所述目标widget的控件事件,包括:
    若检测到对所述目标widget的第一控件的触发操作,则基于所述界面相关数据确定所述第一控件对应的控件事件,所述第一控件为所述目标widget的任一控件;
    将所述第一控件对应的控件事件发送给所述第一终端。
  13. 如权利要求11或12所述的方法,其特征在于,所述向所述第一终端发送所述widget操作触发的所述目标widget的控件事件之后,还包括:
    接收所述第一终端发送的widget刷新请求,所述widget刷新请求携带所述目标widget的界面刷新数据,所述界面刷新数据用于指示所述目标widget刷新后的显示界面;
    基于所述界面刷新数据,对所述目标widget的显示界面进行刷新。
  14. 一种添加widget的装置,其特征在于,所述装置包括:
    第一确定模块,用于确定待添加的目标widget,所述目标widget是与已安装的目标应用关联的widget;
    第一获取模块,用于若接收到将所述目标widget添加至第二终端的指令,则获取所述目标widget的界面相关数据,所述界面相关数据用于指示所述目标widget的显示界面;
    第一发送模块,用于向所述第二终端发送widget添加请求,所述widget添加请求携带所述界面相关数据,所述widget添加请求用于请求所述第二终端基于所述界面相关数据添加所述目标widget。
  15. 一种添加widget的装置,其特征在于,所述装置包括:
    接收模块,用于接收第一终端发送的widget添加请求,所述widget添加请求携带目标widget的界面相关数据,所述界面相关数据用于指示所述目标widget的显示界面,所述目标widget是与所述第一终端安装的目标应用关联的widget;
    添加模块,用于基于所述界面相关数据,在第二终端中添加所述目标widget。
  16. 一种计算机可读存储介质,其特征在于,所述可读存储介质中存储有指令,当所述指令被执行时,实现如权利要求1-6或权利要求7-13任一项所述的方法。
PCT/CN2021/119966 2020-12-07 2021-09-23 添加widget的方法、装置及计算机可读存储介质 WO2022121445A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011419518.0A CN114610419B (zh) 2020-12-07 2020-12-07 添加widget的方法、装置及计算机可读存储介质
CN202011419518.0 2020-12-07

Publications (1)

Publication Number Publication Date
WO2022121445A1 true WO2022121445A1 (zh) 2022-06-16

Family

ID=81855902

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/119966 WO2022121445A1 (zh) 2020-12-07 2021-09-23 添加widget的方法、装置及计算机可读存储介质

Country Status (2)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024046062A1 (zh) * 2022-08-31 2024-03-07 华为技术有限公司 一种卡片跨设备交互方法及电子设备

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116679861A (zh) * 2022-11-30 2023-09-01 荣耀终端有限公司 一种内容显示方法及其电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100759604B1 (ko) * 2006-01-23 2007-09-17 주식회사 팬택앤큐리텔 비정상적인 업데이트 패킷 수신을 차단하는 서버 실행기반의 fota 시스템 및 방법
KR20100050603A (ko) * 2008-10-21 2010-05-14 삼성전자주식회사 위젯 서비스를 제공하는 시스템 및 그 시스템에서 위젯 정보를 업데이트하는 방법
CN101894155A (zh) * 2010-07-06 2010-11-24 中兴通讯股份有限公司 widget的分类方法及系统、终端
CN102075539A (zh) * 2011-01-25 2011-05-25 中兴通讯股份有限公司 数据推送系统及方法
CN102143219A (zh) * 2011-01-25 2011-08-03 中兴通讯股份有限公司 widget资源的共享方法及系统
CN102694670A (zh) * 2011-03-23 2012-09-26 中兴通讯股份有限公司 一种三网融合Widget管理平台、实现方法及系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102163684B1 (ko) * 2013-07-19 2020-10-12 삼성전자주식회사 디바이스의 홈 스크린 구성 방법 및 장치
CN109525713A (zh) * 2018-10-30 2019-03-26 努比亚技术有限公司 一种应用程序控制方法、穿戴设备及移动终端

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100759604B1 (ko) * 2006-01-23 2007-09-17 주식회사 팬택앤큐리텔 비정상적인 업데이트 패킷 수신을 차단하는 서버 실행기반의 fota 시스템 및 방법
KR20100050603A (ko) * 2008-10-21 2010-05-14 삼성전자주식회사 위젯 서비스를 제공하는 시스템 및 그 시스템에서 위젯 정보를 업데이트하는 방법
CN101894155A (zh) * 2010-07-06 2010-11-24 中兴通讯股份有限公司 widget的分类方法及系统、终端
CN102075539A (zh) * 2011-01-25 2011-05-25 中兴通讯股份有限公司 数据推送系统及方法
CN102143219A (zh) * 2011-01-25 2011-08-03 中兴通讯股份有限公司 widget资源的共享方法及系统
CN102694670A (zh) * 2011-03-23 2012-09-26 中兴通讯股份有限公司 一种三网融合Widget管理平台、实现方法及系统

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024046062A1 (zh) * 2022-08-31 2024-03-07 华为技术有限公司 一种卡片跨设备交互方法及电子设备

Also Published As

Publication number Publication date
CN114610419B (zh) 2023-04-14
CN114610419A (zh) 2022-06-10

Similar Documents

Publication Publication Date Title
WO2021013158A1 (zh) 显示方法及相关装置
JP7142783B2 (ja) 音声制御方法及び電子装置
WO2020177622A1 (zh) Ui组件显示的方法及电子设备
WO2020108356A1 (zh) 一种应用显示方法及电子设备
WO2021000804A1 (zh) 锁定状态下的显示方法及装置
WO2022089207A1 (zh) 一种跨设备应用交互方法、电子设备与服务器
CN114327666B (zh) 应用启动方法、装置和电子设备
WO2021175272A1 (zh) 一种应用信息的显示方法及相关设备
WO2020238759A1 (zh) 一种界面显示方法和电子设备
WO2022121445A1 (zh) 添加widget的方法、装置及计算机可读存储介质
CN114513847B (zh) 定位方法、装置、系统、电子设备及存储介质
WO2020134892A1 (zh) 一种媒体文件裁剪的方法、电子设备和服务器
WO2022179275A1 (zh) 终端应用控制的方法、终端设备及芯片系统
WO2021218429A1 (zh) 应用窗口的管理方法、终端设备及计算机可读存储介质
WO2022127130A1 (zh) 一种添加操作序列的方法、电子设备和系统
WO2022022674A1 (zh) 应用图标布局方法及相关装置
CN114237921A (zh) 传感器监听方法、装置及终端设备
WO2023138305A1 (zh) 卡片显示方法、电子设备及计算机可读存储介质
WO2022228180A1 (zh) 一种应用的管理方法和电子设备
WO2022166435A1 (zh) 分享图片的方法和电子设备
WO2022161024A1 (zh) 升级提示方法、终端设备及计算机可读存储介质
WO2021238376A1 (zh) 功能包的加载方法、装置、服务器和电子设备
CN116204093B (zh) 一种页面显示方法及电子设备
CN113179362B (zh) 电子设备及其图像显示方法
WO2022111701A1 (zh) 投屏方法及系统

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21902153

Country of ref document: EP

Kind code of ref document: A1