Starting method and apparatus, and electronic device and medium

By obtaining and loading the dark resource package from the server when the application is in dark mode, the problem of increasing the application installation package size is solved, achieving faster startup and a consistent user experience.

WO2025067124A1PCT designated stage expired Publication Date: 2025-04-03BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/120499
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-28
Filing Date
2024-09-23
Publication Date
2025-04-03

AI Technical Summary

Technical Problem

When implementing Dark Mode, the prior art requires setting a resource for each default mode and Dark Mode, resulting in an increase in the volume of the application installation package.

Method used

When the application is in dark mode, the dark resource package is obtained from the server based on the identification information of the dark resource package corresponding to the dark mode, and these resources are loaded and set to replace the resources in the default mode.

Benefits of technology

Reduces the impact of Dark Mode on the application installation package size, improves the startup speed of electronic devices in Dark Mode, and ensures consistency of user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024120499_03042025_PF_FP_ABST
    Figure CN2024120499_03042025_PF_FP_ABST
Patent Text Reader

Abstract

A starting method and apparatus, and an electronic device and a medium. The starting method comprises: when an application program is in a dark mode, on the basis of identification information of a dark resource package corresponding to the dark mode, acquiring, from a server end, the dark resource package corresponding to the dark mode (S110); loading a dark resource in the dark resource package (S120); and setting a page of the application program on the basis of the loaded dark resource (S130). On the basis that a dark mode is implemented, the impacts of the dark mode on the size of an application-program installation package are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Startup method, device, electronic device and medium

[0001] This application claims priority to the Chinese invention patent application with application number 202311281937.6 filed on September 28, 2023 and titled “A startup method, device, electronic device and medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present disclosure relates to computer technology, and more particularly to a startup method, device, electronic device, and medium. Background Art

[0003] The application mode of the application includes dark mode and default mode. Among them, the dark mode uses a dark theme style to save power on the organic light-emitting diode display.

[0004] When an application implements a dark mode, it needs to set up a resource for both the default mode and the dark mode in the application's installation package, which increases the size of the application's installation package.

[0005] Summary of the Invention

[0006] The present disclosure provides a startup method, device, electronic device, and medium, which, on the basis of implementing a dark mode, reduce the impact of the dark mode on the size of an application installation package.

[0007] In a first aspect, an embodiment of the present disclosure provides a startup method, comprising: when an application is in a dark mode, obtaining a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode; loading dark resources in the dark resource package; and setting a page of the application based on the loaded dark resources.

[0008] In the second aspect, the embodiment of the present disclosure also provides a startup device, including: an acquisition module, which is used to obtain a dark resource package corresponding to the dark mode from a server based on the identification information of the dark resource package corresponding to the dark mode when the application is in the dark mode; a loading module, which is used to load the dark resources in the dark resource package; and a setting module, which is used to set the page of the application based on the loaded dark resources.

[0009] In a third aspect, an embodiment of the present disclosure further provides an electronic device, comprising: one or more processing devices; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processing devices, the one or more processing devices implement a startup method as provided in an embodiment of the present disclosure.

[0010] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to execute the startup method provided in the embodiment of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.

[0012] FIG1 is a schematic diagram of a process of a startup method provided by an embodiment of the present disclosure;

[0013] FIG2 is a flow chart of another startup method provided by an embodiment of the present disclosure;

[0014] FIG3 is a system architecture diagram for implementing a dark mode provided by an embodiment of the present disclosure;

[0015] FIG4 is a schematic diagram of a dark mode page provided by an embodiment of the present disclosure;

[0016] FIG5 is a schematic structural diagram of a starting device provided in an embodiment of the present disclosure;

[0017] FIG6 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0018] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0019] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0020] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0021] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0022] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0023] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0024] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0025] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.

[0026] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0027] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0028] Figure 1 is a flow chart of a startup method provided by an embodiment of the present disclosure. This embodiment of the present disclosure is applicable to the case of starting dark mode. The method can be executed by a startup device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, PC, or server.

[0029] As shown in FIG1 , the method includes: S110 , when the application is in a dark mode, obtaining a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode.

