Application starting method and electronic device
By identifying the application's display mode and matching the color mode in electronic devices, the problem of large color contrast between the startup window and the main interface during cold starts is solved, improving the display effect and user experience.
Patent Information
- Application Number
- CN202411628333.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-11-14
AI Technical Summary
During a cold start, the application's startup window has a large color contrast with the main interface, resulting in a poor user experience.
By receiving user input from electronic devices, the system identifies the application's display mode and displays the startup window and interface in a matching color mode during cold starts, ensuring color consistency and reducing flicker.
The display effect and user experience of cold starts have been improved. By matching the color mode, the color contrast between the startup window and the main interface has been reduced, thus improving the consistency of the display style.
Smart Images

Figure CN119127343B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal, and in particular, to a starting method of an application and an electronic device. BACKGROUND
[0002] Most electronic devices are installed with different types of application programs (application, APP). The starting mode of the application program (application for short) usually includes cold start. When starting the application (such as a video application) in cold start, the electronic device can display a starting window, which can include starting content provided by the video application. Then, the electronic device can display an advertisement page of the video application. Finally, the electronic device displays a main interface of the video application for the user to browse videos through the main interface.
[0003] However, the display effect of the cold start may be poor at present, resulting in poor user experience. SUMMARY
[0004] Embodiments of the present application provide a starting method of an application and an electronic device, which are used to avoid a large color contrast between a starting window and a main interface displayed by a cold start application, improve the consistency of the display style, and thus improve the display effect of the cold start.
[0005] To achieve the above object, embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a starting method of an application is provided, which includes: being applied to an electronic device. The electronic device receives a first operation input by a user, the first operation being used to trigger starting a first application, and a display mode of the first application being a first color mode. In response to the first operation, in the absence of a process and an activity of the first application, the electronic device displays a starting window in a first color matched with the first color mode.
[0007] In response to the stopping of the display of the starting window, the electronic device continues to display an advertisement interface of the first application, the color of the advertisement interface being matched with a second color mode, and the second color mode being different from the first color mode.
[0008] Then, in response to the stopping of the display of the advertisement interface, the electronic device displays a first interface of the first application in a second color matched with the first color mode.
[0009] In the present application, during the display mode of the first application is the first color mode, when the first application needs to be started, if there is no process and activity of the first application currently, the electronic device performs cold start. Even if the color of the advertisement interface of the first application on which the start window of the first application depends matches the second color mode instead of the first color mode, the electronic device can still display the start window in a color matching the first color mode. After the start window and the advertisement interface are displayed in turn, the electronic device displays the first interface of the first application in a second color matching the first color mode, ensuring the consistency of the display mode, i.e. the color mode, of the first interface and the start window, thereby avoiding a large color contrast between the first interface and the start window, improving the consistency of the display style when the first application is cold started, and being able to reduce the flicker feeling, improve the display effect of the cold start, and improve the user experience.
[0010] The first color and the second color can be the same color, such as both being black. However, they can also be different colors, but both match the second color mode.
[0011] Optionally, the first color mode can be a dark mode or a light mode. The first color mode is different from the second color mode, and the second color mode can be a light mode or a dark mode.
[0012] In a possible design, the determination of the display mode of the first application can be determined through the interface of the first application. Before receiving the first operation, i.e. before cold starting the first application, the electronic device can run the first application in the foreground and display a second interface of the first application. The electronic device can determine the display mode of the first application based on the interface state when the second interface is displayed.
[0013] Based on this, after determining the display mode of the first application, the electronic device can display the start window in a color matching the determined display mode of the first application when cold starting next time.
[0014] In a possible design, the process of determining the display mode of the first application based on the interface state when the second interface is displayed can include that the electronic device can take a screenshot of the second interface based on the interface state when the second interface is displayed, to obtain a screenshot result of the second interface; wherein the screenshot result of the second interface includes the background of the second interface. Then, the electronic device can determine the display mode of the first application based on the background color value of the screenshot result.
[0015] Based on this, the electronic device identifies the background color of the screenshot result of the second interface based on the interface state of the second interface, to obtain the background color value of the second interface, so that the electronic device determines the display mode of the first application by using the background color value, to realize accurate determination of the display mode of the first application.
[0016] In a possible design, the interface state includes whether the electronic device displays a status bar when displaying the second interface. When the interface state is that the status bar is displayed, the screenshot result of the second interface includes all layers of the second interface. When the interface state is that the status bar is not displayed, the screenshot result of the second interface includes a background layer of the second interface.
[0017] Based on this, when the interface state is that the status bar is displayed, the second interface displayed by the electronic device includes the actual background of the second interface, and therefore, the electronic device can directly take a screenshot of the entire second interface, to determine the background color value of the second interface by using the screenshot.
[0018] When the interface state is that the status bar is not displayed, the actual background of the second interface can be covered by the content displayed by the second interface, and therefore, the electronic device needs to determine the background layer of the second interface that includes the actual background of the second interface, to determine the background color value of the second interface by using the screenshot of the background layer, and to accurately determine the background color value of the second interface.
[0019] In a possible design, when the second interface includes a surfaceview layer, the background layer includes layers of the second interface except the surfaceview layer. When the second interface does not include the surfaceview layer, the background layer includes layers of the second interface except the topmost layer. Based on this, the background layer of the second interface is determined based on the specific type of the second interface, to accurately determine the background layer.
[0020] In a possible design, the display mode of the first application can be set as a first color mode or a second color mode. The background color value based on the screenshot result is used to determine the display mode of the first application, including:
[0021] When the background color value matches the first color mode, the electronic device can determine that the display mode of the first application is the first color mode. When the background color value matches the second color mode, the electronic device can determine that the display mode of the first application is the second color mode.
[0022] Based on this, the electronic device determines whether the background color value is close to the first color mode, to determine whether the display mode of the first application is the first color mode, to accurately determine the color mode of the first application.
[0023] In a possible design, the matching of the background color value and the first color mode includes that a difference between the background color value and a color threshold corresponding to the first color mode is within a difference range corresponding to the first color mode, a difference between the background color value and a color threshold corresponding to the second color mode is not within a difference range corresponding to the second color mode, the background color value is within a color value range corresponding to the first color mode, or the background color value is not within a color value range corresponding to the second color mode.
[0024] In a possible design, before determining the display mode of the first application based on the interface state in which the second interface is displayed, the electronic device can determine whether the size of the installation package of the first application is greater than or equal to a preset size. In the case where the size is greater than or equal to the preset size, it is indicated that the startup window displayed when the first application is cold started is added by the electronic device, and the color of the startup window can be modified by the electronic device. Therefore, the electronic device can continue to determine the display mode of the first application to calibrate the color of the startup window through the display mode of the first application.
[0025] In the case where the size is less than the preset size, it is indicated that the startup window displayed when the first application is cold started is the behavior of the first application itself, and the color of the startup window cannot be modified by the electronic device. Therefore, the electronic device does not need to determine the display mode of the first application.
[0026] In a possible design, the display mode of the first application described above can be determined when the first application is last cold started. The electronic device receives a second operation input by a user; wherein the second operation is used to trigger the startup of the first application. In response to the second operation, in the absence of a process and an activity of the first application, a startup window is displayed, and the color of the startup window is recorded.
[0027] In response to the startup window stopping being displayed, the electronic device can display an advertisement interface. Subsequently, in response to the advertisement interface stopping being displayed, a second interface is displayed, so that the electronic device determines the display mode of the first application by using the second interface.
[0028] Optionally, the second interface can be a main interface of the first application. The electronic device can obtain an identifier of the main interface, so as to determine whether the currently displayed interface is the main interface by using the identifier of the main interface, and then determine the display mode of the first application in a timely manner by using the main interface.
[0029] In a possible design, the determination of the display mode of the first application, that is, the color mode, can be performed when the first application is backgrounded. The electronic device receives a third operation; wherein the third operation is used to trigger the background running of the first application.
[0030] In response to the third operation, the electronic device determines the display mode of the first application based on an interface state when the second interface is displayed.
[0031] Based on this, during use of the first application, the user can modify the display mode of the first application, and therefore, the electronic device can determine the display mode of the first application when the first application is backgrounded, thereby achieving accurate determination of the latest display mode of the first application.
[0032] In a possible design, after determining that the display mode of the first application is the first color mode, the electronic device can set the background color of the startup window to the first color, or set the display mode of the startup window to the first color mode.
[0033] Correspondingly, the above-mentioned display of the startup window in the first color means that the background color of the startup window is the first color. Similarly, the above-mentioned display of the first interface in the second color means that the background color of the first interface is the second color.
[0034] Based on this, since the startup window is added by the electronic device, the electronic device can directly modify the background color or the display mode of the startup window, so that when the first application is cold started, the startup window can be displayed in a color matching the first color mode, thereby ensuring the consistency of the startup window with the display style of the first application.
[0035] In a possible design, after the first application is backgrounded, if the first application meets a condition for stopping background running, the electronic device can delete the activity of the first application and the process of the first application, so that when the first application is started again, the electronic device cold starts the first application.
[0036] In a second aspect, the present application provides an electronic device, which includes a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; the camera is used to capture images, the display screen is used to display images generated by the processor, the memory is used to store computer program codes, the computer program codes include computer instructions; when the processor executes the computer instructions, the electronic device executes the application startup method as described above.
[0037] In a third aspect, the present application provides a chip, which includes a communication interface and at least one processor:
[0038] The communication interface is used to input and / or output signaling or data;
[0039] The at least one processor is used to execute a computer program to implement the application startup method as described above.
[0040] In a fourth aspect, the present application provides a computer readable storage medium, comprising computer instructions, which, when executed on an electronic device, cause the electronic device to perform the application starting method as described above.
[0041] In a fifth aspect, the present application provides a computer program product, which, when executed on an electronic device, causes the electronic device to perform the application starting method as described above.
[0042] It can be understood that the electronic device of the second aspect, the chip of the third aspect, the computer readable storage medium of the fourth aspect, and the computer program product of the fifth aspect can achieve the beneficial effects of the first aspect and any possible design of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0043] Figure 1 A schematic diagram of a starting scene provided by an embodiment of the present application Figure One ;
[0044] Figure 2 A schematic diagram of a returning to desktop scene provided by an embodiment of the present application
[0045] Figure 3 A schematic diagram of a returning to desktop scene provided by an embodiment of the present application
[0046] Figure 4 A schematic diagram of a starting scene provided by an embodiment of the present application Figure Two ;
[0047] Figure 5 A schematic diagram of a starting scene provided by an embodiment of the present application Figure Three ;
[0048] Figure 6 A schematic diagram of a starting scene provided by an embodiment of the present application Figure Four ;
[0049] Figure 7 A schematic diagram of a color mode setting provided by an embodiment of the present application Figure One ;
[0050] Figure 8 A schematic diagram of a dark mode scene provided by an embodiment of the present application
[0051] Figure 9 A schematic diagram of a color mode setting provided by an embodiment of the present application Figure Two ;
[0052] Figure 10 A schematic diagram of a non-immersive interface provided by an embodiment of the present application
[0053] Figure 11 A schematic of a start-up scenario provided for an embodiment of the application Figure Five ;
[0054] Figure 12 A schematic of a start-up scenario provided for an embodiment of the application Figure Six ;
[0055] Figure 13 A schematic of a hardware structure of an electronic device provided for an embodiment of the application Figure One ;
[0056] Figure 14 A schematic of a software structure of an electronic device provided for an embodiment of the application
[0057] Figure 15 A flowchart of a cold start method provided for an embodiment of the application Figure One ;
[0058] Figure 16 A flowchart of a cold start method provided for an embodiment of the application Figure Two ;
[0059] Figure 17 A schematic of a hardware structure of an electronic device provided for an embodiment of the application Figure Two ;
[0060] Figure 18 A schematic of a chip system provided for an embodiment of the application DETAILED DESCRIPTION
[0061] For the convenience of clearly describing the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "exemplary" or "for example" are used to represent an example, illustration, or description. Any embodiment or design solution described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or having more advantages than other embodiments or design solutions. Rather, the words "exemplary" or "for example" are intended to present the relevant concept in a specific manner. In the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. The association relationship of the associated objects is described by "and / or", which means that there can be three kinds of relationships, for example, A and / or B, which can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one (or more) of the following" or similar expressions means any combination of these items, including any combination of single (or more) items. For example, at least one of a, b, or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple. In the embodiments of the present application, "first", "second", "1", "2" are used for description purposes only, and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features limited by "first" and "second" can explicitly or implicitly include one or more of the features. In the description of the embodiments, unless otherwise specified, "multiple" means two or more.
[0062] For the convenience of understanding the technical solutions of the present application, the following introduces the terms related to the present application.
[0063] The starting mode of the application program includes cold start and hot start.
[0064] Cold start refers to the starting mode from nothing to something of the process of the application program. Before the application is started, the electronic device does not exist the process of the application. During the starting of the application, the electronic device creates the process of the application and also creates the activity of the application. For example, when the application is started for the first time after the electronic device is powered on, or the application is started again after the process of the application is cleaned, it can be called cold start.
[0065] Hot start refers to the starting mode in which the process and activity of the application exist. After the application is switched from the foreground to the background, the electronic device restarts the application. When the application is restarted, since the process and activity of the application exist, the electronic device does not need to create the process and activity of the application. For example, when the electronic device restarts the application in response to the click operation of the user on the card of the application displayed in the background during the application is in the background, it can be called hot start.
[0066] It should be noted that the activity of the application is used to implement the interface (or interface, window) of the application. The activity of the application can belong to the process of the application, and the activity of the application can run in the process of the application.
[0067] The following describes the two starting modes described above by taking a video application as an example. As shown in Figure 1 After starting, the mobile phone displays a desktop 10. The desktop 10 includes an icon 11 of the video application. In response to a click operation of the user on the icon 11 of the video application, the mobile phone starts the video application, creates a process and an activity of the video application, and displays a starting window 12 including starting content 13, such as a logo of the video application. Then, the mobile phone can display an advertisement page (i.e., an advertisement interface) 14 of the video application. In response to a click operation of the user on a skip control 15 on the advertisement page 14, the mobile phone can skip the advertisement page 14 and display an interface 16 of the video application, which can be a main interface of the video application. This starting mode is a cold start.
[0068] Then, as shown in Figure 2 During the display of the interface 16 of the video application by the mobile phone, the user swipes up from the bottom of the display screen of the mobile phone. In response to the swipe-up operation of the user, the mobile phone no longer displays the interface 16 of the video application, but displays a desktop 17 of the mobile phone, and the video application is switched from a foreground application to a background application. Then, as shown in Figure 3 In response to a swipe-up operation input by the user on the desktop 17, the mobile phone displays cards of background running APPs. The cards of the APPs include a card 18 of the video application. Then, as shown in Figure 4 In response to a click operation of the user on the card 18 of the video application, the mobile phone starts the video application, displays an interface 19 of the video application, and switches the video application from the background application to the foreground application without re-creating the process and the activity of the video application. This starting mode is a hot start.
[0069] It should be noted that the starting window 12 of the video application described above belongs to a system window, i.e., a window added by the mobile phone, rather than the video application, but the specific display content (i.e., the starting content) of the starting window is provided by the video application. The mobile phone adapts the starting content provided by the video application and displays the adapted starting content in the starting window. By adapting and displaying the starting content provided by the application, the display consistency of the application on the mobile phone can be ensured. For example, by adapting the starting content of different applications, the starting content of different applications can be uniformly displayed in the middle region of the starting window. For example, as shown in Figure 5As shown, in response to the user's click operation on the icon 20 of the short video application, since there is no process and activity of the short video application at present, the mobile phone cold starts the short video application, displays a start window 21 of the short video application, and the start window 21 includes start content 22 of the short video application. After the cold start is completed, the mobile phone displays an interface of the short video application. Comparing the start window 21 of the short video application with the start window 12 of the video application, it can be found that the display positions of the start content of the two are basically the same, and are consistent.
[0070] Of course, the start content of some applications on the mobile phone is not adapted either. The start window displayed by the mobile phone when starting the application still belongs to the application. For example, as shown in Figure 6 As shown, in response to the user's click operation on the icon 23 of the shopping application, since there is no process and activity of the shopping application on the mobile phone, the mobile phone cold starts the shopping application, displays a start window 24, and the start window 24 includes start content 25. After the cold start is completed, the mobile phone displays an interface of the shopping application. Comparing the position of the start content 25 in the start window 24 of the shopping application with the position of the start content 13 in the start window 12 of the video application or the position of the start content 22 in the start window 21 of the short video application, it can be found that the start content 25 in the start window 24 of the shopping application is located in the bottom region of the start window 24, rather than in the middle region.
[0071] Color mode, also known as display mode, refers to the background color (i.e., the base color) of the interface displayed by an electronic device. The color mode includes a dark mode and a light mode. The dark mode is that the background color of the interface displayed by the electronic device is black, such as black, gray, and the like. The light mode is that the background color of the interface displayed by the electronic device is light, such as white and the like.
[0072] Some electronic devices provide a setting function of the color mode (or referred to as the system color mode), such as Figure 7 The light mode (or referred to as the normal mode) and the dark mode are shown. When the system color mode is the dark mode, the background color of the system interface (including the interface of the system application) of the electronic device is dark, such as Figure 8 The color of the desktop 30 shown is dark. When the system color mode is the light mode, the background color of the system interface of the electronic device is light, such as the color of the desktop 10 in the above Figure 1 is light.
[0073] In addition, the color mode of the third-party application of the electronic device can also be provided. The color mode set by the third-party application can be consistent with or inconsistent with the system color mode. For example, the color mode of the third-party application can follow or not follow the system color mode. For example, as shown in Figure 9As shown, the video application provides a follow system setting control 31, when the follow system setting control 31 is in a selected state, the color mode of the video application is consistent with the system color mode. If the system color mode is a dark mode, then the color mode of the video application is also a dark mode. Specifically, Figure 8 The color of the desktop 30 shown is dark, Figure 10 The background color of the interface of the video application shown is also dark. In addition, Figure 9 It also includes a manual setting control 32, when the manual setting control 32 is in a selected state, the user can choose to set the video application to be a light mode or a dark mode. Among them, Figure 9 The manual setting control 32 shown is in an unselected state, and the follow system setting control 31 is in a selected state.
[0074] The above introduces the terms involved in the present application, and the following will continue to introduce the technical solutions provided by the present application.
[0075] From the above, when cold starting the third-party application, the electronic device displays the start window of the third-party application. Then, the electronic device displays the advertisement page of the third-party application. Then, the electronic device displays the interface of the third-party application. Even if the start window is added by the electronic device, it belongs to the system interface and does not belong to the third-party application, but the start content displayed by the start window is provided by the third-party application, and the background color of the start content depends on the advertisement page. Generally speaking, the activity corresponding to the advertisement page does not add dark resources, in other words, the color of the advertisement page is generally light, therefore, the background color of the start content, that is, the background color of the start window, is also light, for example, the bottom color of the start window is white. When the color mode of the third-party application is a dark mode, it causes the color of the start window displayed by the electronic device to be greatly different from the background color of the interface of the third-party application displayed after the cold start is completed, and the display styles are inconsistent. In addition, it may also cause the user to have a flickering feeling, and may make the user mistakenly think that the mobile phone has a display abnormality.
[0076] Taking the electronic device as a mobile phone as an example, the system color mode of the mobile phone is a dark mode, and the color mode of the video application is also a dark mode. For example, Figure 11As shown, the background color of the phone display is the dark desktop 40. In response to the click operation on the icon 41 of the video application in the desktop 40, since the phone does not exist the process of the video application and does not exist the activity of the video application, the phone cold starts the video application. The phone displays the start window 42 with the background color of light. Then, the phone displays the advertisement page 43. Then, in response to the click operation of the user on the skip control 44 on the advertisement page 43, the phone skips the advertisement page 43 and displays the main interface 45 of the video application, and the background color of the main interface 45 is dark. Since the color contrast between the start window 42 and the main interface 45 of the video application is large, the display style is inconsistent, and the user may have a flicker feeling. In addition, the user usually considers that the start window 42 is provided by the video application, and the color of the start window 42 should be consistent with the interface of the video application, such as the main interface 45, but actually the contrast is large, so the user may mistakenly think that the start window display is abnormal. And since the system color mode is also a dark mode, when the video application is cold started, the user experiences a dark-light-dark switching, and the user experience is poor.
[0077] Therefore, in view of the above problems, the present application provides a cold start method of a third-party application to solve the flicker problem when the electronic device cold starts the third-party application when the color mode of the third-party application does not match the color of the advertisement page of the third-party application. Considering the system limitation, the electronic device cannot directly know the setting condition of the color mode of the third-party application, that is, cannot know whether the color mode of the third-party application is a dark mode or a light mode. Therefore, in order for the electronic device to determine the setting condition of the color mode of the third-party application, when displaying the interface of the third-party application, the electronic device can take a screenshot of the interface of the third-party application. Then, the electronic device analyzes the screenshot to determine the background color of the third-party application, so as to determine the color mode of the third-party application (that is, the color mode in which the third-party application is located) according to the background color of the third-party application, and realize accurate determination of the color mode of the third-party application. Since the electronic device can directly determine the background color of the start window, the electronic device can judge whether the color mode of the third-party application matches the background color of the start window.
[0078] In the case of mismatch, the phone sets the color mode of the start window to the color mode in which the third-party application is located, that is, sets the background color of the start window to a color that matches the color mode in which the third-party application is located. When cold starting later, the electronic device displays the start window with the color mode consistent with the color mode of the third-party application, so that the color difference between the start window and the interface of the third-party application displayed after the start is small, avoiding the color difference between the start window and the interface of the third-party application being large, improving the consistency of the display style of the interface of the same application, and avoiding causing a flicker feeling, improving the display effect of cold start. And also can avoid the user thinking that the start window display is abnormal, and ensure the user experience.
[0079] In addition, in the case that the system color mode of the mobile phone is consistent with the color mode of the third-party application, when the electronic device is triggered to cold start the third-party application through an interface whose color mode is the system color mode, such as a desktop, in the case that the interface jumps to the start window of the third-party application, the flicker caused by the color contrast between the interface and the start window can be avoided.
[0080] For example, the system color mode of the mobile phone is a dark mode, the color mode of the video application is also a dark mode, but the color of the advertisement page of the video application is light. As shown in FIG. 5, the mobile phone displays a desktop 50 with a dark background color. In response to a click operation on an icon 51 of the video application in the desktop 50, the mobile phone cold starts the video application. The mobile phone displays a start window 52 with a dark background color. Then, the mobile phone displays an advertisement page 53. Then, in response to a click operation of a skip control 54 on the advertisement page 53 by the user, the mobile phone skips the advertisement page 53 and displays a main interface 55 of the video application, the main interface 55 has a dark background color, so that the background color of the start window displayed when the video application is cold started and the background color of the interface of the video application are less different, thereby avoiding the color contrast between the start window and the video application, improving the consistency of the display style, and avoiding flicker. In addition, the color contrast between the displayed desktop before the cold start and the start window displayed when the cold start is avoided, thereby avoiding the switching of “dark-light-dark”, improving the display effect of the cold start, and ensuring the user experience. Figure 12 It can be understood that after the color mode of the start window is consistent with the color mode of the third-party application, although the color of the advertisement page of the third-party application does not match the color mode of the third-party application, on the one hand, compared with the start window and the interface of the third-party application, the user stays in the advertisement page for a short time, and the user may not pay attention to the color of the advertisement page, so the flicker generated by the user is small. On the other hand, since the advertisement content of the advertisement page is generally displayed full screen, the user generally considers that the display of the advertisement content is set, that is, the color of the advertisement page is set, so the user does not feel abnormal, and the display style of the advertisement page is also consistent with the display style of the third-party application. On the other hand, the background of the advertisement page is covered by the displayed content, so modifying the background color of the advertisement page will not affect the display of the advertisement page, and the mobile phone does not need to modify the background color of the advertisement page. In summary, although only the color of the start window of the third-party application is modified, and the color of the advertisement page of the third-party application is not modified, when the third-party application is cold started, the consistency of the display style can still be improved, and the flicker generated by the user is small, thereby improving the display effect when the third-party application is cold started.
[0081]
[0082] It should be noted that part of the third-party application does not exist the advertisement page resource, then the background color of the start window of the third-party application displayed at the cold start generally depends on the first interface displayed after the cold start of the third-party application, such as the main interface of the video application, and then the display style of the start window is consistent with the display style of the third-party application, and the background color of the start window does not need to be modified.
[0083] In addition, when the electronic device or the third-party application is in a certain color mode, the color mode of the interface of the electronic device and the third-party application is the color mode, but the specific background color can be the same or different, and can be adaptively displayed, as long as the background color matches the color mode. For example, the system color mode is a dark mode, and the background color of the desktop is gray. The color mode of the video application is a dark mode, and the background color of the main interface of the video application is black. For another example, the video application is a dark mode, the background color of the start window of the video application is gray which matches the dark mode, and the background color of the main interface of the video application is black which matches the dark mode.
[0084] For example, the electronic device in the embodiment of the present application can 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, a wearable device, a personal digital assistant (PDA), an augmented reality (AR) \ virtual reality (VR) device, and other devices capable of installing APPs, and the specific form of the electronic device is not specially limited in the embodiment of the present application.
[0085] For example, Figure 13 A structural schematic diagram of the electronic device 200 is shown. As shown in the figure, Figure 13 The electronic device 200 can include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charge management module 211, a power management module 212, a battery 213, an antenna 1, an antenna 2, a mobile communication module 240, a wireless communication module 250, an audio module 270, a loudspeaker 270A, a receiver 270B, a microphone 270C, a headset interface 270D, a sensor module 280, a key 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc.
[0086] It can be understood that the structural schematic of the embodiments of the present application does not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 can include more or fewer components than those shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0087] The processor 210 can include one or more processing units, for example: the processor 210 can 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), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors.
[0088] Among them, the controller can be the nerve center and command center of the electronic device 200. The controller can generate operation control signals according to instruction operation codes and timing signals to complete the control of fetching instructions and executing instructions.
[0089] The memory in the processor 210 can also be provided for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory can save instructions or data that the processor 210 has just used or repeatedly uses. If the processor 210 needs to use the instructions or data again, it can be directly called from the memory. This avoids repeated access and reduces the waiting time of the processor 210, thus improving the efficiency of the system.
[0090] The wireless communication function of the electronic device 200 can be realized by the antenna 1, the antenna 2, the mobile communication module 240, the wireless communication module 250, the modem processor, and the baseband processor, etc.
[0091] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: the antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0092] The mobile communication module 240 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device 200. The mobile communication module 240 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 240 can receive electromagnetic waves by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transfer the same to the modem processor for demodulation. The mobile communication module 240 can also amplify the signal modulated by the modem processor, and radiate the same as electromagnetic waves through the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 240 can be disposed in the processor 210. In some embodiments, at least part of the functional modules of the mobile communication module 240 can be disposed in the same device as at least part of the modules of the processor 210.
[0093] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 270A, the microphone 270B, etc.), or displays an image or a video through the display screen 294. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 210, and disposed in the same device as the mobile communication module 240 or other functional modules.
[0094] The wireless communication module 250 can provide solutions for wireless communication, including wireless local area networks (WLAN) (such as Wi-Fi (wireless fidelity)), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), and the like, which are applied on the electronic device 200. The wireless communication module 250 can be one or more devices that integrate at least one communication processing module. The wireless communication module 250 receives electromagnetic waves via the antenna 2, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 210. The wireless communication module 250 can also receive signals to be transmitted from the processor 210, frequency-modulate them, amplify them, and radiate them as electromagnetic waves via the antenna 2.
[0095] The electronic device 200 implements a display function through a GPU, a display screen 294, an application processor, and the like.
[0096] The display screen (or screen) 294 is used to display images, videos, and the like. In some embodiments, the electronic device 200 can include 1 or N display screens 294, N being a positive integer greater than 1.
[0097] The electronic device 200 can implement a photographing function through an ISP, a camera 293, a video codec, a GPU, a display screen 294, an application processor, and the like.
[0098] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200.
[0099] The internal memory 221 can be used to store computer executable program codes including instructions. The processor 210 performs various function applications and data processing of the electronic device 200 by running the instructions stored in the internal memory 221. The internal memory 221 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program (such as a sound playing function, an image playing function, etc.) required by a function, etc. The data storage area can store data (such as audio data, a phone book, etc.) created during the use of the electronic device 200, etc. In addition, the internal memory 221 can include a high-speed random access memory, and can further include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0100] The electronic device 200 can realize an audio function through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, an application processor, etc. For example, music playing, recording, etc.
[0101] The keys 290 include a power-on key, a volume key, etc. The indicator 292 can be an indicator light.
[0102] The sensor module 280 can include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0103] The software system of the electronic device 200 described above can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to exemplarily illustrate the software structure of the electronic device 200.
[0104] Figure 14 is a software structure block diagram of the electronic device 200 of the embodiment of the present application.
[0105] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Android runtime and a system library, and a kernel layer.
[0106] The application layer can include a series of application packages.
[0107] As Figure 14As shown, the application package can include gallery, video, short video, shopping, desktop launcher, music, short message, etc.
[0108] The desktop launcher is configured to launch an application, such as a video application, on the electronic device 200 based on a user operation.
[0109] The application framework layer provides an application programming interface (API) and a programming framework for the applications of the application layer. The application framework layer includes some pre-defined functions.
[0110] As shown, the application framework layer can include a window manager service (WMS), a surface flinger, a package manager service (PMS), a content provider, a view system, a resource manager, a notification manager, etc. Figure 14 The window manager is configured to manage window programs. The window manager can obtain a display screen size, determine whether there is a status bar, etc. The window manager can determine a type of an interface currently displayed, i.e., an interface state when the interface is displayed, according to whether there is a status bar. The type of the interface includes a non-immersive interface and an immersive interface.
[0111] Optionally, the immersive interface can include an immersive interface of a surface view type and an immersive interface of a non-surface view type. The window manager can determine a specific type of the immersive interface according to whether the immersive interface has a surface view component.
[0112] In addition, the window manager can also obtain a background color of a startup window displayed when the electronic device 200 starts an application. In addition, the window manager can also obtain a current system color mode.
[0113] The package manager service is configured to manage an application package, such as information of a main interface of an application.
[0114] The surface flinger is configured to determine a background layer in an immersive interface to take a screenshot of the background layer in the immersive interface.
[0115] The content provider is configured to store and obtain data and make the data accessible to an application. The data can include video, image, audio, a dialed and received call, browsing history and bookmark, a phonebook, etc.
[0116]
[0117] The view system includes visual controls, such as controls that display text, controls that display pictures, and the like. The view system can be used to build an application. A display interface can be composed of one or more views.
[0118] The notification manager enables an application to display notification information in the status bar, which can be used to convey a message of the notification type, which can automatically disappear after a short stay without user interaction.
[0119] The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.
[0120] The core library contains two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
[0121] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java file of the application layer and the application framework layer into a binary file. The virtual machine is used to perform the management of the object life cycle, the management of the stack, the management of the thread, the management of the security and the exception, and the garbage collection and the like.
[0122] The system library can include a plurality of functional modules. For example: surface manager, media library, three-dimensional graphics processing library (for example: OpenGL ES), two-dimensional graphics engine (for example: SGL) and the like. The surface manager is used to manage the display subsystem, and provides a plurality of applications with the fusion of 2D and 3D layers.
[0123] The media library supports a plurality of commonly used audio, video format playback and recording, and static image files and the like. The three-dimensional graphics processing library is used to realize three-dimensional graphics drawing, image rendering, synthesis, and layer processing and the like. The two-dimensional graphics engine is a two-dimensional drawing drawing engine.
[0124] The kernel layer is a layer between hardware and software. The kernel layer at least contains display driver, camera driver, audio driver, sensor driver.
[0125] It can be understood that the structure shown in the above Figure 14 The electronic device can divide the software layer according to the needs. For example, the electronic device can include other software layers in addition to the above software layers. Alternatively, the electronic device can include one or more of the above software layers. Similarly, the content included in each software layer is only an example, and the present application does not limit it.
[0126] This application provides a cold start method. During a cold start of an application, the electronic device displays the application's launch window and records its background color. Then, the electronic device displays the application's advertising page. Next, the electronic device displays the application's main interface. The electronic device can determine the type of the main interface it displays to determine the background color value of the main interface. This type includes non-immersive interfaces and immersive interfaces. A non-immersive interface means that the electronic device displays a status bar, and the currently displayed background is the actual background of the interface; therefore, the electronic device can directly determine the background color value of the interface based on the background. An immersive interface means that the electronic device displays the interface in full screen without a status bar. The currently displayed background may not be the actual background of the interface, as the actual background may be covered by the displayed content. Therefore, the electronic device needs to determine the background color value of the interface based on the background layer of the interface, which includes the actual background.
[0127] Next, the electronic device determines the application's color mode based on the background color value of the main interface. If the application's color mode does not match the background color of the launch window, the electronic device changes the background color of the launch window to match the application's color mode. Then, during a cold start of the application, the launch window is displayed in the color that matches the application's color mode. After the cold start is complete, the electronic device continues to display the main interface in that color mode, ensuring color consistency between the launch window and the application's main interface. This maintains a consistent display style, avoids flickering issues caused by excessive color contrast, and prevents users from perceiving a malfunction in the phone, thus improving the cold start display effect.
[0128] The following example, using a mobile phone as the electronic device, a video application as the application, and a light-colored resource corresponding to the application's advertising page, illustrates the implementation process of the cold start method provided in this application. Figure 15 As shown, the cold start method may include the following steps:
[0129] S301, Receive user's command to start the video application.
[0130] For example, the launch action (or second action) is a user's trigger action on the video application's icon, as described above. Figure 1 The image shows a click operation on the video application icon 11. Of course, the launch operation can also be other types of operations, such as inputting relevant voice commands; this application does not impose any restrictions on the launch operation.
[0131] S302. In response to the startup operation, the phone begins a cold start of the video application if there are no processes or activities running in the video application.
[0132] S303: The phone displays the startup window of the video application and records that the background color of the startup window is light.
[0133] In this embodiment, upon receiving a launch operation, the mobile phone needs to launch the video application. Since the video application process and background do not currently exist, the mobile phone needs to create the video application process and activities, i.e., a cold start is required. During the cold start, the mobile phone can display the video application's launch window, create the video application process and activities, and draw the video application's advertising page (or advertising interface) and main interface (or first interface). After the cold start ends, the video application's advertising page is displayed, and in response to the advertising page stopping display, the video application's main interface is displayed. In other words, the cold start process may include the display of the video application's launch window, the creation of the video application's process and activities (or alternatively, the drawing of the advertising page and main interface), but does not include the display of the advertising page and main interface.
[0134] It should be noted that the display of the launch window depends on the interface of the video application displayed after it, such as the aforementioned advertisement page, and the launch window is a system window. Therefore, when displaying the launch window, the phone needs to read the resource information corresponding to the activity of the advertisement page. If the resource information indicates dark resources, the phone displays the launch window in dark mode and records that the background color of the launch window is dark (or alternatively, determines that the color mode of the launch window is dark mode). If the resource information indicates light resources, the phone displays the launch window in light mode and records that the background color of the launch window is light.
[0135] S304. The phone stops displaying the startup window and instead displays an advertisement page for a video application.
[0136] The ad page's colors match the light color mode, and there are no corresponding dark color resources. Regardless of whether the video application's color mode is light or dark, the ad page's display style will not change and will remain light.
[0137] In this embodiment, when switching to display the main interface of a video application, the mobile phone can activate a mechanism to determine the background color of the main interface, thereby determining the color mode of the video application. This mechanism will be further described below.
[0138] S305, In response to the stopping of the display of the video application's advertisement page, the mobile phone displays the main interface of the video application.
[0139] In this embodiment, when a preset condition for stopping ad display is met, the mobile phone stops displaying the ad page and then displays the main interface of the video application. The preset condition for stopping ad display is...
[0140] S306, the mobile phone judges whether the main interface is a non-immersive interface.
[0141] From the foregoing, in the case that the main interface is a non-immersive interface, it indicates that the mobile phone also displays the status bar when displaying the main interface, and the content of the main interface is not full-screen display. Therefore, the background displayed by the main interface is the actual background of the main interface, which has not been completely covered by the content of the main interface. In this way, the mobile phone can directly determine the background color of the main interface according to the color of the main interface, and then the mobile phone can execute S307.
[0142] In the case that the main interface is an immersive interface, it indicates that the status bar is in a hidden state, and the content of the main interface is full-screen display, and the content displayed by the main interface has covered the actual background of the main interface, that is, the background color displayed by the main interface may not be the actual background color of the main interface. Therefore, the mobile phone cannot directly determine the background color of the main interface according to the display of the main interface, and then the mobile phone can execute S309 or S310.
[0143] S307, the mobile phone takes a screenshot of the main interface.
[0144] For example, the main interface is the interface of the video application shown in FIG. 13A, and the mobile phone displays the status bar 34 at the same time. The mobile phone can determine that the main interface is a non-immersive interface, and the background in the main interface has not been completely covered by the display content in the main interface. Therefore, the mobile phone can take a screenshot of the entire main interface to determine the background color value of the main interface through the background in the screenshot, and the background color value of the main interface represents the determination of the background color value of the video application. Figure 10 S308, the mobile phone determines the background color value of the screenshot to obtain the background color value of the main interface.
[0145] For example, the mobile phone can select a plurality of feature points (or pixel points) from the screenshot, and determine the background color value of the screenshot based on the color values (or pixel values) of the plurality of feature points. Generally, the background area of the interface (such as the screenshot) is the top or bottom of the interface, and therefore the mobile phone can select a plurality of feature points from the top or bottom. For example, the main interface is the interface of the video application shown in FIG. 13A, and the mobile phone can randomly select a plurality of pixel points from the vicinity of the status bar 34. Alternatively, in the case that the interface is in a certain color mode, the color of the interface as a whole is the color corresponding to the color mode, and therefore the mobile phone can also randomly select a plurality of feature points from the main interface (such as the screenshot of the main interface) to determine the background color value of the main interface.
[0146] Figure 10
[0147] Optionally, the process of determining the background color value of the screenshot based on the color values of the plurality of feature points can include: based on the color value of each feature point in the plurality of feature points, the mobile phone determines the number of feature points corresponding to each color value. Then, the mobile phone can take the color value of the feature point with the largest number as the background color value of the screenshot. Alternatively, the mobile phone can calculate the average of the color values of the plurality of feature points to obtain the background color value of the screenshot. Of course, the background color value of the screenshot can also be determined in other ways, which are not limited by the present application.
[0148] The number of selected feature points can be set according to requirements, which are not limited by the present application.
[0149] The above describes the process of directly determining the background color value through the entire screenshot of the main interface in the case where the main interface is a non-immersive interface. Of course, there is also the possibility that the main interface is an immersive interface. In the case where the main interface is an immersive interface, it indicates that the main interface is displayed in full screen, and the content currently displayed by the main interface can have covered the actual background of the main interface. Therefore, the mobile phone needs to determine the background layer of the main interface, which includes the actual background of the main interface. Then, the mobile phone can identify the color of the background layer, such as taking a screenshot of the background layer to determine the background color value of the screenshot, thereby obtaining the background color value of the main interface. The background layer of the main interface can be the layer below the topmost layer, which is the layer where the content is displayed.
[0150] Optionally, in order to improve the accuracy of determining the background layer, the background layer of the immersive interface can be determined based on the specific type of the immersive interface, so as to determine the background color value of the immersive interface by using the background layer. The process of determining the background color value of the main interface in the case where the main interface is an immersive interface will be further described below.
[0151] S309, in the case where the main interface is a surface view type immersive interface, the mobile phone takes the layer in the main interface except the surface view layer as the background layer of the main interface.
[0152] S310, in the case where the main interface is a non-surface view type immersive interface, the mobile phone takes the layer in the main interface except the topmost layer as the background layer of the main interface.
[0153] In the embodiments of the present application, one interface can be composed of one or more layers, but generally, an interface is composed of multiple layers superimposed. That is, an immersive interface is composed of multiple layers superimposed. The types of immersive interfaces can include surface view types and non-surface view types. Since surface view is generally used for video playing, in the case that the main interface is a surface view type immersive interface, it indicates that the mobile phone plays a video full screen on the main interface, and the surface view layer where the video is located covers the actual background of the main interface. Therefore, the mobile phone can take the layers in the main interface except the surface view layer as the background layer of the main interface. In other words, the specific display content of the background layer refers to the content displayed by the main interface after removing the surface view layer.
[0154] In the case that the main interface is a non-surface view type immersive interface, it indicates that the mobile phone displays content full screen, such as displaying an image full screen, and the displayed content has covered the actual background of the main interface, and the displayed content is generally located on one layer. Therefore, the mobile phone can take the layers in the main interface except the uppermost layer as the background layer of the main interface. In other words, the specific display content of the background layer refers to the content displayed by the main interface after removing the uppermost layer.
[0155] S311, the mobile phone takes a screenshot of the background layer and determines the color value of the screenshot to obtain the background color value of the main interface.
[0156] In the embodiments of the present application, the mobile phone takes a screenshot of the background layer, which is equivalent to taking a screenshot of the specific display of the background layer to obtain the screenshot of the background layer. Then, the mobile phone can select one or more feature points from the background layer to determine the color value of the screenshot of the background layer by using the color value of the selected feature points, and take the color value of the screenshot as the background color value of the main interface.
[0157] The process of determining the color value of the screenshot of the background layer by using the color value of the selected feature points can refer to the implementation process of determining the background color value of the screenshot of the main interface based on the color values of multiple feature points described above, which will not be described here.
[0158] It should be noted that in the case that the main interface is a surface view type immersive interface, the main interface after removing the surface view layer can still display other content, but generally not full screen. In other words, the background layer can display other content, but the other content will not completely cover the actual background of the main interface. That is, the background layer can display the actual background of the main interface, so as to determine the actual background color of the main interface based on the background layer.
[0159] Similarly, in the case that the main interface is an immersive interface of a non-surfaceview type, the main interface with the topmost layer removed can also display other content, but generally not in full screen. In other words, the background layer can display other content, but the other content does not completely cover the actual background of the main interface. That is, the background layer can display the actual background of the main interface, so that the actual background color of the main interface can be determined based on the background layer.
[0160] The implementation process of determining the background color value of the main interface is introduced above. After the background color value of the main interface is determined, the phone can determine the color mode of the main interface based on the background color value of the main interface, and obtain the color mode of the video application. The process of determining the color mode of the video application based on the background color value of the main interface will be introduced below.
[0161] S312, the phone calculates a difference value 1 between the background color value of the main interface and a color threshold value corresponding to the dark color mode.
[0162] S313, the phone determines whether the difference value 1 belongs to a difference value range 1 corresponding to the dark color mode.
[0163] In the case that the difference value 1 belongs to the difference value range 1 corresponding to the dark color mode, it indicates that the background color value of the main interface is close to the dark color value, that is, the background color of the main interface is dark, that is, the color mode of the main interface is the dark color mode, and then the phone can execute S314.
[0164] In the case that the difference value 1 does not belong to the difference value range 1 corresponding to the dark color mode, it indicates that the background color value of the main interface is not close to the dark color value, that is, the background color of the main interface is not dark. In other words, the background color of the main interface is light, that is, the color mode of the main interface is the light color mode, and then the phone can execute S316.
[0165] It should be noted that the phone can not only calculate the difference value 1 between the background color value of the main interface and the color threshold value corresponding to the dark color mode, but also calculate a difference value 2 between the background color value and a color threshold value corresponding to the light color mode, so as to determine whether the background color value is close to the light color value by using the difference value 2, thereby determining whether the color mode of the main interface is the light color mode or the dark color mode. In other words, the phone can calculate the difference value between the background color value of the main interface and the color threshold value corresponding to the preset color mode, so as to determine whether the background color value is close to the color value corresponding to the preset color mode by using the difference value, thereby determining whether the color mode of the main interface is the preset color mode.
[0166] In addition, the mobile phone can directly determine whether the background color value of the home interface belongs to the color value range corresponding to the preset color mode. If yes, the mobile phone can determine that the color mode of the home interface is the preset color mode. If no, the mobile phone can determine that the color mode of the home interface is not the preset color mode. In general, in the case that the background color value matches the preset color mode, the mobile phone determines that the display mode of the video application is the preset color mode. In the case that the background color does not match the preset color mode, the mobile phone determines that the display mode of the video application is not the preset color mode. The preset color mode can be a dark mode or a light mode.
[0167] The preset color mode can be a dark mode or a light mode.
[0168] The home interface described in S305-S313 can be an example of the second interface.
[0169] S314, the mobile phone determines that the color mode of the video application is a dark mode.
[0170] S315, the mobile phone modifies the color mode of the start window of the video application to a dark mode.
[0171] In the embodiment of the application, since the color mode of the video application is a dark mode and the background color of the start window is light, that is, the color mode of the start window is also a light mode. In order to avoid the problem of inconsistent display style caused by the inconsistency between the color mode of the start window and the color mode of the video application, the mobile phone can set the color mode of the start window to a dark mode, so that the color mode of the start window is consistent with the color mode of the video application.
[0172] For example, the attribute information of the start window can include attribute information of the color mode, and the mobile phone can modify the attribute information of the color mode in the related code corresponding to the start window, so as to modify the attribute information to dark mode information. Alternatively, the attribute information of the start window can include attribute information of the background color, and the mobile phone can modify the background color to a color matching the dark mode, that is, a dark color such as black.
[0173] S316, the mobile phone determines that the color mode of the video application is a light mode.
[0174] S317, the mobile phone does not modify the color mode of the start window of the video application.
[0175] In the embodiment of the application, since the color mode of the video application is consistent with the color mode of the start window, the display style when the video application is cold started is consistent. Therefore, the mobile phone does not need to modify the color mode of the start window, that is, does not need to modify the background color of the start window.
[0176] In some embodiments, the partial application does not need to display the advertisement page when cold starting, and directly displays the main interface. The start window then depends on the main interface, and the background color of the start window can match the color mode of the main interface, and the display style is consistent. Therefore, the mobile phone does not need to determine the color mode of the video application, and does not need to modify the start window. In order to avoid unnecessary judgment of the color mode of the video application, the mobile phone can determine whether the color mode of the application needs to be judged when the application is cold started. If the advertisement page is displayed, the mobile phone can determine that the color mode of the application needs to be judged. If the advertisement page is not displayed, and the main interface of the application is directly displayed, the mobile phone can determine that the color mode of the application does not need to be judged.
[0177] Among them, since the advertisement page and the main interface belong to the application, the mobile phone cannot actually perceive whether the advertisement page is the main interface, and therefore the mobile phone can obtain the identifier of the main interface. In the case of jumping from the start window to an interface, if the identifier of the interface is the identifier of the main interface, the mobile phone can determine that the interface is the main interface, and the mobile phone can determine that the application does not display the advertisement page. If the identifier of the interface is not the identifier of the main interface, the mobile phone can determine that the interface is the advertisement page, and the mobile phone can determine that the application displays the advertisement page.
[0178] In some embodiments, the start window displayed by the partial application when cold starting belongs to the application, and the mobile phone cannot modify the background color of the start window. Therefore, the mobile phone does not need to determine the color mode of the application. Generally, in the case that the size of the installation package (Android package, APK) of the application is greater than or equal to a preset size, the mobile phone can determine that the start window of the application does not belong to the application, and the mobile phone can determine the color mode of the application. In the case that the size of the installation package of the application is less than the preset size, the mobile phone can determine that the start window of the application belongs to the application, and the mobile phone does not need to determine the color mode of the application.
[0179] Correspondingly, when the video application is cold started, the mobile phone can record the background color of the start window and determine the color mode of the video application in the case that the size of the installation package of the video application is greater than or equal to the preset size.
[0180] S318, in response to the up sliding operation of the user, the mobile phone switches the video application to the background.
[0181] In the embodiments of the present application, during the running of the video application in the foreground, when the user wants to stop the running of the video application in the foreground, the user can input an up sliding operation, the phone stops the running of the video application in the foreground, and the video application is returned to the background. It should be understood that the up sliding operation is only an example of the home operation, and the home operation can also be other operations. For example, it is an operation on the home button displayed on the phone. In addition, it should be understood that the home operation is also an example of an operation for triggering the switching of the video application to the background. In general, the present application does not limit the operation (or the third operation) for triggering the phone to switch the video application to the background.
[0182] In some embodiments, generally, the user can modify the color mode of the video application during the use of the video application, therefore, when the video application is returned to the background, the phone can determine how to determine the screenshot including the actual background of the interface for determining the latest color mode of the video application based on the type of the interface displayed by the video application, so as to accurately determine the color mode of the video application, so that the start window with the color matching the latest color mode can be displayed when the video application is cold started next time, and the consistency of the display style is ensured. In addition, when the video application is returned to the background, it indicates that there is a possibility of subsequent cold start of the video application, therefore, the phone determines the color mode of the video application, which can to some extent avoid unnecessary determination of the color mode of the video application.
[0183] S319, in the case that the video application meets the background clearing condition, the phone deletes the activity of the video application, and deletes the process of the video application.
[0184] The background clearing condition (or the condition for stopping the background running) indicates the condition for triggering the phone to clear the video application running in the background. The background clearing condition can include one or more of the following: receiving a user input operation of clearing the card of the video application, the time length of the video application running in the background exceeding a preset time length, or the phone being powered off.
[0185] For example, the above-mentioned operation of clearing the card of the video application can include an up sliding operation on the card of the video application displayed in the background. Or, a click operation on the deletion control displayed in the background of the phone.
[0186] S320, in response to the start operation of the video application, the phone displays a start window with a dark background color.
[0187] S321, the phone stops displaying the start window, and displays the advertisement page of the video application.
[0188] S322, in response to the stop of the display of the advertisement page of the video application, the phone displays the main interface with a dark background color.
[0189] For example, in response to a launch operation (or first operation) of a video application, since the video application process and activity do not exist on the phone, the phone begins a cold start of the video application. During the cold start, the phone displays a launch window, the process for creating the video application, and the activity for creating the video application (or alternatively described as drawing an advertisement page for the video application, drawing the main interface of the video application). After the cold start completes, the phone may display the advertisement page. Then, the phone displays the main interface of the video application.
[0190] Optionally, during this cold start, the phone can also record the background color of the launch window and determine the color mode of the video application. For example, the phone can determine the color mode of the video application through the main interface displayed during this cold start, or it can determine the color mode of the video application when it is moved to the background, so that the background color of the launch window can be modified in a timely manner after the color mode of the video application changes, thereby maintaining the consistency of the display style.
[0191] The implementation process of S320-S322 can be referred to in the relevant description of the cold start video application above. The main interface described in S322 can also be called the first interface.
[0192] It should be noted that the step numbers above do not represent the actual execution order of the steps. For example, the modification of the startup window's color mode described in S315 above can be performed by the phone after it is determined that the color mode of the video application is inconsistent with the background color of the startup window, or it can be performed during the cold start of the video application described in S320. This application does not impose any restrictions on the execution order of the above steps.
[0193] In some embodiments, when the color mode of the video application is consistent with the system color mode of the electronic device, matching the background color of the launch window with the color mode of the video application ensures consistency in display style and improves display effect when the video application is cold-launched from the desktop.
[0194] In some embodiments, when a video application is cold-started, the phone can determine the main interface of the video application through a package management service, enabling the window manager to determine the color mode of the video application based on the color mode of the main interface. When the color mode of the video application is inconsistent with the color mode of the launch window, the window manager can calibrate the background color of the launch window according to the color mode of the video application, thereby ensuring that the background color of the launch window displayed when the video application is cold-started is consistent with the background color of the video application interface, maintaining display format consistency, avoiding flickering, and improving display quality. The following will combine the above... Figure 14 The software structure shown illustrates the implementation process of cold start, that is, it introduces... Figure 15 One possible implementation process of the corresponding embodiment. For example...Figure 16 As shown, the process is as follows:
[0195] S1, in response to a click operation on the icon of the video application, in the absence of the process and activity of the video application, the desktop launcher cold starts the video application through the window manager.
[0196] Exemplarily, when it is needed to start the video application, if the process and activity of the video application do not exist at present, the desktop launcher needs to cold start the video application and create the process and activity of the video application. Wherein, the desktop launcher can cold start the video application by using the window manager.
[0197] S2, the window manager displays the start window of the video application, and records that the background color of the start window is light.
[0198] Wherein, the background color of the start window can be determined by the resource of the advertisement page on which the start window depends, that is, the display style (or theme) of the advertisement page, or can be determined by the color mode determination process of the main interface described below, which is not limited by the present application.
[0199] S3, in response to the stop of the display of the start window, the window manager displays the advertisement page of the video application.
[0200] Wherein, the implementation process of S1-S3 can refer to the related content of S301-S304 described above.
[0201] S4, the window manager obtains the identifier of the main interface of the video application from the package management service.
[0202] Exemplarily, the identifier of the main interface can be the name of the main interface. Specifically, the name of the main interface can be the package name of the main interface. Alternatively, the main interface can obtain the package name of the main interface by calling the getLauncherActivityName interface. Since the window manager cannot directly know whether the advertisement page is the main interface of the video application, the electronic device can determine whether the displayed interface is the main interface through the identifier of the main interface, so as to ensure the accuracy of the color mode determination of the video application.
[0203] S5, in response to the stop of the display of the advertisement page, the window manager displays the interface of the video application.
[0204] S6, in the case where it is determined that the identifier of the displayed interface is the identifier of the main interface, the window manager determines the type of the main interface. Wherein, the type of the main interface is a non-immersive interface, a non-surface view type immersive interface or a surface view type immersive interface.
[0205] S7, the window manager sends the type of the main interface to the layer compositor.
[0206] The type of the main interface can also be referred to as a state of the main interface, that is, an interface state when the main interface is displayed. The window manager can send the state of the main interface to the surfaceflinger, so that the surfaceflinger determines a screenshot result including an actual background of the main interface by using the state of the main interface.
[0207] In addition, the window manager can determine the color mode of the video application based on a state of an interface displayed when the video application is in the background, instead of based on the main interface.
[0208] S8, in a case where the type of the main interface is a non-immersive interface, the layer compositor screenshots the main interface to obtain a screenshot result.
[0209] In the embodiment of the present application, in a case where the type of the main interface is a non-immersive interface, it indicates that the background displayed by the main interface is the actual background of the main interface, which is not completely covered by the content that is not displayed. Therefore, the surfaceflinger can directly screenshot the main interface, and take the screenshot as the screenshot result, so as to recognize the color mode of the main interface by using the screenshot result.
[0210] S9, in a case where the type of the main interface is an immersive interface of the surface view type, the layer compositor analyzes the layers of the main interface, and takes the layers of the main interface except the surface view layer as the background layers of the main interface.
[0211] S10, the layer compositor screenshots the background layers of the main interface to obtain a screenshot result.
[0212] S11, in a case where the type of the main interface is an immersive interface of the non-surface view type, the layer compositor analyzes the layers of the main interface, and takes the layers of the main interface except the uppermost layer as the background layers of the main interface.
[0213] S12, the layer compositor screenshots the background layers of the main interface to obtain a screenshot result.
[0214] The above describes the process of determining the screenshot result of the main interface. The process of determining the background color value of the main interface based on the screenshot result will be described below.
[0215] S13, after obtaining the screenshot result, the layer compositor sends the screenshot result to the window manager.
[0216] S14, the window manager determines the background color value of the screenshot result to obtain the background color value of the main interface.
[0217] The process of determining the type of the main interface, taking a screenshot based on the type of the main interface, and determining the background color value of the main interface based on the screenshot can refer to the related content of S305-S311.
[0218] S15, the window manager determines the color mode of the video application based on the background color value of the main interface. The color mode of the video application is a dark mode.
[0219] S16, the window manager sets the background color of the startup window to the color corresponding to the dark mode.
[0220] For example, the window manager determines that the color mode of the video application does not match the background color of the startup window, and modifies the background color of the startup window to set the background color of the startup window to the color corresponding to the color mode of the video application, i.e., the color matching the color mode of the video application, thereby ensuring the consistency of the display style of the startup window of the video application and the interface of the video application other than the advertisement page. For example, the color mode of the video application is a dark mode, and the window manager can set the background color of the startup window to black matching the dark mode.
[0221] The specific implementation process of S15-S16 can refer to the related content of S312-S315, which will not be described here.
[0222] In the embodiments of the present application, when the video application is cold started, the window manager determines the color mode of the video application for calibrating the startup window of the video application based on the color mode of the video application. The consistency of the display style of the startup window and the video application is ensured when the video application is cold started next time. In addition, it should be understood that although the user may modify the color mode of the video application during the use of the video application, resulting in that the color mode of the video application determined by the window manager is not the latest color mode of the video application, thereby causing the color of the startup window displayed next time is still greatly different from the color of the main interface of the video application, but the color mode of the video application can still be determined next time, thereby successfully determining the latest color mode of the video application.
[0223] It should be noted that the above is an example of modifying the background color of the startup window in the case where the color mode of the video application is the dark mode and the display style corresponding to the advertisement page is the light resource (i.e., the display style corresponding to the light mode), that is, the color mode of the advertisement page is the light mode. Of course, the inconsistent case can also be that the color mode of the video application is the light mode and the advertisement page corresponds to the dark resource. However, the process of modifying the background color of the startup window in any inconsistent case is similar to the process of modifying the background color of the startup window described above. That is, the color mode of the video application can be referred to as a first color mode, and the color mode of the advertisement page can be referred to as a second color mode. The first color mode can be a dark mode or a light mode, and the second color mode can also be a light mode or a dark mode. When the first color mode is different from the second color mode, the modification of the background color of the startup window is involved.
[0224] In addition, the dark mode and the light mode are only examples of display modes, and the display mode can include not only the dark mode and the light mode, but also other color modes. Of course, the display mode can be other modes, but includes multiple color modes. In addition, the above-mentioned video application is only an example, and therefore, the application does not limit the application (or referred to as the first application).
[0225] It should be noted that the operations performed by the software modules (such as the above-mentioned desktop launcher, window manager, package management service, surfaceflinger, etc.) in the above-mentioned mobile phone can also be operations performed by other software modules, and the application does not limit the software modules that perform the above-mentioned steps. In addition, the operations performed by the software modules are actually performed by the mobile phone, that is, the execution subject of the technical solutions introduced in the application is the mobile phone.
[0226] The above mainly introduces the solutions provided by the embodiments of the application from the perspective of the method. It can be understood that in order to implement the above functions, the electronic device includes a hardware structure and / or a software module corresponding to the execution of each function. The units and algorithm steps of each example described in conjunction with the embodiments disclosed in the application can be implemented in the form of hardware or a combination of hardware and computer software.
[0227] Whether a certain function is executed in the form of hardware or computer-driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solutions of the embodiments of the application.
[0228] The embodiments of the present application can divide the functional modules of the electronic device according to the above method examples. For example, each functional module can be divided according to each function, or two or more functions can be integrated in one processing unit. The integrated unit can be in the form of hardware or software functional module. It should be noted that the division of the unit in the embodiments of the present application is illustrative, and is only a logical function division. In actual implementation, another division method can be used.
[0229] As shown in Figure 17 , a structural schematic diagram of an electronic device provided by the embodiments of the present application is shown. The electronic device 1000 can be used to implement the method executed by the electronic device in the above method embodiments. For example, the electronic device 1000 can include a processing unit 1001, a communication unit 1002, and a display unit 1003. The processing unit 1001 is configured to support the processing function of the electronic device 1000 described in any one of Figures 1 to 16 , the communication unit 1002 is configured to support the communication function of the electronic device 1000, and the display unit 1003 is configured to support the display function of the electronic device 1000.
[0230] Optionally, Figure 17 , the electronic device 1000 shown in the figure can further include a storage unit (not shown in Figure 17 ) which stores programs or instructions. When the processing unit 1001 executes the programs or instructions, the electronic device 1000 shown in Figure 17 can execute the method described in the above method embodiments.
[0231] Figure 17 The technical effects of the electronic device 1000 shown in the figure can refer to the technical effects described in the above method embodiments, which will not be described here. Figure 17 The processing unit 1001 involved in the electronic device 1000 shown in the figure can be realized by a processor or a processor-related circuit component, which can be a processor or a processing module. The communication unit 1002 can be realized by a transceiver or a transceiver-related circuit component, which can be a transceiver or a receiving module. The display unit 1003 can be realized by a display screen-related component.
[0232] The embodiments of the present application also provide a chip system, as shown in Figure 18As shown, the chip system includes at least one processor 1101 and at least one interface circuit 1102. The processor 1101 and the interface circuit 1102 can be interconnected by a line. For example, the interface circuit 1102 can be used to receive signals from other devices. For another example, the interface circuit 1102 can be used to send signals to other devices (e.g., the processor 1101). Illustratively, the interface circuit 1102 can read instructions stored in a memory and send the instructions to the processor 1101. When the instructions are executed by the processor 1101, the electronic device can be caused to perform various steps performed by the electronic device in the above embodiments. Of course, the chip system can also include other discrete devices, which are not limited in the embodiments of the present application.
[0233] Optionally, the processor in the chip system can be one or more. The processor can be implemented by hardware or software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor, which is implemented by reading software codes stored in a memory.
[0234] Optionally, the memory in the chip system can also be one or more. The memory can be integrated with the processor or arranged separately from the processor, which is not limited in the present application. Illustratively, the memory can be a non-transient processor, such as a read-only memory (ROM), which can be integrated on the same chip as the processor or arranged on different chips, which is not limited in the type of the memory and the arrangement of the memory and the processor.
[0235] Illustratively, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chip.
[0236] It should be understood that each step in the above method embodiments can be completed by integrated logic circuits of hardware in the processor or instructions in the form of software. The method steps disclosed in combination with the embodiments of the present application can be directly embodied as execution completed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0237] The embodiments of the present application also provide a computer storage medium, which stores computer instructions. When the computer instructions run on an electronic device, the electronic device executes the cold start method, that is, the application start method, as described in the above method embodiments.
[0238] The embodiments of the present application provide a computer program product, which includes computer programs or instructions. When the computer programs or instructions run on an electronic device, the electronic device executes the cold start method as described in the above method embodiments.
[0239] In addition, the embodiments of the present application also provide a device, which can be a chip, a component or a module. The device can include a processor and a memory connected to each other. The memory is used to store computer execution instructions. When the device runs, the processor can execute the computer execution instructions stored in the memory, so that the device executes the cold start method in the above method embodiments. The electronic device, the computer storage medium, the computer program product or the chip provided in the embodiments can be used to execute the corresponding method provided above, and the beneficial effects achieved thereby can refer to the beneficial effects in the corresponding method provided above, which will not be described here.
[0240] Through the description of the above embodiments, those skilled in the art can understand that, for the convenience and brevity of description, only the division of the above functional modules is taken as an example for illustration. In actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0241] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments can be combined or referred to each other without conflict. The device embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be through some interface, indirect coupling or communication connection between the devices or units, which can be electrical, mechanical or other forms.
[0242] The units described as separate components may or may not be physically separate, and the components displayed as units may be a physical unit or multiple physical units, that is, may be located in one place, or also can be distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0243] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0244] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a readable storage medium. Based on such understanding, the technical scheme of the embodiments of the present application essentially or the part that contributes to the prior art or the whole or part of the technical scheme can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for making a device (which can be a single-chip microcomputer, a chip, etc.) or a processor execute all or part of the steps of the method of each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.
[0245] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of starting an application, characterized by, The method is applied to an electronic device, and the method comprises: displaying a second interface of a first application; in a case where a size of an installation package of the first application is greater than or equal to a preset size, determining a color mode of the first application based on an interface state when the second interface is displayed; wherein, in a case where the size of the installation package of the first application is greater than or equal to the preset size, a start window displayed by the first application in a cold start mode is added by the electronic device; receiving a first operation; wherein, the first operation is used to trigger starting the first application; in response to the first operation, displaying the start window of the first application in a first color in a case where there is no process and no activity of the first application; wherein, the first color matches the determined first color mode of the first application; start content displayed by the start window belongs to the first application, and a background color of the start content displayed by the start window depends on a color of an advertisement interface of the first application; the color of the advertisement interface matches a second color mode, and the second color mode is different from the first color mode; in response to the start window stopping being displayed, displaying the advertisement interface of the first application; in response to the advertisement interface stopping being displayed, displaying a first interface of the first application in a second color, and the second color matches the first color mode.
2. The method of claim 1, wherein, The method further comprises: based on the interface state when the second interface is displayed, taking a screenshot of the second interface to obtain a screenshot result of the second interface; wherein, the screenshot result of the second interface comprises a background of the second interface; based on a background color value of the screenshot result, determining the display mode of the first application.
3. The method of claim 2, wherein, The interface state when the second interface is displayed comprises: whether the electronic device displays a status bar in a case where the second interface is displayed; in a case where the interface state is that the status bar is displayed, the screenshot result of the second interface comprises all layers of the second interface; in a case where the interface state is that the status bar is not displayed, the screenshot result of the second interface comprises a background layer of the second interface.
4. The method of claim 3, wherein, in a case where the second interface comprises a surface view (surfaceview) layer, the background layer comprises layers of the second interface except the surface view layer; in a case where the second interface does not comprise the surface view layer, the background layer comprises layers of the second interface except a topmost layer.
5. The method according to any one of claims 2 to 4, characterized in that, The display mode of the first application can be set to the first color mode or the second color mode. The method further comprises: in a case where the background color value matches the first color mode, determining that the display mode of the first application is the first color mode; in a case where the background color value matches the second color mode, determining that the display mode of the first application is the second color mode.
6. The method of claim 5, wherein, The background color value matching the first color mode includes that a difference value between the background color value and a color threshold corresponding to the first color mode is within a difference value range corresponding to the first color mode, a difference value between the background color value and a color threshold corresponding to the second color mode is not within a difference value range corresponding to the second color mode, the background color value is within a color value range corresponding to the first color mode, or the background color value is not within a color value range corresponding to the second color mode.
7. The method according to any one of claims 1 to 4, characterized in that, Before the receiving the first operation, the method further includes: receiving a second operation; wherein the second operation is used to trigger starting the first application; in response to the second operation, displaying the starting window in the absence of a process and an activity of the first application, and recording a color of the starting window; the displaying the second interface of the first application includes: in response to the starting window stopping being displayed, displaying the advertisement interface; in response to the advertisement interface stopping being displayed, displaying the second interface.
8. The method according to any one of claims 1 to 4, characterized in that, The determining the display mode of the first application based on an interface state when the second interface is displayed includes: receiving a third operation; wherein the third operation is used to trigger running the first application in the background; in response to the third operation, determining the display mode of the first application based on an interface state when the second interface is displayed.
9. An electronic device, comprising: The electronic device includes a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; the display screen is used to display images generated by the processor, the memory is used to store computer program codes, the computer program codes include computer instructions; when the processor executes the computer instructions, the electronic device executes the starting method of the application as claimed in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer instructions are executed on the electronic device, so that the electronic device executes the starting method of the application as claimed in any one of claims 1 to 8.
11. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the starting method of the application as claimed in any one of claims 1 to 8. The computer program is executed by the processor to implement the starting method of the application as claimed in any one of claims 1 to 8.
Citation Information
Patent Citations
Application startup optimization method and apparatus, storage medium and intelligent terminal
CN107748686A
Image processing method, and training method and device of image processing model
CN117218213A