Widget content updating method and electronic device
By updating the widget when the corresponding APP is started, extending the update time point, and optimizing the application startup sequence, the battery consumption and memory usage problems in the existing technology are solved, and the user experience is improved.
Patent Information
- Application Number
- CN202211349751.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-10-31
AI Technical Summary
In the prior art, updating content by regularly launching the APP corresponding to the widget increases the battery consumption and memory usage of the electronic device, affecting the user experience.
Update the widget when the corresponding app starts, and extend the update time to the end of the next timing cycle to reduce repeated updates within the timing cycle. Optimize the application startup order through timers and listeners, stagger the update time points, and avoid processing multiple applications at the same time.
It reduces the battery consumption and memory usage of electronic devices, improves the user experience, reduces the frequency and number of application startups, and optimizes the smoothness of applications running in the foreground.
Smart Images

Figure CN117950686B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a widget content updating method and an electronic device. Background Art
[0002] With the continuous development and evolution of the Internet, users' demand for friendliness and personalization of human-computer interaction interfaces is growing. Against this backdrop, micro-component applications (widgets, referred to as widgets) came into being. A widget is an executable and rendered page script embedded in other applications (APPs). Widgets are loaded and run by other APPs, thereby directly displaying the services or content that users care about most to users on other APPs. Examples of widgets include: clock widgets, weather widgets, search widgets, QR code scanning widgets, etc.
[0003] The content displayed by a widget is not static, so it needs to be updated regularly. Conventional technology obtains updated content by periodically launching the widget's corresponding app. For example, to update the weather, load the weather widget on the desktop. The weather widget displays "cloudy" in the morning. In the afternoon, by periodically launching the weather app corresponding to the weather widget, the afternoon weather display is displayed, such as "showers", and then the showers are displayed on the weather widget.
[0004] It can be seen that this method of regularly launching the APP corresponding to the widget causes too many APPs to run in the background, thereby increasing the battery consumption and memory usage of the electronic device, thereby affecting the user experience of the electronic device. Summary of the Invention
[0005] Based on this, embodiments of the present application provide a widget content update method and electronic device that can update a widget when the corresponding app is launched. Then, when the scheduled update time arrives, the already updated widget does not need to update its content again. This ensures that the demand for widget content updates is met while reducing the number of apps launched simultaneously and the number of widgets updating content simultaneously, thereby reducing the battery consumption and memory usage of the electronic device and improving the user experience.
[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0007] In a first aspect, embodiments of the present application provide a widget content update method applicable to an electronic device. In this method, if it is detected that a first application is launched within a first timing period, the electronic device updates the displayed content of a first widget loaded by the first application and updates the update time of the first widget to the start time of the next first timing period.
[0008] In this application, when the first application is started within the first timing cycle, on the one hand, the first widget corresponding to the first application is updated, and on the other hand, the starting time point of the first timing cycle is updated, thereby extending the time point of launching the first application to the end time point of the next first timing cycle. In this way, the time difference between the time point when the first application is launched and the time when the first application was last launched can be extended, thereby avoiding multiple launches of the first application in a short period of time. In other words, by updating the starting time point of the timing cycle, the first application does not have to be launched at the original end time point of the first timing cycle. In this way, while ensuring that the displayed content of the widget is updated in a timely manner, the frequency with which the application is launched by the electronic device for the purpose of updating the displayed content of the widget can also be reduced.
[0009] In one possible design of the first aspect, if the first application is not launched within the first timing period at the end of the first timing period, the electronic device launches the first application and updates the display content of the first widget. The electronic device then updates the update time of the first widget to the start time of the next first timing period.
[0010] Under this design, if the first application is not launched within the first timing cycle, it means that the first widget has not been updated within the first timing cycle. Therefore, when the first timing cycle ends, the first application process is launched so that the display content of the first widget can be updated at the end of the first timing cycle. After updating the display content of the widget, the update time of the first widget is recorded by updating the start time of the next first timing cycle. This facilitates determining whether the first application is launched in the next first timing cycle.
[0011] In a possible design manner of the first aspect, if it is detected that the second application is started within the second timing period, the electronic device updates the display content of the second widget loaded by the second application and updates the update time point of the second widget to the start time point of the next second timing period.
[0012] Under this design, when the second application is started within the second timing cycle, on the one hand, the second widget corresponding to the second application is updated, and on the other hand, the starting time of the second timing cycle is updated, thereby extending the time point of launching the second application to the end time point of the next second timing cycle. Since the launch time and launch frequency of the first application and the second application are different, the expiration time of the timer corresponding to each application will also be different. This can stagger the update time points of the displayed content of the widgets, and avoid the problem of multiple applications being launched at the same time causing the electronic device to handle too many tasks at the same time. The fewer tasks an electronic device handles at the same time, the smoothness of using applications running in the foreground of the electronic device will be improved. At the same time, the frequency of electronic devices launching applications for the purpose of updating the display content of new widgets is reduced, which can reduce battery consumption and memory usage, thereby providing users with a better user experience.
[0013] In a possible design of the first aspect, each application corresponds to a timer, and the timer is used to separately time the timing period of the application, wherein the application includes the aforementioned first application and / or second application.
[0014] In this design, each timer can be bound to an application to independently time the application's startup period. The timer's start time corresponds to the start time of the bound application's timing period, and the timer's stop time corresponds to the end time of the bound application's timing period.
[0015] In a possible design of the first aspect, if the electronic device detects that the first application is launched within the first timing period, updating the display content of the first widget loaded by the first application includes: the electronic device monitors the launch status of the first application within the corresponding first timing period. If the launch status of the first application is monitored within the first timing period, the electronic device updates the display content of the first widget loaded by the first application.
[0016] In this design, whether the first application is started is determined by monitoring the startup status of the first application.
[0017] In some embodiments, a listener can be registered with the service that manages the application process. If the listener detects that the service that manages the application process has updated the startup status of the first application to "started," the first application will not be started at the end of the timer period. By monitoring the startup status, timely intervention can be made when the startup status of the first application changes, thereby improving the efficiency of starting the first application.
[0018] In a possible design manner of the first aspect, the launching of the first application and updating the display content of the first widget loaded by the first application includes: the electronic device launching the first application, and then obtaining application information displayed after the first application is launched to update the display content of the first widget.
[0019] In a second aspect, the present application provides a widget content update method applicable to an electronic device. In this method, when a first application is launched, the electronic device updates the display content of a first widget loaded by the first application. If the first widget is updated within a timing period, at the end of the timing period, at least one second application is launched and the display content of each second widget loaded by the second application is updated. The at least one second application does not include the first application.
[0020] In this application, the first application has updated the display content of the widget within the timing period, so the first application will not be pulled up at the end of the timing period. At least one second application that has not been started within the timing period will be pulled up to update the display content of the widget corresponding to the second application. In other words, the first application that has been started within a timing period will not be pulled up at the end of the timing period. This can avoid the problem of high battery consumption when the first application is started and the first application is pulled up again at the end of the timing period. At the same time, it can also avoid the problem of starting the first application and the second application at the same time at the end of the timing period to update the display content of the widget, resulting in a large number of tasks that the electronic device needs to handle at the same time, and then the memory usage is too high. Therefore, excessively reducing battery consumption and memory usage improves the user experience of the widget.
[0021] In a possible design manner of the second aspect, if the first widget is not updated within the timing period, then at the end of the timing period, the electronic device starts the first application and at least one second application and updates the display content of the first widget and the display content of each second widget.
[0022] Under this design, the first widget is not updated within the timing period, which means that the first application is not started within the timing period, and the first widget corresponding to the first application will not be updated within the timing period. In order to ensure that the displayed content of the widget is updated in a timely manner, when the timing period expires, the electronic device starts the first application and at least one second application, thereby updating the display content of the first widget and each second widget. In this way, while ensuring that the displayed content of the widget is updated in a timely manner, it can also reduce the frequency with which the application is started by the electronic device for the purpose of updating the displayed content of the widget. In this way, the electronic device can process the APP started at the end of the timing period with low power consumption, thereby avoiding the impact on the user's use of the APP running in the foreground due to the excessive number of started APPs occupying the power consumption of the electronic device.
[0023] In a possible design of the second aspect, if the first widget is updated within the timing period, then at the end of the timing period, the electronic device launches at least one second application and updates the display content of the second widget loaded by each second application. Wherein at least one second application does not include the first application, the method includes: if the first widget is updated within the timing period, then at the end of the timing period, the electronic device sends a second instruction to the at least one second application. Wherein, at least one second application does not include the first application. Then, in response to the second instruction, the electronic device launches at least one second application and updates the display content of the second widget loaded by each second application.
[0024] Under this design, the electronic device launches the second application and updates the display content of the second widget by sending a second instruction. The second instruction can be sent via a targeted broadcast, so that at least one second application that receives the second instruction can be launched in batches, while the objects that are blocked from the broadcast (i.e., the first application) will not receive the second instruction. This improves the efficiency of launching batches of second application processes.
[0025] In a possible design of the second aspect, when the first application is launched, after updating the displayed content of the first widget loaded by the first application, the method further includes: the electronic device recording the update time of the first widget to obtain a widget update record, wherein the widget update record is deleted after the end of each timing cycle. If the first widget is updated within the timing cycle, then at the end of the timing cycle, the electronic device sends a second instruction to at least one second application, including: at the end of the timing cycle, if the widget update record of the first application is queried, the electronic device sends the second instruction to the at least one second application.
[0026] Under this design, the widget update history is recorded so that the electronic device can determine whether the first application has been launched within a timing cycle. Specifically, after the electronic device is turned on, the widget display content is updated once every timing cycle. The electronic device's processing method within each timing cycle is similar, so this description will take one timing cycle as an example. It should be understood that unless otherwise specified, the timing cycle in the embodiments of this application can refer to the same timing cycle.
[0027] Since the widget update record will be deleted after each timing cycle, the widget update record will be empty when a new timing cycle starts. In the new timing cycle, if the startup of the first application is detected, the time point when the widget is updated after the startup of the first application is recorded to obtain the widget update record. At this time, the widget update record has new content. Therefore, at the end of the new timing cycle, if the electronic device queries the widget update record corresponding to the first application, the widget update record can be queried. Then the electronic device will not send an instruction to start and update the widget to the first application, and the electronic device will send a second instruction to the second application to instruct the second application to start and update the display content of the second widget.
[0028] In a possible design of the second aspect, when the first application is started, after updating the display content of the first widget loaded by the first application, the method further includes: the electronic device records the update time point of the first widget to obtain a widget update record, wherein the widget update record is deleted after the end of each timing cycle. If the first widget is not updated within the timing cycle, then at the end of the timing cycle, the first application and at least one second application are started and the display content of the first widget and the display content of each second widget are updated, including: at the end of the timing cycle, if no widget update record is queried, the electronic device sends a third instruction to the first application and the at least one second application. Then, in response to the third instruction, the electronic device starts the first application and the at least one second application and updates the display content of the first widget and the display content of each second widget.
[0029] Under this design, the widget update record is recorded so that the electronic device can determine that the first widget has not been updated within a timing cycle. Since the widget update record will be deleted after each timing cycle, when a new timing cycle begins, the widget update record is empty. In the new timing cycle, if the first application is not started, the first widget loaded by the first application is not updated, so the widget update record is always empty. Then, at the end of the new timing cycle, the electronic device will not be able to query the widget update record corresponding to the first application. The electronic device then sends a third instruction to the first application and the second application to instruct the first application and the second application to start and update the display content of the first widget and the display content of the second widget after the new timing cycle ends.
[0030] In a possible design of the second aspect, if the first widget is updated within the timing period, then at the end of the timing period, the electronic device launches at least one second application and updates the display content of each second widget loaded by the second application, including: the electronic device monitors the startup status of the first application and the second application within the timing period. If, at the end of the timing period, the electronic device does not monitor the startup status of the second application but monitors the startup status of the first application, then at the end of the timing period, the electronic device launches at least one second application and updates the display content of each second widget loaded by the second application.
[0031] In this design, whether the first application is started is determined by monitoring the start-up status of the first application, and whether the second application is started is determined by monitoring the start-up status of the second application.
[0032] In some embodiments, a listener can be registered with the service that manages the application process. If the listener detects that the service that manages the application process updates the startup status of a first application to "started," the first application will not be started at the end of the timing period. If the listener does not detect that the service that manages the application process updates the startup status of a second application, the second application will be started at the end of the timing period. By monitoring the startup status, timely intervention can be made when the startup status changes, thereby improving the efficiency of starting applications.
[0033] In a possible design of the second aspect, a duration between an update time point of the first widget and an end time point of the timing cycle is less than or equal to one timing cycle.
[0034] Under this design, the duration between the first widget's update time and the end time of the timing cycle is less than or equal to one timing cycle, indicating that the first widget has been updated at least once within one timing cycle. This ensures that the widget's displayed content is updated in a timely manner. In other words, although this design reduces the number of applications launched simultaneously and the number of widgets updated simultaneously, it does not affect the normal updating of the widget's displayed content, and therefore does not affect user experience.
[0035] In one possible design of the second aspect, when the first application is launched, the electronic device updates the displayed content of the first widget loaded by the first application, including: sending a widget update message to the first application when the first application is launched. Then, in response to the widget update message, the electronic device obtains application information displayed after the first application is launched to update the displayed content of the first widget.
[0036] In a third aspect, the present application provides an electronic device comprising: a memory and one or more processors. The memory and the processor are coupled. The memory is configured to store computer program code, which includes computer instructions. When the computer instructions are executed by the processor, the electronic device performs the method of the first aspect and any possible design thereof, or the method of the second aspect and any possible design thereof.
[0037] In a fourth aspect, the present application provides a computer-readable storage medium, which may include computer instructions. When the computer instructions are run on an electronic device, the electronic device executes the method of the first aspect and its possible design method or the method of the second aspect and its possible design method.
[0038] In a fifth aspect, the present application provides a computer program product, which, when running on a computer, enables the computer to execute the method of the first aspect and its possible design methods or the method of the second aspect and its possible design methods.
[0039] It can be understood that the first aspect provided above and its possible implementation design method, the electronic device of the third aspect, the computer storage medium of the fourth aspect, and the computer program product of the fifth aspect are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of a weather widget provided in an embodiment of the present application;
[0041] Figure 2 A structural block diagram of a conventional widget content updating method provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of a periodically updating widget provided in an embodiment of the present application;
[0043] Figure 4 A schematic diagram of a scenario applicable to the embodiments of the present application;
[0044] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0045] Figure 6 A schematic diagram of generating a widget provided in an embodiment of the present application;
[0046] Figure 7 A software structure block diagram of an electronic device provided in an embodiment of the present application;
[0047] Figure 8 A flowchart of an electronic device provided in an embodiment of the present application;
[0048] Figure 9 An interactive diagram of a widget content update method provided in an embodiment of the present application;
[0049] Figure 10 A schematic diagram of a host program provided in an embodiment of the present application;
[0050] Figure 11 A schematic diagram of launching an application update widget when a timer is timing normally provided by an embodiment of the present application;
[0051] Figure 12 A schematic diagram of an update record generation process provided in an embodiment of the present application;
[0052] Figure 13 An interactive diagram of another method for updating widget content provided in an embodiment of the present application
[0053] Figure 14 An interaction diagram of another widget content update method provided in an embodiment of the present application;
[0054] Figure 15 A schematic diagram of a refresh timer when updating a widget provided by an embodiment of the present application;
[0055] Figure 16 This is a flowchart of a widget content updating method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
[0057] Before introducing the widget content updating method provided in the embodiment of the present application, conventional widget content updating technology is first introduced here.
[0058] An increasing number of electronic devices are displaying relevant content by loading widgets into apps. Because widgets are small, intuitive, and customizable, widget technology can meet users' demands for a more user-friendly and personalized human-computer interaction interface.
[0059] There are three modules involved in a widget: App Widget Provider (or widget content provider), App Widget Host (or host program), and App Widget Service (or widget system service). The following takes the weather widget as an example to introduce these three modules in detail. Figure 1 , which is a schematic diagram of a weather widget provided by an embodiment of the present application. In this example, a weather application 102 is loaded on the desktop 101, wherein the weather application 102 is an AppWidget Provider and the desktop 101 is an App Widget Host. The desktop 101, as a host program, provides a display platform for the weather application 102, so the weather application 102 can display weather information on the desktop (such as displaying the weather icon 103 "cloudy"). The App Widget Service is not displayed on the desktop. Figure 1 In the example, the App Widget Service is responsible for scheduling and launching the application process of the weather application 102. Here, launching (or launching a process) means launching an APP such as the weather application 102 to run in the background, which not only updates the content of the weather widget but also does not affect the use of the foreground running program.
[0060] During the running of the widget, the App Widget Service periodically launches the widget's corresponding APP to obtain updated content. Figure 2 , which is a structural block diagram of a conventional widget content update method provided in an embodiment of the present application. In the conventional method, four modules are involved in the widget, namely the host program 201, the first application 202 (or widget content provider one), the second application 203 (or widget content provider two) and the widget system service 204. Among them, the widget system service 204 first establishes a binding relationship between the first application 202, the second application 203 and the host program 201. Specifically, the host program 201 provides the first application container 201a and the second application container 201b to the first application respectively. The first application 202 is bound to the first application container 201a, and the second application 203 is bound to the second application container 201b, so that the contents of the first application 202 and the second application 203 are displayed on the host program 201. The widget system service 204 then periodically updates the timer to determine the timing of pulling up the first application 202 and the second application 203. Whenever the timer expires, it indicates that the first application 202 and the second application 203 need to be launched. At this time, the widget system service 204 broadcasts an application launch message. After receiving the broadcast application launch message, the first application 202 and the second application 203 start the application in the background to update the widget content.
[0061] That is to say, in conventional technology, the widget content is updated periodically with the expiration of the timer as a period. Figure 3 , which is a schematic diagram of a periodic update widget provided by an embodiment of the present application. In this example, after the electronic device is turned on, the timer is updated every T minutes. When the timer countdown ends (i.e., a timing period T expires), it means that the electronic device needs to pull up the application update, APP1 corresponding to widget1, APP2 corresponding to widget2... widget n Corresponding APP n All are pulled up after the first T minutes. Then the timer counts down again. When the timer countdown ends, it means that the electronic device needs to pull up the application process again to update the widget. Therefore, widget1 corresponds to APP1, widget2 corresponds to APP2... widget n Corresponding APP n All widgets will be launched after the second T minutes have passed. This process repeats until all widgets corresponding to the app are launched at the end of each timer countdown.
[0062] As can be seen, the conventional method for updating widget content is to periodically launch the apps corresponding to the widgets loaded on the electronic device, starting from the power-on phase. The greater the number of widgets, the greater the number of apps launched each time. Apps running in the background not only cause the electronic device's battery to drain rapidly, affecting the system's battery life, but also occupy a large amount of memory space, affecting system performance, and thus, affecting the user experience of the electronic device.
[0063] Based on this, an embodiment of the present application provides a widget content update method applicable to an electronic device. In this method, when a first application is launched, the electronic device updates the display content of a first widget loaded by the first application. If the first widget is updated within a timing period, then at the end of the timing period, the electronic device launches at least one second application and updates the display content of each second widget loaded by the second application. The at least one second application does not include the first application.
[0064] Through the embodiments of the present application, the first application that has updated the widget display content within the timing period will not be restarted at the end of the timing period, while the second application that has not updated the widget display content within the timing period will be restarted and update the widget content at the end of the timing period. In this way, the number of widgets that need to update content can be reduced while ensuring the need for widget content updates, thereby reducing the battery consumption and memory usage of the electronic device and improving the user experience.
[0065] Reference Figure 4, which is a schematic diagram of a scenario applicable to the embodiment of this application. For example, the APP running in the foreground of the electronic device is the APP corresponding to the widget, such as the APP running in the foreground is the Alipay corresponding to the QR code widget TM 401. Alipay TM 401 During the foreground operation, if the timer expires, the widget that needs to be updated will be updated in the background. The widget content update method of the embodiment of the present application can be used to Figure 4 The scenario shown in (a) is to avoid excessive battery consumption and memory usage caused by a large number of widget updates during the use of the APP corresponding to the widget, thereby affecting the user experience of the APP corresponding to the widget.
[0066] In another example, the APP running in the foreground of the electronic device is not the APP corresponding to the widget, such as the APP running in the foreground is the game application 402, but the game application is not loaded into the host program as a widget. At this time, when the game application 402 is running in the foreground, if the timer expires, the widget that needs to be updated will be updated in the background. The widget content update method of the embodiment of the present application can be used Figure 4 The scenario shown in (b) is to avoid excessive battery consumption and memory usage caused by a large number of widget updates during the use of non-widget corresponding APPs, thereby affecting the user experience of non-widget corresponding APPs.
[0067] It should be understood that Figure 4 (a) and Figure 4 (b) is only two applicable scenarios applicable to the embodiments of the present application. The widget content update method provided in the embodiments of the present application can also be applied to other scenarios where widgets are used, such as when no APP is running in the foreground of the mobile phone, the mobile phone is in sleep mode, the mobile phone is in flight mode, etc.
[0068] in addition, Figure 4 The scenario provided by the embodiments of the present application is mainly illustrated by taking a mobile phone as an example. In actual implementation, the widget content update method provided by the embodiments of the present application can also be applied to other electronic devices that can support widget functions.
[0069] For example, the electronic device in the embodiments of the present application may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook computer, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) or virtual reality (VR) device, etc. The embodiments of the present application do not impose any particular restrictions on the specific form of the electronic device.
[0070] Before describing in detail the widget content updating method provided by the embodiments of the present application, the structure of the electronic device is first introduced.
[0071] Reference Figure 5 , which is a hardware structure diagram of an electronic device provided in an embodiment of the present application. Taking the electronic device 500 as an example, the mobile phone may include a processor 510, an external memory interface 520, an internal memory 521, a universal serial bus (USB) interface 530, a charging management module 540, a power management module 541, a battery 542, an antenna 1, an antenna 2, a mobile communication module 550, a wireless communication module 560, a touch sensor 580A, a fingerprint sensor 580B, an audio module 570, a speaker 570A, a receiver 570B, a microphone 570C, an earphone interface 570D, a sensor module 580, a button 590, a motor 591, an indicator 592, a camera 593, a display 594, and a subscriber identification module (SIM) card interface 595, etc.
[0072] The processor 510 may include one or more processing units. For example, the processor 510 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into the same processor.
[0073] The controller is the decision-maker that directs the various components of the phone to coordinate operations according to instructions. It serves as the phone's nerve center and command center. Based on the instruction opcode and timing signals, the controller generates operation control signals to control instruction fetching and execution.
[0074] Processor 510 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 510 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 510. If processor 510 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of processor 510, and thus improves system efficiency.
[0075] The charging management module 540 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 540 can receive charging input from the wired charger via the USB interface 530. In some wireless charging embodiments, the charging management module 540 can receive wireless charging input via the wireless charging coil of the electronic device 500. While charging the battery 542, the charging management module 540 can also power the mobile phone via the power management module 541.
[0076] The power management module 541 is used to connect the battery 542, the charging management module 540, and the processor 510. The power management module 541 receives input from the battery 542 and / or the charging management module 540 and provides power to the processor 510, the internal memory 521, the external memory, the display 594, the camera 593, and the wireless communication module 560. The power management module 541 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 541 can also be set in the processor 510. In other embodiments, the power management module 541 and the charging management module 540 can also be set in the same device.
[0077] The wireless communication function of the electronic device 500 can be implemented through the antenna 1, the antenna 2, the mobile communication module 550, the wireless communication module 560, the modem processor and the baseband processor.
[0078] Electronic device 500 implements display functionality through a GPU, display screen 594, and an application processor. The GPU is a microprocessor for image processing that connects display screen 594 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 510 may include one or more GPUs that execute program instructions to generate or modify display information. Display screen 594 is used to display images, videos, and the like.
[0079] The sensor module 580 includes a touch sensor 580A, a fingerprint sensor 580B, and the like.
[0080] The touch sensor 580A is also referred to as a "touch panel (TP)." The touch sensor 580A can be disposed on the display screen 594. The touch sensor 580A and the display screen 594 form a touch screen, also referred to as a "touch screen." The touch sensor 580A is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operations can be provided through the display screen 594. In other embodiments, the touch sensor 580A can also be disposed on the surface of the electronic device 500, at a location different from that of the display screen 594.
[0081] In the embodiment of the present application, the touch sensor 580A can be used to detect the operation of moving the APP to the desktop application or the negative one screen application. If the operation is detected, the electronic device 500 displays the widget corresponding to the APP dragged by the user on the desktop application or the negative one screen application.
[0082] For example, refer to Figure 6 , which is a schematic diagram of generating a widget provided by an embodiment of the present application. Figure 6 (a) is a schematic diagram of desktop application; Figure 6 (b) is a schematic diagram of desktop card editing; Figure 6 (c) is a schematic diagram of dragging and dropping APP; Figure 6 (d) is the widget preview image; Figure 6 (e) is the widget display diagram. Figure 6 In (a), the desktop card is displayed on the display screen 594. After the touch sensor 580A detects a touch operation on the icon of the desktop card 601, the electronic device starts the desktop card 601 and enters the interface for editing the widget, that is, the desktop interface is switched to Figure 6 (b) shows the interface. Figure 6 In (b), after the touch sensor 580A detects the drag operation on the "Baidu™-Minimalist Style 4x1" icon 602, the electronic device switches to Figure 6 (c) shows the interface. Figure 6 In (c), the touch sensor 580A detects the user's operation of dragging and dropping the aforementioned icon 602 to the specified position and then lifting it up. The electronic device loads Baidu™ into the desktop application 603, so that the Baidu™ search box 604 is displayed in the form of a widget, and the display result is as follows: Figure 6As shown in (d); the electronic device displays a preview interface to facilitate the user to determine whether to remove the widget or adjust its position. If the touch sensor 580A detects a click operation outside the widget editing area in the preview interface, the electronic device switches to Figure 6 (e) displays the interface. Figure 6 In (e), Baidu™ is displayed on the desktop as a simple widget. When the touch sensor 580A detects a click operation on the search box 604 on the widget, the electronic device responds to the click operation by popping up an input box for the user to enter search content in the search box on the desktop.
[0083] It should be understood that the above description of the touch sensor 580A being used to generate a widget is merely general. In a specific implementation, the touch sensor 580A detects a touch operation and transmits the touch operation to the application processor to determine the type of touch event. When the touch event type is the aforementioned touch operation on a desktop card icon, the electronic device launches the desktop card application and enters the interface for editing the widget. In addition, the aforementioned drag-and-drop operation on the app and click operation on the widget can also be referred to in the above description, and the embodiments of the present application do not provide a cumbersome description of this.
[0084] The fingerprint sensor 580B can be used to collect fingerprint information. The electronic device 500 can use the fingerprint characteristics of the collected fingerprint information to verify the user's identity (i.e., fingerprint recognition) to achieve fingerprint unlocking, accessing application locks, fingerprint photography, fingerprint answering calls, etc.
[0085] The electronic device 500 can realize the shooting function through the ISP, camera 593, video codec, GPU, display screen 594 and APP processor.
[0086] The external memory interface 520 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 500. The external memory card communicates with the processor 510 via the external memory interface 520 to implement data storage functions. For example, media files such as music and videos can be stored on the external memory card.
[0087] The internal memory 521 can be used to store computer executable program codes, which include instructions. The processor 510 executes various functional APPs and data processing of the electronic device 500 by running the instructions stored in the internal memory 521. The internal memory 521 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an APP required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 500 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 521 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0088] The electronic device 500 can implement audio functions such as music playback and recording through the audio module 570, the speaker 570A, the receiver 570B, the microphone 570C, the headphone jack 570D, and the application processor.
[0089] Buttons 590 include a power button and volume buttons. Motor 591 can generate vibration prompts. Indicator 592 can be an indicator light that can be used to indicate charging status, power level changes, messages, missed calls, notifications, etc. SIM card interface 595 is used to connect a SIM card.
[0090] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 500.
[0091] Reference Figure 7 , which is a software structure block diagram of an electronic device provided in an embodiment of the present application. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime (Android runtime) and system library, and the kernel layer.
[0092] The application package can include APPs such as camera, calendar, map, video, music, short message, gallery, call, service, desktop, negative one screen, etc.
[0093] In the embodiment of the present application, the service (or service) includes the aforementioned widget system service. A service is an APP that can perform long-running operations in the background without providing an interface. The service can be started by other APPs, and even if the user switches to another APP, the service can continue to run in the background. For example, after the widget system service is started, it is invisible to the user, but it can run in the background and regularly broadcast application pull-up messages to the APP corresponding to each widget, so that the APP that receives the broadcast application pull-up message can be started in the background.
[0094] The application framework layer provides an application programming interface (API) and programming framework for the apps in the application layer. The application framework layer includes some predefined functions.
[0095] The application framework layer may include a window manager, content provider, view system, telephony manager, resource manager, notification manager, activity manager, and the like.
[0096] The window manager is used through the Window Manager Service (WM). The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0097] Content providers are used to store and retrieve data and make it accessible to apps. This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0098] The view system includes visual controls, such as those for displaying text and images. The view system is used to build apps. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0099] In the embodiment of the present application, the widget displayed on the desktop or the negative first screen of the electronic device 500 may be composed of one or more views. Among them, the widget may include a view that displays text and a view that displays an image. For example, the search widget includes a view that displays the application name and a view that displays the search icon.
[0100] The phone manager is used to provide communication functions of the electronic device 500, such as management of call status (including answering, hanging up, etc.).
[0101] The resource manager provides various resources for the APP, such as localized strings, icons, images, layout files, video files, etc.
[0102] The Notification Manager allows apps to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically, without requiring user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from apps running in the background, or as dialog windows on the screen. Examples include displaying text messages in the status bar, sounding notifications, vibrating electronic devices, and flashing indicator lights.
[0103] The Activity Manager can provide Activity Management Service (AMS), which can be used to start, switch, and schedule system components (such as activities, services, content providers, and broadcast receivers) as well as manage and schedule application processes.
[0104] In the embodiment of the present application, the widget system service registers a listener with the AMS to monitor whether the APP bound to the widget is started. When the APP bound to the widget is started, the content of the widget corresponding to the started APP is updated and the update time is recorded.
[0105] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.
[0106] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0107] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0108] The system library can include multiple functional modules, such as a surface manager, a 3D graphics processing library (e.g., OpenGL ES), a 2D graphics engine (e.g., SGL), and media libraries.
[0109] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple apps.
[0110] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0111] A 2D graphics engine is a drawing engine for 2D drawings.
[0112] The media library supports playback and recording of a variety of common audio and video formats, as well as static 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.
[0113] The kernel layer is the layer between hardware and software. The kernel layer contains at least camera driver, audio driver, sensor driver, etc.
[0114] refer to Figure 8 , which is a workflow diagram of an electronic device provided in an embodiment of the present application. Figure 8 , which illustrates the workflow of the software and hardware of the electronic device 500.
[0115] After detecting that the APP is moved to the location designated to accommodate the widget in the host program, the widget system service establishes a binding relationship between the APP and the application container in the host program (i.e. Figure 8 The widget system service also establishes a binding relationship between the widget and the application container in the host program. That is, the APP, the application container in the host program, and the widget are bound to each other. Based on the widget, the widget system service can determine the corresponding application container in the host program, and then the widget system service can determine the corresponding APP based on the application container. The binding relationship is used by the subsequent widget system service to pull up the APP to update the application information to the corresponding widget.
[0116] The widget system service then registers a listener with AMS in the background to monitor whether the app bound to the widget is launched. When the app launches, it retrieves the app's application information and updates the widget bound to the app, causing the widget to display the updated content. The widget system service also records the widget's update time, creating a widget update log.
[0117] The Android operating system predefines a timer. The widget system service starts the timer by calling the timer.start() function. When the timer expires, the widget system service checks whether there is a widget update record. If no widget update record exists, the widget system service broadcasts an application launch message to the apps corresponding to each widget, so that the apps can be launched at the scheduled time to update the widget. The timer then restarts and begins counting again. This cycle repeats until all apps corresponding to widgets are launched at the end of each timer countdown.
[0118] If a widget update record exists, it means that the app corresponding to the widget has been updated within a timer period. Therefore, when launching apps at the scheduled time, the app with the updated widget will not be launched. This prevents apps that have already been launched within a timer period from being launched again.
[0119] The widget content updating method provided in the embodiment of the present application can be applied to an electronic device having the above hardware structure and software structure. Taking a mobile phone as an example, the widget content updating method provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0120] Reference Figure 9 , which is an interaction diagram of a widget content update method provided by an embodiment of the present application. This method includes three steps: the first is the process of creating a widget, as described in S901-S904; the second is the process of updating the widget corresponding to the automatically launched target application, as described in S905-S914; and the third is the process of updating the widget corresponding to the target application that has not automatically launched when the timer expires, as described in S915-S922.
[0121] Here, self-starting means that the target application is not started by the widget system service, for example, self-starting includes: the target application is started by other applications; the target application is started by the user, etc. For details, please refer to the description of S907 below.
[0122] S901. The mobile phone starts the widget system service.
[0123] As mentioned earlier, a widget system service is an app that can perform long-running operations in the background without providing an interface. When the phone starts the widget system service, it runs in the background and is responsible for scheduling widget-related services, such as launching the app corresponding to the widget.
[0124] In some embodiments, the timing for launching the widget system service includes: upon detecting a touch operation on a desktop card icon, the mobile phone launches the widget system service. The desktop card icon is the icon displayed on the desktop for the widget system service. The desktop card icon corresponds to a control for triggering the widget system service. When a user touches the desktop card icon, the corresponding control can trigger the launch of the widget system service.
[0125] In this embodiment, the widget system service is disabled by default and is activated in response to a user touching a desktop card icon. Once activated, the widget system service is invisible to the user, but it can run in the background. The user can see the widget editing interface of the desktop card application. The user can create, delete, or modify widgets in this interface, and the widget system service can respond to user operations by creating, deleting, or modifying widgets in the background.
[0126] In some other embodiments, the timing for starting the widget system service includes: automatically starting the widget system service when the mobile phone is turned on.
[0127] In this embodiment, the widget system service can be started when the mobile phone is turned on. When the mobile phone is in sleep, screen-off or screen-on state, the widget system service can still perform long-term running operations in the background.
[0128] This embodiment can be applied to scenarios where at least one widget is loaded on a mobile phone. In this scenario, to update the content displayed by the widget, the widget system service needs to periodically launch the corresponding app of the widget. Therefore, the widget is automatically launched when the mobile phone is turned on to facilitate rapid updates of the widget's displayed content, thereby improving the user's convenience in using the widget.
[0129] S902: The host program detects that the target application is moved to an application container in the host program, and determines a widget corresponding to the target application.
[0130] The target application is the app that loads the widget, or App Widget Provider. Once the target application is moved to the application container within the host program, the content within the target application can be displayed within the host program. For example, in the aforementioned embodiment, once the weather application is moved to the application container within the host program, the weather icon within the weather application can be displayed within the host program, meaning that the user can browse weather information within the host program without having to launch the weather application.
[0131] It should be noted that the target application is the App Widget Provider of the widget, so the target application needs to be launched regularly to update the corresponding widget. Correspondingly, the non-target application in the following text is the app that does not load the widget. In the embodiment of this application, the app includes the target application and the non-target application.
[0132] The target application is moved to a host program to load the widget. The host program is the app that contains the widget. The host program includes the desktop, the negative one screen, etc.
[0133] Reference Figure 10 , which is a schematic diagram of the host program provided in an embodiment of the present application.
[0134] In some embodiments, the host program is Figure 10 The desktop 1001 (or desktop application) in (a), i.e., a widget, can be loaded on the desktop 1001 of the mobile phone. Specifically, the desktop 1001 of the mobile phone displays at least one widget. Whenever a widget is updated, the widget on the desktop 1001 displays the changed content. The widget content update method of the embodiment of the present application can avoid the situation where too many apps corresponding to the widgets on the desktop 1001 are updated simultaneously, resulting in high battery consumption and high memory usage of the electronic device.
[0135] In other embodiments, the host program is Figure 10 The negative one screen 1002 (or negative one screen application) in (b), that is, the widget can be loaded on the negative one screen 1002 of the mobile phone. Among them, the negative one screen 1002 is the leftmost screen of the desktop 1001, that is, the leftmost page of the desktop 1001 (or widget interface). The negative one screen 1002 displays at least one widget. Whenever the widget is updated, the content displayed by the widget on the negative one screen 1002 changes. The widget content update method of the embodiment of the present application can avoid the number of APPs corresponding to the widgets on the negative one screen 1002 being updated too much at the same time, resulting in large battery consumption and high memory usage of the electronic device.
[0136] It should be understood that Figure 10 (a) and Figure 10 (b) is only an example of two host programs using widgets applicable to the embodiments of the present application. The widget content update method provided in the embodiments of the present application can also be applied to other host programs using widgets.
[0137] In some embodiments, the host program creates an application container to house widgets. Each host program can include multiple application containers, each of which can load at least one widget. For example, two application containers can be created on the desktop: one for the QR code scanning widget and the payment code widget, and the other for the clock widget.
[0138] After executing the above process, the widget system service executes S903 to load the widget into the host program.
[0139] S903: The widget system service binds the target application to the application container in the host program.
[0140] The target application and application container each have a unique identifier. For example, the target application's unique identifier is the application name, which varies from one target application to another. The application container's unique identifier is its identity document (ID), which varies from one application container to another. The unique identifier can be used by the widget system service to establish a binding relationship between the target application and the application container.
[0141] After the target application is bound to the application container in the host program, the widget corresponding to the target application is bound to the host program, so that the widget can be loaded and displayed in the host program.
[0142] In the following example, the host application is the desktop and the target application is the browser. In response to the browser being moved to the desktop, the widget system service binds the browser to a specified location on the desktop (or the location of the application container). This loads the browser's corresponding search widget onto the desktop, allowing the user to execute the browser's search function on the desktop.
[0143] After the widget is loaded, the widget system service needs to regularly launch the target application to update the widget content. Based on this, after S903, the widget system service executes S904 to record the binding relationship. Through the binding relationship, the target program corresponding to the widget to be updated is launched in the background, thereby updating the widget.
[0144] S904: The widget system service records the binding relationship between the target application and the application container, and the binding relationship between the application container and the widget.
[0145] The binding relationship is also called a corresponding relationship. In some embodiments, the binding relationship is a corresponding relationship between the application name of the target application and the ID of the application container, and a corresponding relationship between the ID of the application container and the ID of the widget.
[0146] After the widget system service records the binding relationship, it can determine the application container and widget bound to (or corresponding to) the target application based on the target application. The widget system service then updates the widget when the target application starts and periodically launches target applications that have not been launched within a timer period. This can reduce the frequency of launching target applications and the number of applications launched at the same time, reducing battery consumption and memory usage of electronic devices, and improving the user experience with widgets. The specific implementation of updating widget content includes the following S905-S916.
[0147] S905 : The widget system service registers a listener with the AMS. The listener is used to monitor the startup status of the target application.
[0148] The startup status of the target application includes startup, exit, etc.
[0149] As mentioned earlier, the AMS manages and schedules application processes. For example, to launch an app process that includes the target application, the AMS sends a request to create the app process via a socket to the zygote process. The zygote receives the request and creates the app process. The AMS then updates the app's startup status.
[0150] The widget system service registers a listener with AMS, allowing the listener to monitor whether the target application is running in AMS. If the target application is running, the startup status is synchronized to the widget system service. If the target application is not running, such as when a non-target application is started, the startup status is not synchronized to the widget system service.
[0151] In some embodiments, the aforementioned monitoring of the startup status of the target application includes: the listener monitoring whether the AMS sends a request to create a process of the target application to the zygote process through the socket.
[0152] In this embodiment, the listener determines the startup status of the target application by listening for requests from the AMS to incubate the target application's process. Specifically, if the listener detects a request from the AMS to incubate the target application's process, it triggers synchronization of the startup status with the widget system service. If the listener detects a request from the AMS to incubate a process of a non-target application, or if the AMS does not issue an incubation request, the startup status is not synchronized with the widget system service.
[0153] S906: The widget system service startup timer starts timing.
[0154] In this embodiment, the timer is bound to all target applications, that is, the start time of all target applications is controlled by starting a timer. Taking the Android operating system as an example, the Android operating system can pre-define a timer and start the timer by calling the timer.start() function to start timing.
[0155] The timer is used to cycle time according to a preset timing cycle. Specifically, the timer starts timing, and after a timing cycle ends, the timer stops timing, and then the timer starts timing again, and so on.
[0156] The timer can be set to count up, such as 0s, 1s, 2s, 3s, and so on. T is the time period. In this design, when the timer reaches T, it will count up again, starting from 0s, 1s, 2s, 3s, and so on.
[0157] The timer can be designed to count down, such as a, an, a-2n...aT. In this design, when the timer reaches aT, it will count down again from a, an, a-2n...aT.
[0158] refer to Figure 11 , which is a schematic diagram of launching an application update widget during normal timer timing provided by an embodiment of the present application. During normal timing, the timer continuously cycles according to a preset timing cycle. After each timing cycle, the app is launched.
[0159] During the timer's timing process, if the user performs an operation to open the APP, the mobile phone executes S907-S908 below to start the APP.
[0160] S907 . In response to the operation of opening the APP, the APP sends a request to the AMS, where the request is used to start the application process.
[0161] It should be noted that the operation of opening an APP is an operation for the APP to automatically start. The APP automatically starts including: the APP is launched by other applications; the APP is launched by the user's instruction, etc.
[0162] Specifically, an app launched by another application includes: another app launching, detecting a request to jump to the app on the other app, and responding to the request. App launching. For example, a user opens a messaging app and clicks a web link on the messaging app's message screen. In response to clicking the web link, the phone launches a browser process, launching the browser.
[0163] An app is launched in response to a user instruction, including: the user touches the app icon, the control corresponding to the app icon triggers a request to launch the app, and the app is launched in response to the request. For example, when the user touches the camera icon, the camera control corresponding to the camera icon is pressed on the phone, and the camera control triggers a request to launch the camera app, and the camera app is launched in response to the request.
[0164] S908. In response to the request, the AMS starts the APP and updates the startup status of the APP.
[0165] As mentioned above, AMS can update the startup status of the APP. For example, after the APP is started, AMS updates the startup status of the APP from exited to started.
[0166] S909: AMS determines APP as the target application.
[0167] APP is the target application, indicating that it is the widget-loading app mentioned above, namely the App WidgetProvider. When this type of app is launched, the corresponding widget of the app is updated so that the widget can display the new content in the app. Therefore, the mobile phone executes S910 below.
[0168] S910. The AMS synchronizes the startup status of the APP to the widget system service.
[0169] Regarding the synchronization method of the startup state, please refer to the introduction of S905 above, and no redundant explanation will be given here.
[0170] After the widget system service obtains the app's startup status, the phone executes steps S911-S914 below to update the widget content when the app starts. By staggering the timing of widget content updates, this prevents multiple apps from being launched simultaneously and causing the phone to run multiple apps in the background. This reduces battery consumption and memory usage while the phone is running the widget service, resulting in a better user experience with widgets.
[0171] S911. The widget system service broadcasts a first message to the APP.
[0172] The first message is used to instruct the APP to send application information to the widget system service. The application information is used to update the display content of the widget corresponding to the APP.
[0173] S912: In response to the first message, the APP sends the application information displayed after startup to the widget system service.
[0174] In some embodiments, application information includes application data and remote views (or RemoteViews). RemoteViews are views that can run in other processes (such as the host program process). The host program can find and load the widget's interface layout file in the project package based on the package name provided by RemoteViews, thereby displaying the application data in the specified location on the interface.
[0175] S913: After monitoring application information, the host program triggers a callback function to obtain the application information.
[0176] In this step, the host program registers a listener in the widget system service to listen for update events. When application information is sent to the widget system service, an update event is triggered, and the host program triggers a callback function to obtain the application information.
[0177] S914. The host program updates the application information to the widget corresponding to the APP.
[0178] In some embodiments, the host program updates the application data in the application information to a designated location where the widget is located in the host program based on the remote view in the application information.
[0179] The following takes the weather application as an example to illustrate the specific implementation of the above S911-S914.
[0180] The weather application corresponds to the weather widget, and the weather widget displays weather content. Conventional technology obtains application information such as "showers" displayed in the afternoon by periodically launching the weather application corresponding to the weather widget, and updates the application information "cloudy" originally displayed on the weather widget with the application information "showers". In this embodiment, if the weather application is the target application, then when the weather application is launched, even if the timer has not stopped, the widget system service can still send a first message to the weather application to obtain the application information "showers" of the weather application, and update the content displayed by the widget based on the application information "showers". In this way, more real-time weather can be viewed directly on the host program (such as the desktop) without having to enter the weather application to see it. At the same time, the content of the weather widget is updated when the weather application is launched, so when the timer stops, the weather application does not need to be launched together with other apps that need to be launched. In this way, the number of apps running simultaneously in the background is reduced, which is less likely to cause the problem of high mobile phone memory usage affecting the running smoothness of the foreground app, thereby improving the user experience of the widget. Furthermore, in conventional technology, the weather app is started within the timer's timing cycle, and the weather widget is not updated. When the timer expires, the weather app is started again. In other words, the weather app is started twice within one timing cycle. This frequent app startup increases power consumption, resulting in a poor user experience. However, the embodiment of the present application only starts the app once within one timing cycle, reducing the number of app startups and the power consumption caused by starting the app, thereby improving the user experience.
[0181] After S914, the widget system service records the widget update time so that when the timer stops, it can determine whether to launch the app based on the update time. Here, "launching" the app means starting the app process so that it runs in the background. Launching the app is also called launching the app process. For details, please refer to the previous description.
[0182] S915. The widget system service records the update time of the widget and obtains a widget update record.
[0183] After the aforementioned S912 , the widget system service executes S913 to send the application information to the host program and records the update time of the widget so as to determine that the widget corresponding to the APP has been updated when the subsequent timer expires.
[0184] The widget update record includes update time, widget ID, etc.
[0185] The update time is used to determine whether the widget corresponding to the app has updated its content within a timer period. Specifically, taking T as the timer period, when the timer stops, the widget system service checks the update time: if the difference between the update time and the time point when the timer stops is less than T, it means that the widget has been updated, and the widget system service does not need to launch the app corresponding to the widget; conversely, if the difference between the update time and the time point when the timer stops is greater than or equal to T, it means that the widget has not been updated, and the widget system service broadcasts and launches the app corresponding to the widget, allowing the target applications to run in the background in batches.
[0186] Among them, the widget identifier is used to indicate the widget whose content has been updated. The widget system service determines the object (or APP) that needs to be blocked when broadcasting and pulling up the APP corresponding to the widget based on the widget identifier. In other words, the widget system service applies a targeted broadcast message to the first target application so that the APPs that receive the message can run in batches, and the objects that are blocked from broadcasting will not receive the targeted broadcast message, and will not be pulled up when the timer expires. In this way, when the timer expires, the number of APPs running in the background is small, and the mobile phone can process the pulled-up APPs at a low frequency (or low power consumption), thereby avoiding the excessive use of the mobile phone memory affecting the fluency of the APP running in the foreground.
[0187] It is worth noting that the aforementioned operation of launching the target application and updating the widget on the mobile phone does not interrupt or refresh the timer's timing process. In other words, after the timer starts and reaches a timing cycle, the timer will stop timing and trigger the widget system service to launch the APP to update the widget. In this method, if the first widget is not updated within the timing cycle, then at the end of the timing cycle, the electronic device launches the first application and at least one second application and updates the display content of the first widget and the display content of each second widget. The specific method is shown below.
[0188] S916: The timer stops timing.
[0189] S917. The widget system service queries the widget update record.
[0190] The update record indicates that the widget has been updated within the latest timing cycle of the timer.
[0191] For example, taking the case where the timer stops timing at time a+T, the widget system service queries whether there is an update record within the time period [a, a+T).
[0192] In some embodiments, the update record for the same widget can be replaced, and after each timing cycle, the update record is deleted. Figure 12 , which is a schematic diagram of an update record generation process provided by an embodiment of the present application. During the process, the timer starts when the mobile phone is turned on, corresponding to Figure 12 The timer starts at time T0 in the example, and then stops at times T2 (T0 + T) and T5 (T0 + 2T). During the first timer cycle, the app is launched for the first time at time T1, and the update record is "Widget 1, T1", indicating that the content of Widget 1 was updated at time T1. At the end of the first timer cycle, the update record is cleared. During the second timer cycle, the app is launched for the second time at time T3, and the update record is "Widget 1, T3", indicating that the content of Widget 1 was updated at time T3. Still within the second timer cycle, the app is launched for the third time at time T4, and the previous update record is overwritten, so the update record is "Widget 1, T4", indicating that the content of Widget 1 was updated at time t3. In this way, the widget system service queries the most recent update record of each app's corresponding widget in the most recent timer cycle. By overwriting update records and deleting update records after each cycle, the recorded data can be reduced and query efficiency improved.
[0193] S918: After the widget update record is found, the widget system service broadcasts the second message to the first target application.
[0194] The first target application (equivalent to the aforementioned second application) is an APP that has not been started in the latest timing cycle among the target applications. The second message here is equivalent to the aforementioned second instruction.
[0195] Based on the description in S909 above, it can be known that the target application has been started in the latest timing cycle. Then the widget system service will generate an update record for the widget corresponding to the target application. Therefore, in this step, the widget system service can query the update record of the widget. The widget system service will not broadcast the second message to the target application included in the update record to avoid the target application that has been started in the latest timing cycle being broadcast and pulled up. Based on this, the widget system service broadcasts the second message to the first target application in a targeted manner, so that the target application that has not been started in the latest timing cycle can receive the second message. Among them, the second message is used to indicate that the APP is started in the background.
[0196] S919: In response to the second message, the first target application is started in the background.
[0197] It should be understood that the broadcast here refers to a targeted broadcast, that is, the widget system service only sends the second message to target applications that have not been started in the latest timing cycle.
[0198] S920: The first target application sends application information to the widget system service.
[0199] S921: After monitoring application information, the host program triggers a callback function to obtain the application information. This step is equivalent to the above S913.
[0200] S922: The host program updates the application information to the widget that has not been updated within one timing cycle.
[0201] The widget corresponding to the first target application is equivalent to the aforementioned first widget.
[0202] The above embodiment introduces the scenario where an APP is started within a timing cycle and the APP is the target application. In some embodiments, an APP is started within a timing cycle, but the APP is a non-target application. The process of the widget system service pulling up the APP update widget in this scenario can be seen in Figure 13 and the following description.
[0203] In this embodiment, after the mobile phone executes the aforementioned S901-S908, it executes S1301 and subsequent steps.
[0204] S1301: AMS determines that the APP is a non-target application.
[0205] The app is not the target application, indicating that the launched app is not the App Widget Provider that loads the widget. Therefore, skip S910-S915 and go directly to S916.
[0206] S916: The timer stops timing.
[0207] S917. The widget system service queries the widget update record.
[0208] S1302: If no widget update record is found, the widget system service broadcasts a second message to all target applications.
[0209] If no widget update record is found, it means that the target application has not been started in the latest timing cycle, then the widget system service broadcasts a second message to instruct the target application to launch and update the widget. The second message here is equivalent to the third instruction mentioned above.
[0210] It should be understood that the broadcast here refers to a targeted broadcast, that is, the widget system service only broadcasts the second message to the target application, and does not send the second message to APPs that are not target applications. Directed broadcasting can prevent APPs that do not provide widget services from being launched.
[0211] S1303: In response to the second message, all target applications are started in the background.
[0212] As explained above, after creating a widget, the target application, the application container in the host program, and the widget are bound to each other. Based on this binding relationship, the corresponding app (or target application) for the widget can be determined. This allows the widget system service to broadcast a second message to the target application, which then receives the second message and, in response, launches in the background of the phone.
[0213] It should be understood that when the target application is started in the background, the mobile phone starts the main process and service process of the target application and starts the resource information related to the application display interface. Therefore, after the target application is started, it is not visible to the user, but it can run in the background.
[0214] S1304. All target applications send application information to the widget system service.
[0215] S1305: After monitoring application information, the host program triggers a callback function to obtain the application information. This step is equivalent to the above S913 and S921.
[0216] S1306: The host program updates the application information to the widget corresponding to each target application.
[0217] In this embodiment, if no target application is started within a timing cycle, the widget corresponding to the target application will not be updated during that timing cycle. Therefore, when the timer stops, the widget system service starts the processes of all target applications so that the target applications can update the application information to the widget after they are started.
[0218] In summary, by adopting the method of the embodiment of the present application, the widget can be updated when the corresponding APP is started, and an update record is generated through the widget system service. So that when the timer expires, the widget system service does not broadcast the second message to the APP that has been started within a timing cycle. In this way, the APP that has been started will not be started again when the timer expires. Therefore, while ensuring the demand for widget content updates, it solves the problem that the method of regularly pulling up the APP corresponding to the widget leads to too many APPs running in the background, resulting in high battery consumption and high memory usage of electronic devices.
[0219] In this embodiment, the time between the update time of the first widget and the end time of the timing cycle is less than or equal to one timing cycle, indicating that the first widget has been updated at least once within one timing cycle. This ensures that the display content of the widget is updated in a timely manner.
[0220] In the embodiments described in S901-S1306 above, the method of recording the update record of the widget system service is mainly used to illustrate that the widget system service records the update time of the APP starting to update the widget. In actual implementation, this method causes the widget system service to query the update record once every time the timer expires. Based on this, the embodiment of the present application also provides a widget content update method, referring to Figure 14 , which is an interaction diagram of another widget content update method provided by an embodiment of the present application. In this method, the widget system service can record the update time of the widget by refreshing the timer. Specifically, in this method, if it is detected that the first application is started within the first timing cycle, the electronic device updates the display content of the first widget loaded by the first application, and updates the update time point of the first widget to the start time point of the next first timing cycle. Specifically, the method includes: S901-S914 and S1401-S1407 below.
[0221] For details about S901-S914, please refer to the previous description. The following details the implementation process of S1401-S1407.
[0222] In S1401-S1407, each timer can be bound to a target application to separately time the launch cycle of the target application. The start time of the timer corresponds to the start time of the timing cycle of the target application to which it is bound (equivalent to the first timing cycle mentioned above), and the stop time of the timer corresponds to the end time of the timing cycle of the target application to which it is bound. For each APP startup and widget update process, the following S1401 and subsequent steps can be executed cyclically.
[0223] S1401: The widget system service refreshes the timer, and the timer restarts.
[0224] It should be noted that this step is executed after S912. That is, after the aforementioned S912, the widget system service executes S913 to send the application information to the host program on the one hand, and on the other hand executes this step to refresh the timer. The purpose of refreshing the timer is to update the update time point of the first widget to the starting point of the next timing cycle, thereby extending the time point for launching the first application next time.
[0225] The timer may be refreshed during the timing process. For example, the widget system service may refresh the timer to reset the timing cycle.
[0226] Taking T as an example, the timer normally counts in positive numbers, such as 0s, 1s, 2s, 3s... If the widget system service refreshes the timer when the timer reaches 3s, the timer will count 3 seconds later as follows: 0s, 1s, 2s, 3s... T. That is, when the timer is refreshed, the timer counts as 0s, 1s, 2s, 3s, 0s, 1s, 2s, 3s... T.
[0227] In this design, the refresh timer is equivalent to recording the update time of the widget, that is, the time point when the timer starts counting represents the update time of the widget.
[0228] Reference Figure 15 , which is a schematic diagram of a refresh timer when updating a widget provided by an embodiment of the present application. Figure 15 In the figure, T0 represents the time when the phone is turned on. In conventional technology, after the phone is turned on, the APP is launched in batches every T minutes to update the widget, so the APP will be broadcast and launched at T2. Then the memory usage of the phone increases at T2, which may affect the smoothness of the APP running in the foreground, such as causing the APP running in the foreground to freeze, thus affecting the user experience. In this embodiment, since the APP corresponding to the widget is launched at T1 (i.e. Figure 15 As shown in the figure, the APP is running at time T1, so the widget content is updated at time T1. That is, time T1 is the time point when the APP starts to update the widget. The widget system service then refreshes the timer, causing the timer to restart from time T1. When a timing cycle T ends, that is, when the time point reaches time T3 (T3 = T1 + T), the APP corresponding to the widget is launched, and then the widget content is updated in batches. That is, time T3 is the time point when the APP is launched and the widget is updated.
[0229] contrast Figure 15 The difference between T1 and T3, and the difference between T1 and T3, clearly show that conventional technologies have short app launch intervals and high app launch frequency; whereas this embodiment has long app launch intervals and low app launch frequency. Therefore, compared to widget updates, this embodiment achieves the beneficial effect of less frequent app launches by updating the widget as the app launches, thereby reducing battery consumption and memory usage on the phone and improving the user experience.
[0230] As explained above, if the target application isn't launched within a timer period, the widget system service will launch all target applications every other timer period to update the corresponding widget content. Therefore, after the timer is refreshed, if the target application isn't launched within a timer period, the timer will stop counting. See the following for details.
[0231] S1402: The timer stops timing.
[0232] When the timer stops, it means that the target application has not been started within a timing cycle, so the widget system service needs to launch the app to update the widget content. In other words, unlike S916, the time interval between the time when the timer stops and the time when it starts in this step is not a timing cycle T.
[0233] In this step, the timer stops timing, and there is no need to query the update record. Instead, the widget system service broadcast is directly triggered to launch the APP.
[0234] S1403: The widget system serves the second target application to broadcast a third message.
[0235] Among them, the second target application (equivalent to the aforementioned first application) is the APP bound to the timer described in S1402 in the target application. The third message (equivalent to the aforementioned first instruction) is used to instruct the second target application to start in the background. In the case where the timer is bound to the APP, the widget system service can broadcast the third message to the APP bound to the timer. Only the APP bound to the timer will receive the third message. This can prevent APPs that are not bound to the timer from being pulled up.
[0236] S1404: In response to the third message, the second target application is started in the background.
[0237] S1405: The second target application sends application information to the widget system service.
[0238] S1406: After monitoring application information, the host program triggers a callback function to obtain the application information. This step is equivalent to the above S913.
[0239] S1407: The host program updates the application information to the widget corresponding to the second target application.
[0240] Then execute S1401 to restart the timer. During the timing process, if the target application is started (equivalent to the aforementioned S907-S909), the widget system service executes S1401 again to refresh the start time of the timer. If a non-target application is started (equivalent to the aforementioned S907, S908, 1301), or no APP is started, the widget system service will not pull up the APP process. Until the timer stops timing, the widget system service pulls up the APP corresponding to the timer to update the widget content (equivalent to the aforementioned S1402-S1407). According to the above cycle, the widget system service can only pull up the process of the second target application to update the widget when the timer ends.
[0241] In summary, using the method of this embodiment, the widget system service binds a timer to each target application, and each timer counts a target application separately. Whenever the target application is started within the timing period of the timer, the timer corresponding to the target application is refreshed. In this way, the expiration time of the timer can be delayed without affecting the update of the widget content. Since the startup time and startup frequency of different target applications will be different, the expiration time of the timer corresponding to each target application will also be different. In this way, the content update time points of the widget can be staggered to avoid multiple APPs being pulled up at the same time, causing the mobile phone to run multiple APPs in the background. In this way, when the mobile phone starts the widget service, the battery consumption and memory occupancy are reduced, so the widget brings a better user experience. At the same time, the widget system service does not have to record the update time of each widget separately, so it will not occupy too much memory resources, and it also avoids the problem of excessive content occupancy caused by the widget system service frequently reading and writing files.
[0242] It should be noted that the execution order of the steps described above is merely exemplary and does not limit the execution order of the steps. The steps may be executed in other orders. This is not intended to indicate that the execution order described is the only order in which these operations may be executed. A person of ordinary skill in the art would be able to conceive of various ways to reorder the operations described in the embodiments of this application.
[0243] Based on the above description, if the APP is detected to be started within the timing period, the mobile phone will execute the following Figure 9 or Figure 14 In some embodiments, if the APP is not detected to be started within a timing cycle, the mobile phone executes the above Figure 3 The steps described above, namely, the widget system service will launch all apps after the timer expires to update the corresponding widget content, are not described in detail in this embodiment of the present application.
[0244] To facilitate understanding of the above embodiments, a complete process example is used below to illustrate the present application scheme and its effects.
[0245] Reference Figure 16 , which is a flowchart of a method for updating widget content provided by an embodiment of the present application. The method may include:
[0246] S1601: The mobile phone starts the widget system service. See the description of S901 above.
[0247] S1602 : In response to the operation of moving the App Widget Provider to the App Widget Host, the Widget system service creates a widget.
[0248] The App Widget Provider is equivalent to the aforementioned target application, and the App Widget Host is equivalent to the aforementioned host application. This step can be referred to in S902-S904 above.
[0249] S1603: The widget system service registers a listener with the AMS. See the description of S905 above.
[0250] S1604: The widget system service startup timer starts timing. See the description of S906 above.
[0251] It should be noted that the timing of starting the timer is optional. For example, the timer can be started when the phone is turned on. After the timer is started, the listener monitors the startup status of the target application during the timer timing process.
[0252] S1605: AMS starts the APP. See the description of S907-S908 above.
[0253] S1606: AMS determines whether the APP is the target application.
[0254] S1607: If yes, the AMS synchronizes the APP's startup status to the widget system service. See the description of S909-S910 above.
[0255] Then, the mobile phone executes S1609.
[0256] S1608: If not, the AMS does not synchronize the startup status of the APP to the widget system service.
[0257] It should be understood that the widget system service registers a listener with the AMS to monitor the target application launch event. Therefore, if the launched app is not the target app, the listener will not detect the event. In other words, the AMS will not synchronize the launch status of non-target apps with the widget system service. The phone then waits for the timer to expire and executes step S1611 below.
[0258] S1609: The widget system service updates the corresponding widget based on the application information of the APP. See the description of S911-S914 above.
[0259] After S1609, the phone can execute either of the following two branches. The following first describes the specific steps of the left branch.
[0260] S1610: The widget system service records the update time of the widget and obtains the widget update record. See the description of S915 above.
[0261] S1611: If the timer stops, the widget system service queries the widget update record. See the description of S916-S917 above.
[0262] S1612: The widget system service determines whether an update record is found.
[0263] S1613: If yes, the widget system service broadcasts the second message to the first target application.
[0264] S1614. In response to the second message, the first target application is started in the background.
[0265] S1615: The widget system service updates the corresponding widget based on the application information of the first target application.
[0266] S1616: If not, the widget system service broadcasts a second message to all App Widget Providers. See the description of S918-S919 above.
[0267] S1617: In response to the second message, all App Widget Providers are started in the background (see the description of S920 above).
[0268] S1618: The widget system service updates the corresponding widget based on the application information of all App Widget Providers (see the description of S921 above).
[0269] The following first introduces the specific steps of the right branch after S1609.
[0270] S1619: The widget system service refreshes the timer, and the timer restarts. See the description of S1601 above.
[0271] S1620: If the timer stops timing, the widget system service broadcasts a third message to the target application and the second target application.
[0272] If the target application is not started within the timing period, the widget system service broadcasts a third message to launch the APP when the timer stops. For details, please refer to the description of S1402 or S1603 above.
[0273] S1621: In response to the third message, the second target application is started in the background (see the description of S1604 above).
[0274] S1622: The widget system service updates the widget based on the application information of the second target application. See the description of S1605 above.
[0275] Some other embodiments of the present application provide an electronic device, which may include: the above-mentioned display screen (such as a touch screen), a memory and one or more processors. The display screen, the memory and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can perform the various functions or steps performed by the mobile phone in the above-mentioned method embodiment. The structure of the electronic device can refer to Figure 5 The structure of the electronic device 500 is shown.
[0276] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes the various functions or steps executed by the mobile phone in the above-mentioned method embodiment.
[0277] The embodiment of the present application further provides a computer program product, which, when executed on a computer, enables the computer to execute the functions or steps executed by the mobile phone in the above method embodiment.
[0278] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0279] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0280] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0281] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0282] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0283] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for updating widget content, characterized in that: Used in electronic equipment, including: Each application corresponds to a timer, and the timer is used to separately time the timing period of the application; if it is detected that a first application is started within the first timing period of the corresponding timer, the display content of the first widget loaded by the first application is updated, and the update time point of the first widget is updated to the start time point of the next first timing period; At the end of the first timing cycle, at least one second application is started in the background and the display content of each second widget loaded by the second application is updated; the at least one second application does not include the first application.
2. The method according to claim 1, characterized in that The method further comprises: If, at the end of the first timing period, the first application is not started within the first timing period, starting the first application and updating the display content of the first widget; The update time point of the first widget is updated to the start time point of the next first timing cycle.
3. The method according to claim 1 or 2, characterized in that The method further comprises: If it is detected that the second application is started within the second timing cycle, the display content of the second widget loaded by the second application is updated, and the update time point of the second widget is updated to the start time point of the next second timing cycle.
4. The method according to claim 1 or 2, characterized in that If it is detected that the first application is started within the first timing period, updating the display content of the first widget loaded by the first application includes: monitoring the startup status of the first application within a corresponding first timing period; If the startup state of the first application is monitored within the first timing period, the display content of the first widget loaded by the first application is updated.
5. The method according to claim 1 or 2, characterized in that The starting the first application and updating the display content of the first widget loaded by the first application includes: Launching the first application; Application information displayed after the first application is started is acquired to update display content of the first widget.
6. A method for updating widget content, characterized in that: Used in electronic equipment, including: When a first application is launched, the display content of a first widget loaded by the first application is updated; if the first widget is updated within a timing period, at the end of the timing period, at least one second application is launched in the background and the display content of each second widget loaded by the second application is updated; the at least one second application does not include the first application; if the first widget is not updated within the timing period, at the end of the timing period, the first application and the at least one second application are launched and the display content of the first widget and the display content of each second widget are updated.
7. The method according to claim 6, characterized in that If the first widget is updated within the timing period, at the end of the timing period, starting at least one second application and updating the display content of each second widget loaded by the second application; The at least one second application does not include the first application, including: If the first widget is updated within the timing period, sending a second instruction to the at least one second application at the end of the timing period; the at least one second application does not include the first application; In response to the second instruction, the at least one second application is started and the display content of each second widget loaded by the second application is updated.
8. The method according to claim 7, characterized in that After updating the displayed content of the first widget loaded by the first application when the first application is started, the method further includes: Recording an update time point of the first widget to obtain a widget update record, wherein the widget update record is deleted after each timing period ends; If the first widget is updated within the timing period, sending the second instruction to the at least one second application at the end of the timing period includes: At the end of the timing period, if the widget update record of the first application is found, the second instruction is sent to the at least one second application.
9. The method according to claim 6, characterized in that After updating the displayed content of the first widget loaded by the first application when the first application is started, the method further includes: Recording an update time point of the first widget to obtain a widget update record, wherein the widget update record is deleted after each timing period ends; If the first widget is not updated within the timing period, starting the first application and the at least one second application and updating the display content of the first widget and the display content of each of the second widgets at the end of the timing period includes: At the end of the timing period, if no widget update record is found, sending a third instruction to the first application and the at least one second application; In response to a third instruction, the first application and the at least one second application are started and the display content of the first widget and the display content of each of the second widgets are updated.
10. The method according to claim 6, characterized in that If the first widget is updated within the timing period, then at the end of the timing period, starting at least one second application and updating the display content of each second widget loaded by the second application includes: monitoring the startup status of the first application and the second application within the timing period; If the startup status of the second application is not detected at the end of the timing period, but the startup status of the first application is detected, at the end of the timing period, at least one second application is started and the display content of each second widget loaded by the second application is updated.
11. The method according to claim 6, characterized in that The duration between the update time point of the first widget and the end time point of the timing cycle is less than or equal to one timing cycle.
12. The method according to claim 6, characterized in that When the first application is started, updating the display content of the first widget loaded by the first application includes: When the first application is started, sending a widget update message to the first application; In response to the widget update message, application information displayed after the first application is started is acquired to update display content of the first widget.
13. An electronic device, characterized in that: include: A processor, a memory for storing the processor-executable instructions, wherein when the processor is configured to execute the instructions, the electronic device implements the method according to any one of claims 1 to 5 or the method according to any one of claims 6 to 12.
14. A computer-readable storage medium having computer program instructions stored thereon; characterized in that: When the computer program instructions are executed by an electronic device, the electronic device implements the method according to any one of claims 1 to 5 or the method according to any one of claims 6 to 12.
Citation Information
Patent Citations
Method and mobile terminal for displaying applications through widget
CN104461233A
Application updating method and device and storage medium
CN110489138A