[0030] Dark mode can be considered a dark-themed mode. Identification information can be considered information identifying a dark resource package. This identification information is not limited here; it can be used as long as it uniquely identifies the dark resource package. A dark resource package can be a resource package used in dark mode. A dark resource package can be a resource package that packages dark resources. Dark resources can be considered resources used in dark mode, such as one or more of text colors, background colors, and image resources.

[0031] This embodiment does not limit how to set the application to dark mode. For example, the application may be in dark mode after detecting that a button corresponding to the dark mode on the electronic device is triggered; or the application may be in dark mode after the time set for dark mode is reached.

[0032] When it is detected that the application is in dark mode, in order to implement the dark mode on the electronic device, this step can obtain the dark resource package corresponding to the dark mode from the server based on the identification information of the dark resource package.

[0033] In some embodiments, the identification information of the dark resource package can be the address of the dark resource package on the server side, or the resource name of the default mode in the application. The default mode can be the mode in which the application is in by default, and the brightness of the default mode can be higher than the brightness of the dark mode.

[0034] The dark resource on the server side can have the same name as the resource in the default mode. Therefore, this step can obtain the dark resource package of the dark mode from the server side based on the identification information of the dark resource package of the dark mode.

[0035] During application development, a software development kit method that includes a dark mode can be set as a resource setting method in the application's code. The dark resource package corresponding to the dark mode is configured on the server; then, an installation package for the application is generated. In some embodiments, after the dark mode software development kit method is initialized on the electronic device, it can determine whether the application is in dark mode. If so, the dark resource package can be obtained, and the application's page can be configured based on the dark resource package.

[0036] Before setting the software development kit method including the dark mode as the resource setting method in the code of the application, a dark resource package of the dark mode with the same name as the resource name of the default mode can be uploaded to the server, and the dark resource package includes dark resources.

[0037] S120: Load the dark resources in the dark resource package.

[0038] After obtaining the dark resource package, this step can load the dark resource package to parse the dark resources in the dark resource package, and then implement the setting of the page in the application.

[0039] There is no restriction on the loading method here. For example, dark resources can be loaded through the resource management class.

[0040] In one embodiment, the loading of the dark resources in the dark resource package includes: constructing a resource management class; and using the resource management class to load the dark resources in the dark resource package.

[0041] In implementing dark mode, default mode resources and dark mode resource packages are typically packaged in the same resource package. Loading resources from the same resource package simply requires system methods to construct multiple resources. This disclosure stores the dark mode resource package remotely, such as on a server, and only loads the dark resource package for dark mode when the application needs to switch to dark resources. Loading the dark resource package can be implemented using known algorithms, without specific limitations.

[0042] When loading dark resources, this embodiment can first construct a resource management class for loading dark resources. The resource management class can be a class that implements dark resource loading. After constructing the resource management class, dark resources in the dark resource package can be loaded based on the resource management class.

[0043] S130: Setting a page of the application based on the loaded dark resource.

[0044] After obtaining the dark resources, you can configure the application page based on them. In some embodiments, dark resources can include text colors, background colors, and image resources. When setting the dark resources for a page in this step, you can create a view by taking over the view, i.e., creating a View, and then associating the View with the dark resources, such as assigning the dark resources to the corresponding View.

[0045] The technical solution of the embodiment of the present disclosure, when an application is in dark mode, obtains a dark resource package corresponding to the dark mode from a server based on the identification information of the dark resource package; loads the dark resources in the dark resource package; and sets the application page based on the loaded dark resources. When dark mode is activated, the present disclosure obtains the dark resource package from the server based on the identification information of the dark resource package, and then sets the application page based on the dark resource package, reducing the impact of the dark resource package on the size of the application installation package.

[0046] Based on the above embodiment, a modified embodiment of the above embodiment is proposed. It should be noted that, in order to simplify the description, only the differences from the above embodiment are described in the modified embodiment.

[0047] In one embodiment, the setting of the page of the application based on the loaded dark resource includes: setting a factory construction method in a layout filling instance; creating a view through the factory construction method; and associating the loaded dark resource with the view.

[0048] The layout filling instance can be considered as creating a View instance and parsing the View attributes. The factory construction method can be considered as the method that takes over the View.

