Single application mode processing method and system based on Android device
By executing the target desktop code of the target system desktop on an Android device and stopping the original desktop code of the original system desktop, switching of a single application mode is achieved, solving the inefficiency problem of modifying the system source code and developing a new desktop in the existing technology, and improving application switching efficiency and compatibility.
Patent Information
- Application Number
- CN202110265809.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-11
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2041-03-11
AI Technical Summary
When configuring and using single-app mode, existing Android devices need to modify the system source code and develop a new desktop, resulting in inefficiency.
By obtaining instructions to enter single application mode, executing the target desktop code of the target system desktop and stopping the original desktop code of the original system desktop, the single application mode of switching from the original system desktop to the target system desktop is realized. This method does not require modifying the system source code, and uses the system signature to obtain permissions, so that the target desktop code is decoupled from the system.
It improves the efficiency of desktop application switching, reduces the development and application workload of new desktops with single application mode, has high compatibility, and is not restricted by software development toolkits.
Smart Images

Figure CN115080157B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular, to a single-application mode processing method, system, computer device, and computer-readable storage medium based on an Android device. Background Art
[0002] The Android system is widely used in various devices. A device installed with the Android system is generally referred to as an Android device. Existing Android devices generally have one or more system desktops customized by manufacturers at the system source code level.
[0003] However, the configuration and use of the above desktop modes cannot flexibly adapt to some special modes, such as the single-application mode. Therefore, the disadvantages of the existing technology are as follows: It is necessary to modify the system source code, and the efficiency of new desktop development and applications is low. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a single-application mode processing method, system, computer device, and computer-readable storage medium based on an Android device, which are used to solve the problems of modifying the system source code and the low efficiency of new desktop development and applications.
[0005] Embodiments of the present invention solve the above technical problems through the following technical solutions:
[0006] A single-application mode processing method based on an Android device includes:
[0007] Obtaining a first instruction for entering the single-application mode; wherein, the single-application mode is used to switch the Android device from the original system desktop to the target system desktop, where the original system desktop is the system default desktop of the Android device, and the target system desktop is the graphical user interface of the target application;
[0008] Executing the target desktop code of the target system desktop according to the first instruction and stopping the execution of the original desktop code of the original system desktop to enter the single-application mode, so as to switch the Android device from the original system desktop to the target system desktop; wherein, the target desktop code has the permission to control entering and exiting the target system desktop, and the permission is obtained in advance based on the system signature of the Android device.
[0009] Optionally, the step of executing the target desktop code of the target system desktop according to the first instruction and stopping the execution of the original desktop code of the original system desktop to enter the single-application mode, so as to switch the Android device from the original system desktop to the target system desktop includes:
[0010] According to the first instruction, add a first status value to the target desktop code of the target system desktop, where the first status value indicates that the target system desktop is in an allowed-to-open state;
[0011] According to the first instruction, add a second status value to the original desktop code of the original system desktop, where the original desktop code is used to control entering and exiting the original system desktop, and the second status value indicates that the original system desktop is in a prohibited-to-open state; and
[0012] According to the first status value and the second status value, execute the target desktop code and stop running the original desktop code to enter the single-application mode, so as to switch the Android device from the original system desktop to the target system desktop.
[0013] Optionally, the target desktop code includes the code of the entry desktop component of the target application, and the entry desktop component is used to load the graphical user interface of the target application on the Android device; the method further includes:
[0014] Pre-create an entry desktop component alias, where the entry desktop component alias is used to execute each function in the entry desktop component and execute the new functions in the single-application mode through the entry desktop component; and
[0015] Add a plurality of desktop property tags to the entry desktop component alias to determine that the target system desktop has the permission to be the system desktop of the Android device according to the plurality of desktop property tags.
[0016] Optionally, the step of adding the first status value to the target desktop code of the target system desktop includes:
[0017] Determine a specified component according to the component name of the entry desktop component alias, where the specified component includes the entry desktop component and the entry desktop component alias; and
[0018] Set the first attribute status of the specified component to the first status value, where the first status value indicates that the desktop permission of the target system desktop is allowed to open.
[0019] Optionally, the step of adding the second status value to the original desktop code of the original system desktop includes:
[0020] Determine the package of the original system desktop through the package name of the desktop, where the package name of the desktop is the name of the package of the original system desktop; and
[0021] Set the second attribute status of the desktop package to the second status value, where the second status value indicates that the desktop permission of the original system desktop is prohibited from being enabled.
[0022] Optionally, the method further includes:
[0023] Obtain a second instruction for exiting the single-application mode;
[0024] According to the second instruction, determine the desktop package of the original system desktop through the desktop package name;
[0025] Set the second attribute status to a third status value, where the third status value indicates that the desktop permission of the original system desktop is allowed to be enabled;
[0026] Set the first attribute status to a fourth status value, where the fourth status value indicates that the desktop permission of the target system desktop is prohibited from being enabled; and
[0027] According to the third status value and the fourth status value, execute the original desktop code and stop running the target desktop code to exit the single-application mode, so as to switch the Android device from the target system desktop to the original system desktop.
[0028] Optionally, the method further includes a step of pre-testing the target desktop code, and the testing step includes:
[0029] According to the system signature of the Android system in the Android device, obtain the permission to control the execution of the target desktop code;
[0030] According to the permission, test the target desktop code; and
[0031] According to the test result, determine that the target desktop code enters the test-passed state or determine that the target desktop code enters the code-modification state.
[0032] Optionally, the Android system in the Android device includes a desktop application loading component, the desktop application loading component includes a plurality of desktop property tags, and the desktop application loading component is used to load the original system desktop or the target system desktop after the Android system is powered on. The method further includes:
[0033] Obtain the current system version of the Android system; and
[0034] If the version number of the current system version is higher than the version number of the preset system version, set the loading attribute status of the desktop application loading component to the fifth status value, where the fifth status value indicates that the system desktop loading is allowed to start, so that the desktop application loading component loads the original system desktop or the target system desktop after the Android system is powered on.
[0035] To achieve the above object, an embodiment of the present invention further provides a single application mode processing system based on an Android device, including:
[0036] An obtaining module, configured to obtain a first instruction for entering the single application mode; wherein, the single application mode is used to switch the Android device from the original system desktop to the target system desktop, where the original system desktop is the system default desktop of the Android device, and the target system desktop is the graphical user interface of the target application;
[0037] A switching module, configured to execute the target desktop code of the target system desktop according to the first instruction and stop running the original desktop code of the original system desktop to enter the single application mode, so as to switch the Android device from the original system desktop to the target system desktop; wherein, the target desktop code has the permission to control entering and exiting the target system desktop, and the permission is obtained in advance based on the system signature of the Android device.
[0038] To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and the computer program can be executed by at least one processor, so that the at least one processor executes the steps of the above-mentioned single application mode processing method based on an Android device.
[0039] The single application mode processing method, system, computer device and computer-readable storage medium based on an Android device provided by the embodiments of the present invention execute the target desktop code and prohibit the running of the original desktop code according to the first instruction, so as to realize the switching from the original system desktop to the target system desktop of the single application mode, effectively improving the efficiency of desktop application switching. Among them, the target desktop code is used to control the permission to enter and exit the target desktop system, and is obtained through the system signature, without the need to modify the system source code. Therefore, the target desktop code is decoupled from the system, thus effectively improving the development and application efficiency of the new desktop in this special scenario of the single application mode.
[0040] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments, but it is not a limitation to the present invention. Description of the Drawings
[0041] Figure 1 Schematic diagram of the graphical user interface of the single application mode processing method based on an Android device according to an embodiment of the present invention;
[0042] Figure 2 Overall flowchart of steps for entering the single application mode in the single application mode processing method based on an Android device according to Embodiment 1 of the present invention;
[0043] Figure 3 Specific flowchart of steps for entering the single application mode in the single application mode processing method based on an Android device according to Embodiment 1 of the present invention;
[0044] Figure 4 Flowchart of steps for pre-configuring multiple desktop property tags for the target system desktop during the development stage in the single application mode processing method based on an Android device according to Embodiment 1 of the present invention;
[0045] Figure 5 Flowchart of steps for pre-testing the target desktop code during the development stage in the single application mode processing method based on an Android device according to Embodiment 1 of the present invention;
[0046] Figure 6 Flowchart of steps for setting the first attribute state in the single application mode processing method based on an Android device according to Embodiment 1 of the present invention;
[0047] Figure 7 Schematic diagram of the flowchart of steps for setting the second attribute state in the single application mode processing method based on an Android device according to Embodiment 1 of the present invention;
[0048] Figure 8 Specific flowchart of steps for exiting the single application mode in the single application mode processing method based on an Android device according to Embodiment 1 of the present invention;
[0049] Figure 9 Flowchart of steps for setting the desktop application loading component in the single application mode processing method based on an Android device according to Embodiment 1 of the present invention;
[0050] Figure 10 Overall flowchart of steps for entering or exiting the single application mode in the single application mode processing method based on an Android device according to Embodiment 1 of the present invention;
[0051] Figure 11 Schematic diagram of the program modules of the single application mode processing system based on an Android device according to Embodiment 2 of the present invention; and
[0052] Figure 12 Schematic diagram of the hardware structure of a computer device according to Embodiment 3 of the present invention. Detailed implementation manners
[0053] In order to make the objectives, technical solutions and advantages of the present invention more clear and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0054] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions between various embodiments can be combined with each other, but it must be based on the fact that those of ordinary skill in the art can implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the protection scope required by the present invention.
[0055] In the description of the present invention, it should be understood that the numerical labels before the steps do not identify the sequence before and after the execution of the steps, but are only used to conveniently describe the present invention and distinguish each step, and thus cannot be understood as a limitation to the present invention.
[0056] Term explanations of the present invention:
[0057] Single-application mode, which is used to use the graphical user interface (main interface) of a certain application (such as LanXin) as the system desktop of the Android device 10. In some other embodiments, the single-application mode can also be used to use the graphical user interface of other desktop applications other than the system default desktop application as the system desktop of the Android device 10.
[0058] After research, the present invention believes that the single-application mode can be implemented in the Android system in the following two ways:
[0059] (1) If the single-application mode is customized based on the Android system, it is necessary to modify at the source code level of the Android system. After the Android system is compiled, the Android system is then flashed into the Android device 10 for running.
[0060] (2) Based on the software development kit provided by the Android system manufacturer to the application developer side, the development and application of the single-application mode are realized.
[0061] However, the above approach has the following drawbacks: (1) When the single-application mode based on system customization needs to be modified again, it is necessary to modify it again at the source code level of the Android system and then flash the modified Android system into the Android mobile terminal; developing the single-application mode according to different projects involves a large amount of work, which affects the development and application efficiency of the single-application mode. (2) When implementing the single-application mode based on the software development kit provided by the system manufacturer, there are certain requirements for the model of the Android device 10, with low compatibility and relatively low development and application efficiency of the single-application mode.
[0062] In view of this, the present invention provides a method for implementing a single-application mode in an Android system, which has at least some or all of the following advantages: (1) It is applicable to implementing the locking and cancellation of the single-application mode for all devices based on the Android system. (2) No changes need to be made to the system. (3) High compatibility. (4) In engineering use, it can greatly reduce the development workload and the communication cost between the system manufacturer and the application developer.
[0063] It should be noted that one of the key points of the present invention is to implement the logic of enabling and disabling the single application in the application, obtain the execution permission through system signature, decouple from the system, and no modification is required for the system. The second key point is reversibility, and it can be decided at any time whether to set it to the single-application mode or restore it to the original system mode according to the control instruction.
[0064] The above method will be introduced in detail through one or more embodiments below.
[0065] As Figure 1 shown, the single-application mode processing method based on an Android device described in the present invention is executed in the Android device 10. The Android device 10 can be a mobile phone, a tablet computer, a laptop computer, a virtual host, etc.
[0066] The embodiment of the present invention is to introduce the switching between the original system desktop and the target system desktop in the single-application mode. One or more embodiments will be provided below to specifically introduce the single-application mode processing solution based on an Android device.
[0067] Embodiment 1
[0068] Please refer to Figure 2 to show the overall step flow chart of the single-application mode processing method based on an Android device according to the embodiment of the present invention in the enterprise application scenario to meet the usage requirements of enterprises for Android devices.
[0069] The following will be described by taking the Android device 10 as the execution subject for illustration, specifically as follows:
[0070] As shown Figure 2 in the figure, the single-application mode processing method based on the Android device may include steps S100 to S120, where:
[0071] Step S100, obtaining a first instruction for entering the single-application mode; wherein, the single-application mode is used to switch the Android device 10 from the original system desktop to the target system desktop, the original system desktop is the system default desktop of the Android device 10, and the target system desktop is the graphical user interface of the target application.
[0072] The original system desktop accommodates icon components (app widgets) of multiple third-party applications (such as, LanXin, Google Chrome, WeChat, DingTalk). Users can enter the corresponding third-party applications through these icon components on the original system desktop. After the Android device 10 enters the single-application mode, the Android desktop switches from the original system desktop to the target system desktop. The target system desktop uses the graphical user interface (such as the main interface) of the target application as the system desktop of the Android device 10 (i.e., the only interface entry).
[0073] In an exemplary embodiment, the Android device 10 can generate the first instruction in the following two ways:
[0074] (1) Generating the first instruction through a single-application mode switch button.
[0075] For example, when the Android device 10 receives an activation trigger operation (such as a physical or virtual key operation) on the single-application mode switch button of the Android device 10, it generates the first instruction to indicate entering the single-application mode.
[0076] (2) Generating the first instruction when the Android device 10 meets a preset trigger condition.
[0077] For example, the preset trigger condition can be set to generate the first instruction for the Android device 10 to enter the single-application mode at 9:00 am every day, which helps to quickly activate the single-application mode and is especially applicable to enterprise scenarios.
[0078] Step S120: According to the first instruction, execute the target desktop code of the target system desktop and stop running the original desktop code of the original system desktop to enter the single-application mode, so as to switch the Android device 10 from the original system desktop to the target system desktop; wherein, the target desktop code has the permission to control entering and exiting the target system desktop, and the permission is obtained in advance based on the system signature of the Android device.
[0079] To effectively improve the efficiency of desktop application switching, please refer to Figure 3 , Step S120 can be obtained through the following operations, where: Step S122: According to the first instruction, add a first status value to the target desktop code of the target system desktop, and the first status value indicates that the target system desktop is in an allowed startup state; Step S124: According to the first instruction, add a second status value to the original desktop code of the original system desktop, and the original desktop code is used to control entering and exiting the original system desktop, and the second status value indicates that the original system desktop is in a prohibited startup state; and Step S126: According to the first status value and the second status value, execute the target desktop code and stop running the original desktop code to enter the single-application mode, so as to switch the Android device 10 from the original system desktop to the target system desktop. In the embodiment of the present invention, by setting the first status value and the second status value, the goal of switching the original system desktop to the target system desktop in the single-application mode is achieved.
[0080] In an exemplary embodiment, in order to ensure that the target system desktop has the permission to be displayed as the system desktop of the Android device 10, it is necessary to pre-configure multiple desktop property tags for the target system desktop during the code development stage. Exemplarily, the Android device 10 loads the target system desktop by running the target desktop code of the target system desktop, where the target desktop code is used to control entering and exiting the target system desktop. The target desktop code includes the code of the entry desktop component of the target application, and the entry desktop component is used to load the graphical user interface of the target application on the Android device 10. Please refer to Figure 4 , The Android device 10 also performs the following operations, where: Step S300: Pre-create an alias for the entry desktop component, and the alias for the entry desktop component is used to execute each function in the entry desktop component and execute the new functions in the single-application mode through the entry desktop component; and Step S302: Add multiple desktop property tags to the alias for the entry desktop component to determine that the target system desktop has the permission to be the system desktop of the Android device 10 according to the multiple desktop property tags.
[0081] For example, configure an activity-alias (i.e., the entry desktop component alias) for the entry Activity of the target application (i.e., the entry desktop component). As an alias of an existing entry Activity, the activity-alias can quickly call the Activity through the label declaration of the activity-alias, and multiple desktop property labels are added to the activity-alias. For example, android.intent.category.LAUNCHER (which determines whether the application is displayed in the program list and is launched as the main menu) and android.intent.category.HOME (which determines whether it can be launched as an option for the desktop application), etc. Only the application with desktop property labels has the permission to be loaded as the system desktop on the Android device 10. Therefore, pre-configuring multiple desktop property labels for the activity-alias corresponding to the target system desktop enables the target system desktop of the target application to have the permission to be the system desktop of the Android device 10, which can better support the subsequent development of the target desktop code related to the single-application mode.
[0082] To ensure that the target desktop code can run effectively on the Android device 10, the method further includes the step of pre-testing the target desktop code sent by the application developer during the code development stage. Please refer to Figure 5 , and this test step includes steps S400 to S404, where: Step S400, obtain the permission to control the execution of the target desktop code according to the system signature of the Android system in the Android device 10; Step S402, test the target desktop code according to the permission; and Step S404, determine that the target desktop code enters the test-passed state or determine that the target desktop code enters the code-modification state according to the test result.
[0083] For example, obtain the system signature provided by the Android system manufacturer. This system signature can grant the execution permission of the target desktop code corresponding to the target system desktop in the Android system, so as to complete the development and application of the target desktop code through this permission. Moreover, the implementation logic and process of enabling and disabling the single-application mode are written into the target desktop code corresponding to the target application in the form of code, decoupled from the system, and no modification is required at the source code level of the Android system. That is, directly modify the target desktop code at the application level without reflashing the Android system on the Android device; in engineering use, it can greatly reduce the development workload of the system and shorten the development cycle of the single-application mode; when developing, the application developer only needs to obtain the system signature of the Android system manufacturer to obtain the authorization of the execution permission of the target desktop code, and then can carry out subsequent code development and application, greatly reducing the communication cost between the Android system manufacturer and the application developer; it is convenient to quickly test, develop and apply the target desktop code.
[0084] In an exemplary embodiment, in order to quickly start the target system desktop and switch the original system desktop to the target system desktop, please refer to Figure 6 , step S122 may further include steps S500 to S502, where: step S500, determine the specified component according to the component name of the entry desktop component alias, and the specified component includes the entry desktop component and the entry desktop component alias; and step S502, set the first attribute state of the specified component to the first state value, and the first state value indicates that the desktop permission of the target system desktop is allowed to be enabled.
[0085] In the Android device 10, by calling the system method: public abstract void setComponentEnabledSetting(ComponentName componentName, int newState, int flags) to set the enabled attribute (the attribute indicating whether it is allowed to be enabled, that is, the first attribute state) of the specified component to true (allowed to be enabled) or false (not allowed to be enabled) to determine whether to enable the target system desktop as a desktop application. Among them, public abstract void setComponentEnabledSetting(ComponentName componentName, int newState, int flags) represents the method for obtaining the state of the component; ComponentName represents the component name; newState represents the new state of the component, and the new state of the component can be set to:
[0086] The prohibited enabled state (COMPONENT_ENABLED_STATE_DISABLED) or the permitted enabled state (COMPONENT_ENABLED_STATE_ENABLED); flags represents a behavior tag, and the corresponding value of the behavior tag can be DONT_KILL_APP or 0. Among them, DONT_KILL_APP indicates that the application containing this component is not cleared, and 0 indicates that the application containing this component is cleared; int represents a data format.
[0087] In the embodiment of the present invention, ComponentName is correspondingly set to the component name of the entry desktop component of the target application; the first attribute state is set to COMPONENT_ENABLED_STATE_ENABLED (i.e., the first state value), that is, the first state value corresponds to true; flags is set to DONT_KILL_APP. By setting the first attribute state as above, the rapid enablement of the target system desktop is achieved. Since the present invention realizes the Android device 10 entering the single-application mode by setting the first attribute state of the component name of the target application, it does not require the Android system manufacturer to provide a software development kit for developing the single-application mode, nor does it involve the model of the Android device 10. Therefore, the single-application mode processing method based on the Android device described in the embodiment of the present invention has no requirements for the model of the Android device 10, can be applied to any Android device 10 based on the Android system, has high compatibility, and is not restricted by the software development kit; and the target application can be set according to the actual project requirements, and there is no problem of adaptability.
[0088] In an exemplary embodiment, in order to quickly disable the original system desktop, please refer to Figure 7 , step S124 may further include steps S600 to S602, where: step S600, determining the desktop package of the original system desktop through the desktop package name, and the desktop package name is the name of the desktop package of the original system desktop; and step S602, setting the second attribute state of the desktop package to the second state value, and the second state value indicates that the desktop permission of the original system desktop is prohibited from being enabled.
[0089] In the target application of the Android device 10, the original system desktop is disabled by calling the method public abstract void setApplicationEnabledSetting(String packageName, int newState, int flags). Among them, public abstract void setApplicationEnabledSetting represents the method for obtaining the status of the application; Enabled represents the status of the second attribute; packageName represents the name of the desktop package corresponding to the application; newState represents the new status of the desktop package; and String represents a data format.
[0090] In the embodiment of the present invention, packageName is correspondingly set to the name of the desktop package of the original system desktop; the second attribute status is set to PACKAGE_ENABLED_STATE_DISABLED (i.e., the second state value); and flags is set to DONT_KILL_APP. Through the setting of the above second attribute status, the rapid disabling of the original system desktop is achieved.
[0091] In an exemplary embodiment, in order to achieve a quick exit from the single-application mode, as Figure 8 shown, the method further includes steps for exiting the single-application mode, including: Step S700, obtaining a second instruction for exiting the single-application mode; Step S702, determining the desktop package of the original system desktop based on the desktop package name according to the second instruction; Step S704, setting the second attribute status to a third state value, where the third state value indicates that the desktop permission of the original system desktop is allowed to be enabled; Step S706, setting the first attribute status to a fourth state value, where the fourth state value indicates that the desktop permission of the target system desktop is prohibited from being enabled; and Step S708, executing the original desktop code and stopping the execution of the target desktop code according to the third state value and the fourth state value to exit the single-application mode, so as to switch the Android device 10 from the target system desktop to the original system desktop.
[0092] In this embodiment, the second attribute state of the desktop package of the original system desktop is set to PACKAGE_ENABLED_STATE_ENABLED (i.e., the third state value); the flags are set to DONT_KILL_APP; the first attribute state of the alias of the entry desktop component of the target application is set to COMPONENT_ENABLED_STATE_DISABLED (i.e., the fourth state value), that is, the first state value corresponds to false; the flags are set to DONT_KILL_APP. Through the above setting of the second attribute state, the quick enablement of the original system desktop is achieved; through the above setting of the first attribute state, the quick disablement of the target system desktop is achieved, that is, the logic code implemented for the single-application mode in the embodiment of the present invention converges in the target application, and can cooperate with the first instruction or the second instruction to determine whether to set it to the single-application mode or restore it to the original system desktop. According to the first instruction or the second instruction, the quick switching between the target system desktop and the original system desktop in the single-application mode can be achieved, so that the switching between different system desktops is reversible.
[0093] In an exemplary embodiment, to ensure that the default system desktop or the target system desktop can be effectively loaded each time the Android device 10 is powered on. Exemplarily, the Android system in the Android device 10 includes a desktop application loading component, and the desktop application loading component includes a plurality of desktop property tags. The desktop application loading component is used to load the original system desktop or the target system desktop after the Android system is powered on. Please refer to Figure 9 , the method further includes a control step for the desktop application loading component, and the control step includes: step S800, obtaining the current system version of the Android system; and step S802, if the version number of the current system version is higher than the version number of the preset system version, then setting the loading attribute state of the desktop application loading component to the fifth state value, and the fifth state value indicates that the system desktop loading is allowed to start, so that the desktop application loading component loads the original system desktop or the target system desktop after the Android system is powered on.
[0094] The version number of the preset system version is set to Android 7.0. The desktop application loading component is com.android.settings.FallBackHome, which is used to load and start the system desktop application after the Android system is powered on or restarted. Therefore, it is necessary to ensure that the desktop application loading component remains always-on, that is, to ensure that the loading property status of the desktop application loading component is the fifth status value; the loading property status indicates that the desktop application of the Android device 10 is in a state with the loading permission to load and start the system desktop application; the fifth status value indicates that the system desktop is allowed to be loaded and started. If the loading property status of the desktop application loading component indicates that the system desktop is prohibited from being loaded and started, the Android system will always be in the boot animation interface after being powered on. Exemplarily, when the current system version of the Android system is the Android 8.0 version, it is considered that the Android 8.0 version is higher than the Android 7.0 version, and the desktop application loading component is set to be always-on to ensure that the Android device 10 can normally and effectively load and start the system desktop.
[0095] To make the present invention easier to understand, as Figure 10 , the following provides the overall step flowchart for entering or exiting the single-application mode.
[0096] ① According to the instruction, determine whether to enable the single-application mode.
[0097] ② If the determination result in step ① is to enable the single-application mode, add the first property status to the target system desktop.
[0098] ③ After step ②, save the package name of the desktop of the original system desktop.
[0099] ④ After step ③, set the original system desktop to prohibit the operation of the original system desktop application, then the single-application mode is enabled.
[0100] ⑤ If the determination result in step ① is not to enable the single-application mode, obtain the package name of the saved original system desktop (Launcher).
[0101] ⑥ After step ⑤, set the second property status of the package name of the original system desktop to restore the original system desktop application.
[0102] ⑦ After step ⑥, hide the first property status of the target system desktop to exit the single-application mode.
[0103] The single-application mode processing method, system, computer device, and computer-readable storage medium based on an Android device provided by an embodiment of the present invention execute target desktop code according to a first instruction and prohibit the original desktop code from running, so as to realize the switching from the original system desktop to the target system desktop of the single-application mode, effectively improving the efficiency of desktop application switching. Among them, the target desktop code is used to control the permissions for entering and exiting the target desktop system and is obtained through system signature without the need to modify the system source code. Therefore, the target desktop code is decoupled from the system, effectively improving the development and application efficiency of the new desktop in this special scenario of the single-application mode.
[0104] Embodiment 2
[0105] Please continue to refer to Figure 11 , which shows a schematic diagram of program modules of the single-application mode processing system based on an Android device according to the present invention. In this embodiment, the single-application mode processing system 20 based on an Android device may include or be divided into one or more program modules. One or more program modules are stored in a storage medium and executed by one or more processors to complete the present invention and implement the above-mentioned single-application mode processing method based on an Android device. The program modules referred to in the present invention refer to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment:
[0106] An acquisition module 900 is configured to acquire a first instruction for entering the single-application mode; wherein, the single-application mode is used to switch the Android device 10 from the original system desktop to the target system desktop, the original system desktop is the system default desktop of the Android device 10, and the target system desktop is the graphical user interface of the target application;
[0107] A switching module 902 is configured to execute the target desktop code of the target system desktop and stop running the original desktop code of the original system desktop according to the first instruction to enter the single-application mode, so as to switch the Android device from the original system desktop to the target system desktop; wherein, the target desktop code has the permission to control entering and exiting the target system desktop, and the permission is obtained in advance based on the system signature of the Android device.
[0108] In an exemplary embodiment, the switching module 902 is further configured to add a first status value to the target desktop code of the target system desktop according to the first instruction, where the first status value indicates that the target system desktop is in an allowed startup state; add a second status value to the original desktop code of the original system desktop according to the first instruction, where the original desktop code is used to control entry into and exit from the original system desktop, and the second status value indicates that the original system desktop is in a prohibited startup state; and execute the target desktop code and stop running the original desktop code to enter the single-application mode according to the first status value and the second status value, so as to switch the Android device from the original system desktop to the target system desktop.
[0109] In an exemplary embodiment, the target desktop code includes the code of the entry desktop component of the target application, and the entry desktop component is used to load the graphical user interface of the target application on the Android device 10. The single-application mode processing system 20 based on the Android device further includes: a configuration module 904, configured to pre-create an entry desktop component alias, where the entry desktop component alias is used to execute each function in the entry desktop component and execute the newly added functions in the single-application mode through the entry desktop component; and add a plurality of desktop property tags to the entry desktop component alias, so as to determine that the target system desktop has the permission to be the system desktop of the Android device 10 according to the plurality of desktop property tags.
[0110] In an exemplary embodiment, the switching module 902 is further configured to: determine a specified component according to the component name of the entry desktop component alias, where the specified component includes the entry desktop component and the entry desktop component alias; and set the first attribute status of the specified component to the first status value, where the first status value indicates that the desktop permission of the target system desktop is allowed to be started.
[0111] In an exemplary embodiment, the switching module 902 is further configured to: determine the desktop package of the original system desktop through the desktop package name, where the desktop package name is the name of the desktop package of the original system desktop; and set the second attribute status of the desktop package to the second status value, where the second status value indicates that the desktop permission of the original system desktop is prohibited from being started.
[0112] In an exemplary embodiment, the switching module 902 is further configured to: obtain a second instruction for exiting the single-application mode; determine the desktop package name of the original system desktop according to the second instruction; set the second attribute status to a third status value, where the third status value indicates that the desktop permission of the original system desktop is allowed to be enabled; set the first attribute status to a fourth status value, where the fourth status value indicates that the desktop permission of the target system desktop is prohibited from being enabled; and execute the original desktop code and stop running the target desktop code according to the third status value and the fourth status value to exit the single-application mode, so as to switch the Android device 10 from the target system desktop to the original system desktop.
[0113] In an exemplary embodiment, the single-application mode processing system 20 based on the Android device further includes a testing module 906. The testing module 906 is further configured to: obtain the code execution permission of the initial target desktop code according to the system signature of the Android system in the Android device 10; test the initial target desktop code according to the code execution permission; and determine that the initial target desktop code is the target desktop code or determine that the initial target desktop code enters the code modification state according to the test result.
[0114] In an exemplary embodiment, the Android system in the Android device 10 includes a desktop application loading component. The desktop application loading component includes a plurality of desktop property tags, and the desktop application loading component is configured to load the original system desktop or the target system desktop after the Android system is powered on. The single-application mode processing system 20 based on the Android device further includes a setting module 908. The setting module 908 is further configured to: obtain the current system version of the Android system; and if the version number of the current system version is higher than the version number of the preset system version, set the loading attribute status of the desktop application loading component to a fifth status value, where the fifth status value indicates that the system desktop loading and startup are allowed, so that the desktop application loading component loads the original system desktop or the target system desktop after the Android system is powered on.
[0115] Embodiment III
[0116] Refer to Figure 12, is a schematic diagram of the hardware architecture of the computer device 2 in the third embodiment of the present invention. The computer device 2 can be an Android device 10 or a part of the Android device 10. In this embodiment, the computer device 2 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. The computer device 2 can be a rack server, a blade server, a tower server, or a cabinet server (including an independent server or a server cluster composed of multiple servers), etc. As Figure 12 shown, the computer device 2 at least includes, but is not limited to, a memory 21, a processor 22, a network interface 23, and a single-application mode processing system 20 based on the Android device, which can communicate with each other through the system bus. Among them:
[0117] In this embodiment, the memory 21 at least includes one type of computer-readable storage medium. The readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 21 can be an internal storage unit of the computer device 2, such as the hard disk or memory of the computer device 2. In other embodiments, the memory 21 can also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc., equipped on the computer device 2. Of course, the memory 21 can also include both the internal storage unit and the external storage device of the computer device 2. In this embodiment, the memory 21 is generally used to store the operating system and various application software installed on the computer device 2, such as the program code of the single-application mode processing system 20 based on the Android device in the above embodiment. In addition, the memory 21 can also be used to temporarily store various data that have been output or will be output.
[0118] In some embodiments, the processor 22 can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 22 is generally used to control the overall operation of the computer device 2. In this embodiment, the processor 22 is used to run the program code stored in the memory 21 or process data, such as running the single-application mode processing system 20 based on the Android device to implement the single-application mode processing method based on the Android device in the above embodiment.
[0119] The network interface 23 may include a wireless network interface or a wired network interface, which is generally used to establish a communication connection between the computer device 2 and other electronic devices. For example, the network interface 23 is used to connect the computer device 2 to an external terminal through a network, and to establish a data transmission channel and a communication connection between the computer device 2 and the external terminal. The network may be an enterprise internal network (Intranet), the Internet, Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi or other wireless or wired networks.
[0120] It should be noted that Figure 12 only the computer device 2 with components 20-23 is shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively.
[0121] In this embodiment, the single-application mode processing system 20 based on the Android device stored in the memory 21 can also be divided into one or more program modules, which are stored in the memory 21 and executed by one or more processors (processor 22 in this embodiment) to complete the present invention.
[0122] For example, Figure 11 shows a schematic diagram of program modules of the second embodiment of the single-application mode processing system 20 based on the Android device. In this embodiment, the single-application mode processing system 20 based on the Android device can be divided into an acquisition module 900 and a switching module 902. Herein, the program module refers to a series of computer program instruction segments that can complete specific functions, and is more suitable for describing the execution process of the single-application mode processing system 20 based on the Android device in the computer device 2. The specific functions of the program modules 900-902 have been described in detail in the second embodiment and will not be elaborated herein.
[0123] Embodiment 4
[0124] This embodiment also provides a computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, server, App application store, etc., on which a computer program is stored. When the program is executed by a processor, corresponding functions are implemented. The computer-readable storage medium of this embodiment is used to store the single-application mode processing system 20 based on an Android device, and when executed by a processor, it implements the single-application mode processing method based on an Android device in the above embodiment.
[0125] The serial numbers of the above embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments.
[0126] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0127] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structural or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. A single application mode processing method based on an Android device, characterized in that, it includes: obtaining a first instruction for entering the single application mode; wherein, the single application mode is used to switch the Android device from the original system desktop to the target system desktop, the original system desktop is the system default desktop of the Android device, and the target system desktop is the graphical user interface of the target application; and executing the target desktop code of the target system desktop according to the first instruction and stopping the execution of the original desktop code of the original system desktop to enter the single application mode, so as to switch the Android device from the original system desktop to the target system desktop; the step of executing the target desktop code of the target system desktop according to the first instruction and stopping the execution of the original desktop code of the original system desktop to enter the single application mode, so as to switch the Android device from the original system desktop to the target system desktop, includes: adding a first status value to the target desktop code of the target system desktop according to the first instruction, and the first status value indicates that the target system desktop is in an allowed startup state; adding a second status value to the original desktop code of the original system desktop according to the first instruction, the original desktop code is used to control entering and exiting the original system desktop, and the second status value indicates that the original system desktop is in a prohibited startup state; and executing the target desktop code and stopping the execution of the original desktop code according to the first status value and the second status value to enter the single application mode, so as to switch the Android device from the original system desktop to the target system desktop; wherein, the target desktop code has the permission to control entering and exiting the target system desktop, and the permission is obtained in advance based on the system signature of the Android device; wherein: the target desktop code includes the code of the entry desktop component of the target application, and the entry desktop component is used to load the graphical user interface of the target application on the Android device; the method further includes: pre-creating an alias for the entry desktop component, and the alias for the entry desktop component is used to execute each function in the entry desktop component and execute the new functions in the single application mode through the entry desktop component; and adding a plurality of desktop property tags to the alias for the entry desktop component to determine that the target system desktop has the permission to be used as the system desktop of the Android device according to the plurality of desktop property tags.
2. The single application mode processing method based on an Android device according to claim 1, characterized in that, the step of adding the first status value to the target desktop code of the target system desktop includes: determining a specified component according to the component name of the alias for the entry desktop component, and the specified component includes the entry desktop component and the alias for the entry desktop component; Set the first attribute status of the specified component to the first status value, where the first status value indicates that the desktop permission of the target system desktop is allowed to be enabled.
3. The single-application mode processing method based on an Android device according to claim 2, wherein, the step of adding the second status value to the original desktop code of the original system desktop includes: determining the desktop package of the original system desktop through the desktop package name, where the desktop package name is the name of the desktop package of the original system desktop; and setting the second attribute status of the desktop package to the second status value, where the second status value indicates that the desktop permission of the original system desktop is prohibited from being enabled.
4. The single-application mode processing method based on an Android device according to claim 3, wherein, the method further includes: obtaining a second instruction for exiting the single-application mode; determining the desktop package of the original system desktop through the desktop package name according to the second instruction; setting the second attribute status to a third status value, where the third status value indicates that the desktop permission of the original system desktop is allowed to be enabled; setting the first attribute status to a fourth status value, where the fourth status value indicates that the desktop permission of the target system desktop is prohibited from being enabled; and executing the original desktop code and stopping the execution of the target desktop code according to the third status value and the fourth status value to exit the single-application mode, so as to switch the Android device from the target system desktop to the original system desktop.
5. The single-application mode processing method based on an Android device according to any one of claims 1 to 4, wherein, the method further includes a step of pre-testing the target desktop code, and the testing step includes: obtaining the permission to control the execution of the target desktop code according to the system signature of the Android system in the Android device; testing the target desktop code according to the permission; and determining that the target desktop code enters the test passed state or determining that the target desktop code enters the code modification state according to the test result.
6. The single-application mode processing method based on an Android device according to any one of claims 1 to 4, wherein, the Android system in the Android device includes a desktop application loading component, the desktop application loading component includes a plurality of desktop property tags, and the desktop application loading component is used to load the original system desktop or the target system desktop after the Android system is powered on; the method further includes: obtaining the current system version of the Android system; and if the version number of the current system version is higher than the version number of the preset system version, setting the loading attribute status of the desktop application loading component to a fifth status value, where the fifth status value indicates that the system desktop loading and startup are allowed, so that the desktop application loading component loads the original system desktop or the target system desktop after the Android system is powered on.
7. A single application mode processing system based on an Android device, characterized in that, it includes: An acquisition module, configured to acquire a first instruction for entering the single application mode; wherein, the single application mode is used to switch the Android device from the original system desktop to the target system desktop, the original system desktop is the system default desktop of the Android device, and the target system desktop is the graphical user interface of the target application; A switching module, configured to execute the target desktop code of the target system desktop according to the first instruction and stop running the original desktop code of the original system desktop to enter the single application mode, so as to switch the Android device from the original system desktop to the target system desktop; The step of executing the target desktop code of the target system desktop according to the first instruction and stopping running the original desktop code of the original system desktop to enter the single application mode, so as to switch the Android device from the original system desktop to the target system desktop includes: According to the first instruction, add a first status value to the target desktop code of the target system desktop, and the first status value indicates that the target system desktop is in an allowed start state; According to the first instruction, add a second status value to the original desktop code of the original system desktop, and the original desktop code is used to control entering and exiting the original system desktop, and the second status value indicates that the original system desktop is in a prohibited start state; and According to the first status value and the second status value, execute the target desktop code and stop running the original desktop code to enter the single application mode, so as to switch the Android device from the original system desktop to the target system desktop; wherein, the target desktop code has the permission to control entering and exiting the target system desktop, and the permission is obtained in advance based on the system signature of the Android device; wherein: The target desktop code includes the code of the entry desktop component of the target application, and the entry desktop component is used to load the graphical user interface of the target application on the Android device; the system further includes: A configuration module, configured to pre-create an alias for the entry desktop component, and the alias for the entry desktop component is used to execute various functions in the entry desktop component and execute new functions in the single application mode; and Add a plurality of desktop property tags to the alias of the entry desktop component, so as to determine that the target system desktop has the permission to be used as the system desktop of the Android device according to the plurality of desktop property tags.
8. A computer device, the computer device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the single application mode processing method based on the Android device according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program can be executed by at least one processor so that the at least one processor executes the steps of the single-application mode processing method based on an Android device according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, wherein, when the computer program is executed by a processor, it implements the steps of the single-application mode processing method based on an Android device according to any one of claims 1 to 6.
Citation Information
Patent Citations
Double-desktop switching method, terminal and computer storage medium
CN110837663A