[0049] Views are declared in XML. At runtime, the application inflates them using layouts. The LayoutInflater creates the View and parses the attributes set in the XML file. The LayoutInflater provides a factory constructor, allowing developers to take over View creation. Therefore, by setting a factory for the LayoutInflater, the LayoutInflater takes over View creation and parses View attributes.

[0050] To avoid the unique logic of view creation in different versions of the system, Dark Mode can take over view creation through the view creation method of the factory constructor, that is, Factory.onCreateView. The factory constructor can obtain the view creation time and then parse the view's resource properties.

[0051] In this embodiment, associating the loaded dark resource with the view can be considered as setting the loaded dark resource to the corresponding view.

[0052] In one embodiment, the View attributes are parsed into the attribute setting class, namely AttributeSet, and the attribute values ​​of AttributeSet are traversed to parse the resource attributes. The current dark mode SDK only parses dark resources, such as text color, background color, and image resources.

[0053] In one embodiment, setting the factory construction method in the layout filling instance includes: setting the factory construction method in the obtain system service method called in the layout filling instance.

[0054] The method for obtaining system services may be a method called in a layout filling instance. In this embodiment, the factory construction method may be set by overriding the method for obtaining system services.

[0055] When constructing a LayoutInflater instance using the LayoutInflater.from method, the system service access method in the context class is called: context.getSystemService(Context.LAYOUT_INFLATER_SERVICE). Therefore, you only need to override the getSystemService method in the context class (Context.LAYOUT_INFLATER_SERVICE). When LAYOUT_INFLATER_SERVICE is obtained, injecting the Dark Mode SDK factory constructor into LayoutInflater will take over View creation.

[0056] In one embodiment, associating the loaded dark resource with the view includes: constructing an attribute processor; and associating the loaded dark resource with the view through the attribute processor.

[0057] Attribute handlers can be thought of as handlers for view attributes. Attribute handlers allow you to associate dark resources with views.

[0058] After creating a View, this embodiment constructs a property handler. The Dark Mode SDK constructs handlers for text color, background color, and image resources to set dark resources for the View. After constructing the property handler, the Apply method executes the View resource settings, allowing Dark Mode to take over View creation and control property settings.

[0059] In one embodiment, associating the loaded dark resource with the view includes: associating the loaded dark resource with the view through a software development kit method of a dark mode in the application, wherein the software development kit is set as a method for resources in the application.

[0060] The dark mode SDK methods can be considered methods for implementing dark mode. This embodiment sets View properties in code. SDK methods may include one or more of the following: methods for setting background resources for components, methods for setting image resources for image components, methods for obtaining text colors, and methods for obtaining image resources.

[0061] The Dark Mode SDK will replace instructions during the application compilation phase, replacing system method instructions with Dark Mode SDK method instructions to complete the control of code setting View properties.

[0062] FIG2 is a flow chart of another startup method provided by an embodiment of the present disclosure. This embodiment refines the scheme for obtaining a dark resource package based on the above embodiment. This embodiment includes the following steps:

[0063] S210: When the application is in a dark mode, determine a resource name of a default mode in the application.

[0064] If the application is determined to be in dark mode, this operation can determine the resource name for the default mode. In some embodiments, the resource name can be a name that represents the resource in the default mode. In this embodiment, the default mode resource and the dark mode resource have the same name. This operation determines the resource name for the default mode so that the dark resource package for the application's dark mode can be obtained from the server.

[0065] The installation package of the application includes a resource package in the default mode, so this operation can determine the resource name of the installation package in the default mode in the installation package of the application.

[0066] S220: Determine the resource name as identification information of the dark resource package corresponding to the dark mode.

[0067] After determining the resource name, this operation can determine the resource name as identification information of the dark resource package, so as to obtain the dark resource package from the server based on the identification information.

[0068] S230: Obtain a dark resource package matching the identification information from the server.

[0069] This operation can send the identification information to the server and obtain the dark resource package that matches the identification information returned by the server.

[0070] S240: Load the dark resources in the dark resource package.

[0071] S250: Setting a page of the application based on the loaded dark resource.

[0072] When the dark mode is started, this embodiment obtains the dark resource package based on the resource name of the default mode, which makes it more convenient to obtain the dark resource package from the server, thereby improving the speed of starting the dark mode of the electronic device.

[0073] The activation method provided in this disclosure can be considered a solution for implementing a dark mode in Android applications. Related technologies for implementing dark mode have their own advantages and disadvantages in terms of package size, maintenance cost, supported system versions, and user experience. Therefore, a solution that optimizes package size, maintenance cost, supported versions, and user experience is desired.

[0074] The dark mode disclosed herein reduces the impact on the installation package size of the application. In addition, it can meet the consistency of the dark mode experience requirements of all users and avoid the situation where color inversion is inconsistent on various electronic devices.

[0075] Taking into account the four aspects of supported system versions, development and maintenance costs, package size impact, and user experience, this paper maps and replaces the text color, background color, and image resources on the application, and uses the system method provided by the system and compatible with various versions to achieve color and resource mapping replacement. Developers only need to put the resources with the same name applicable to the default mode and dark mode into the corresponding resource package. Only the resource package of the default mode is stored in the application, and the dark resource package of the dark mode is sent to the application online. All the text, background color, and image resources seen by the user are controlled by the developer to ensure consistent performance across all models.

[0076] This public startup method supports all system versions; the development and maintenance costs are low. Developers only need to put the same-name color and image resources into different resource packages to complete the adaptation, which is less invasive during the development phase; it has little impact on the installation package size, with almost no incremental size; and the user experience is highly consistent.

[0077] FIG3 is a system architecture diagram for implementing a dark mode provided by an embodiment of the present disclosure. FIG3 depicts the overall process of the dark mode from three stages: development, application, i.e., APP compilation, and APP operation.

[0078] During the requirements development phase, developers complete the text color, background color, and image resource settings for light mode (also known as default mode). They then store the resource files with the same names in a dark mode resource package, also known as a dark resource package. This dark mode resource package is then published to the Dark Mode Resource Management Service. This involves: 1. Setting resources in default mode during the requirements development phase; 2. Declaring the resources with the same names in the dark resource package; and 3. Uploading and configuring the dark resource package. The Dark Mode Resource Management Service facilitates the configuration and distribution of dark mode resource packages.

[0079] When the APP compiles the code into APK, it will search and collect the resource setting methods for setting text color, background color, and image resources, and replace them with dark mode SDK methods: that is, 1. APP compilation; 2. APP call method replacement, replacing the system method, that is, the resource setting method, with the SDK method dark mode; 3. Construct APP to obtain the APK of the application.

[0080] When a user opens an APP, the dark mode SDK will be initialized first, and the current mode of the APP will be determined. If it is in dark mode, the dark mode resource package will be pulled and parsed from the "Dark Mode Resource Management Service" and the page resources will be refreshed at the same time. Users can also switch modes while using the APP. The dark mode SDK supports free switching between the two modes.

[0081] When refreshing page resources, you can take over the creation of View.

[0082] This disclosure uses the Dark Mode SDK to take over View creation, parse the View's resource attribute declaration in XML, and dynamically replace system methods with Dark Mode SDK methods during compilation, enabling dynamic switching between light and dark modes. The client only stores light resource packages locally, while the dark mode resource packages are stored on the server and dynamically distributed from the server. This reduces the package size required to implement dark mode by approximately 3MB.

[0083] Figure 4 is a schematic diagram of a dark mode page provided by an embodiment of the present disclosure; referring to Figure 4, after the dark mode is started, the page displayed by the electronic device may be as shown in Figure 4, the background color of background 1 may be black, text 2 may be white, and control 3 may also be white.

[0084] Figure 5 is a schematic diagram of the structure of a startup device provided by an embodiment of the present disclosure. As shown in Figure 5, the device includes: an acquisition module 510, which is used to obtain a dark resource package corresponding to the dark mode from a server based on the identification information of the dark resource package corresponding to the dark mode when the application is in the dark mode; a loading module 520, which is used to load the dark resources in the dark resource package; and a setting module 530, which is used to set the page of the application based on the loaded dark resources.

[0085] The technical solution provided by the embodiment of the present disclosure obtains a dark resource package from a server based on its identification information when dark mode is activated, thereby setting application pages based on the dark resource package. This reduces the impact of the dark resource package on the size of the application installation package.

[0086] In one embodiment, the acquisition module 510 is specifically used to determine the resource name of the default mode in the application when the application is in dark mode; determine the resource name as the identification information of the dark resource package corresponding to the dark mode; and obtain a dark resource package that matches the identification information from the server.

[0087] In one embodiment, the loading module 520 is specifically used to: construct a resource management class; and use the resource management class to load the dark resources in the dark resource package.

[0088] In one embodiment, the setting module 530 includes: a setting unit for setting a factory construction method in a layout filling instance; a construction unit for creating a view through the factory construction method; and an association unit for associating the loaded dark resource with the view.

[0089] In one embodiment, the setting unit is specifically configured to: set a factory construction method in an acquisition system service method called in a layout filling instance.

[0090] In one embodiment, the associating unit is specifically configured to: construct an attribute processor; and associate the loaded dark resource with the view through the attribute processor.

[0091] In one embodiment, the associating unit is specifically configured to associate the loaded dark resource with the view through a dark mode software development kit method in the application program, wherein the software development kit sets a method for resources in the application program.

[0092] The startup device provided in the embodiments of the present disclosure can execute the startup method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0093] It is worth noting that the various units and modules included in the above-mentioned apparatus are divided only according to functional logic, but are not limited to the above divisions, as long as they can achieve the corresponding functions. In addition, the specific names of the functional units are only for the convenience of distinguishing them from each other and are not intended to limit the scope of protection of the embodiments of the present disclosure.

[0094] FIG6 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Referring to FIG6 , it shows a schematic diagram of the structure of an electronic device (eg, a terminal device or server in FIG6 ) 500 suitable for implementing an embodiment of the present disclosure.

[0095] The electronic device 500 includes: one or more processing devices 501; a storage device 508 for storing one or more programs. When the one or more programs are executed by the one or more processing devices 501, the one or more processing devices 501 implement the startup method provided in the embodiment of the present disclosure.

[0096] The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG6 is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0097] As shown in FIG6 , the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.

[0098] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 6 illustrates the electronic device 500 with various devices, it should be understood that not all of the illustrated devices are required to be implemented or present. More or fewer devices may alternatively be implemented or present.

[0099] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0100] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0101] The electronic device provided by the embodiment of the present disclosure and the startup method provided by the above embodiment belong to the same inventive concept. Technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0102] An embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the startup method provided by the above embodiment is implemented.

[0103] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two.

[0104] The computer storage medium may be a storage medium of computer-executable instructions, which, when executed by a computer processor, are used to perform the methods provided in the present disclosure.

[0105] Computer-readable storage media may include, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, device, or component. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wire, optical cable, RF (radio frequency), etc., or any suitable combination thereof.

[0106] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.

[0107] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0108] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: when the application is in dark mode, obtains the dark resource package corresponding to the dark mode from the server based on the identification information of the dark resource package corresponding to the dark mode; loads the dark resources in the dark resource package; and sets the page of the application based on the loaded dark resources.

[0109] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0110] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0111] The modules or units described in the embodiments of the present disclosure may be implemented in software or hardware. In some embodiments, the name of a module or unit does not necessarily define the unit itself. For example, a loading module may also be described as a "dark resource loading module."

[0112] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0113] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0114] According to one or more embodiments of the present disclosure, [Example 1] provides a startup method, including: when an application is in dark mode, obtaining a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode; loading dark resources in the dark resource package; and setting a page of the application based on the loaded dark resources.

[0115] According to one or more embodiments of the present disclosure, [Example 2] provides the method described in Example 1, which, when the application is in dark mode, obtains the dark resource package corresponding to the dark mode from the server based on the identification information of the dark resource package corresponding to the dark mode, including: when the application is in dark mode, determining the resource name of the default mode in the application; determining the resource name as the identification information of the dark resource package corresponding to the dark mode; and obtaining a dark resource package that matches the identification information from the server.

[0116] According to one or more embodiments of the present disclosure, [Example 3] provides the method described in Example 1, wherein loading the dark resources in the dark resource package includes: constructing a resource management class; and using the resource management class to load the dark resources in the dark resource package.

[0117] According to one or more embodiments of the present disclosure, [Example 4] provides the method described in Example 1, which sets the page of the application based on the loaded dark resource, including: setting a factory construction method in a layout fill instance; creating a view through the factory construction method; and associating the loaded dark resource to the view.

[0118] According to one or more embodiments of the present disclosure, [Example 5] provides the method described in Example 4, wherein setting the factory construction method within the layout filling instance includes: setting the factory construction method in the obtain system service method called within the layout filling instance.

[0119] According to one or more embodiments of the present disclosure, [Example 6] provides the method described in Example 4, wherein associating the loaded dark resource with the view comprises: constructing an attribute processor; and associating the loaded dark resource with the view through the attribute processor.

[0120] According to one or more embodiments of the present disclosure, [Example 7] provides the method of Example 4, wherein associating the loaded dark resource with the view includes: associating the loaded dark resource with the view using a software development kit method for dark mode in the application. The software development kit sets a method for resources in the application.

[0121] According to one or more embodiments of the present disclosure, [Example 8] provides a startup device, including: an acquisition module, which is used to obtain a dark resource package corresponding to the dark mode from a server based on the identification information of the dark resource package corresponding to the dark mode when the application is in dark mode; a loading module, which is used to load the dark resources in the dark resource package; and a setting module, which is used to set the page of the application based on the loaded dark resources.

[0122] According to one or more embodiments of the present disclosure, [Example 9] provides an electronic device, which includes: one or more processing devices; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the startup method described in any one of Examples 1-7.

[0123] According to one or more embodiments of the present disclosure, [Example 10] provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to execute the startup method described in any one of Examples 1-7.

[0124] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0125] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0126] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A startup method, comprising: When the application is in a dark mode, obtaining a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode; Loading the dark resources in the dark resource package; The page of the application is set based on the loaded dark resource.

2. The method according to claim 1, wherein: When the application is in a dark mode, obtaining a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode includes: In the case where the application is in dark mode, determining a resource name of a default mode in the application; Determine the resource name as identification information of a dark resource package corresponding to the dark mode; Obtain a dark resource package matching the identification information from the server.

3. The method according to claim 1, wherein: The loading of the dark resources in the dark resource package includes: Construct resource management class; Use the resource management class to load the dark resources in the dark resource package.

4. The method according to claim 1, wherein: The setting of the page of the application based on the loaded dark resource includes: Set the factory constructor in the layout fill instance; Create a view through the factory construction method; Associate the loaded dark resource to the view.

5. The method according to claim 4, wherein: The method of setting a factory construction method in the layout filling instance includes: In the Get System Service method called in the layout fill instance, set the factory constructor.

6. The method according to claim 4, wherein: The step of associating the loaded dark resource with the view includes: Construct an attribute handler; The loaded dark resource is associated with the view through the attribute processor.

7. The method according to claim 4, wherein: The step of associating the loaded dark resource with the view includes: The loaded dark resource is associated with the view through the SDK method of the dark mode in the application, and the SDK is set as a method for the resource in the application.

8. A starting device, comprising: An acquisition module, configured to acquire, when the application is in a dark mode, a dark resource package corresponding to the dark mode from a server based on identification information of the dark resource package corresponding to the dark mode; A loading module, used to load the dark resources in the dark resource package; The setting module is used to set the page of the application based on the loaded dark resource.

9. An electronic device, comprising: one or more processing devices; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the startup method as described in any one of claims 1-7.

10. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the startup method according to any one of claims 1 to 7 when executed by a computer processor.

Citation Information

Patent Citations

  • Theme resource replacement method, device and equipment, and readable storage medium

    CN112394933A

  • Page mode switching method and device, equipment and storage medium

    CN113157374A

  • Interface display method and device, equipment and storage medium

    CN115827123A

  • Interface display method, electronic equipment and storage medium

    CN115941836A

  • Method, device and mobile terminal for processiong webpage in night mode

    US20160188552A1