Cross-system application program running method and electronic equipment
Patent Information
- Application Number
- CN202380025693.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-03-09
- Filing Date
- 2023-02-23
- Publication Date
- 2024-11-26
AI Technical Summary
Poor compatibility between different software systems makes it difficult for users to use applications on one software system without distinction on another software system, resulting in poor user experience.
By obtaining the application information in the second software system in the first software system, displaying its desktop icon, and communicating with the second software system through the proxy APK, cross-system operations are realized to ensure execution under a satisfactory operating environment and improve system stability. sex.
Users can operate applications in the second software system without distinction on the first software system, which improves user experience, simplifies application startup methods, and enhances system stability.
Smart Images

Figure CN119032341A_ABST
Abstract
Description
Method for running application across systems and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on March 9, 2022, with application number 202210230654.8 and application name “A method and electronic device for running applications across systems”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a method, device, and electronic device for running an application across systems. Background Art
[0003] With the continuous development of electronic devices, the same electronic device can be equipped with different software systems, and different software systems can install different applications to adapt to different scenarios. For example, an electronic device can be equipped with the Android system and the Linux system, or the Android system and the Windows system, and so on.
[0004] When an electronic device is equipped with different software systems, it can use one of the software systems as the main system and the other systems as auxiliary systems, and the auxiliary systems can be installed or run in a virtual machine or container. For example, taking an electronic device equipped with an Android system and a Linux system as an example, the electronic device can use the Android system as its main system and the Linux system as its auxiliary system, wherein the Linux system can be installed in a virtual machine. When an electronic device is equipped with different software systems, due to the poor compatibility between different software systems, it is difficult for users to use other software systems on one software system without distinction. For example, it is difficult to operate an application on another software system in the same way as an application on one software system.
[0005] Summary of the Invention
[0006] The present application provides a method for running an application across systems, an electronic device, a computer-readable storage medium, a computer program product, and a chip system, which can achieve the indiscriminate use of other software systems on one software system.
[0007] In a first aspect, the present application provides a method for running an application across systems. The method can be applied to an electronic device. The electronic device can be equipped with a first software system and a second software system. The second software system runs based on the first software system. The method may include: in response to a first operation obtained, obtaining application information of at least one target application in the second software system through the first software system, where the target application is an application installed in the second software system, and the application information includes one or more of the target application's icon, identifier, and executable path; and displaying a desktop icon for the target application in the first software system.
[0008] In this way, by displaying the desktop icon of the application in the second software system in the first software system, the user can quickly start the application in the second software system by clicking the desktop icon of the application in the second software system displayed in the first software system, so that the method of starting the application in the second software system is the same as the method of starting the application in the first software system, and thus the user can operate the application in the second software system on the first software system without distinction, thereby improving the user experience.
[0009] In a possible implementation, the first software system is an Android system, and the second software system is a Linux system.
[0010] In one possible implementation, obtaining application information of at least one target application in a second software system through a first software system specifically includes: launching a first main activity in a proxy Android application package APK in the first software system according to a first operation; sending a first message to the second software system through the first main activity, the first message being used to obtain application information of at least one target application in the second software system; and obtaining a second message fed back by the second software system through the first main activity, the second message including application information of the at least one target application. This enables communication between the first and second software systems. For example, the first operation may be launching the proxy APK.
[0011] In one possible implementation, displaying a desktop icon of a target application in a first software system specifically includes registering application information of the target application to a desktop launcher of the first software system through a first main activity, so as to display a desktop icon of the target application in the first software system.
[0012] In one possible implementation, after displaying the target application's desktop icon in the first software system, the method further includes controlling the first main activity to terminate execution. Thus, after displaying the target application's desktop icon in the first software system, the lifecycle of the first main activity is controlled and received, thereby achieving the purpose of displaying the application in the second software system in the first software system by utilizing the activity lifecycle management solution.
[0013] In one possible implementation, before sending the first message to the second software system via the first main activity, the method further includes: determining, via the first main activity, whether the first software system meets the operating environment requirements of the second software system; if so, sending the first message to the second software system via the first main activity; if not, automatically installing the second software system, or displaying a prompt on the display interface of the first software system prompting the installation of the second software system. In this way, by detecting the operating environment of the second software system, the method can ensure that the operating environment meets the requirements of the second software system, thereby improving system stability.
[0014] In one possible implementation, after displaying the target application's desktop icon in the first software system, the method further includes: in response to a received second operation, launching a second main activity (main activity) in the proxy Android application package (APK) in the first software system, where the second operation is an operation to launch the target application; notifying the second software system via the second main activity to launch the target application and notifying the proxy APK to establish a first application activity (app activity 1) associated with the target application; obtaining the application interface of the target application sent by the second software system via app activity 1; and displaying the application interface of the target application in the first software system. This allows users to launch and run applications in the second software system without distinction in the first software system, thereby improving the user experience.
[0015] In a possible implementation, after notifying the second software system to start the target application through the second main activity and notifying the proxy APK to establish a first application activity app activity 1 associated with the target application, the method further includes: controlling the second main activity to end execution.
[0016] In one possible implementation, after the application interface of the target application is displayed in the first software system, the method further includes: obtaining a third operation through app activity 1, the third operation being an operation of starting a sub-interface in the application interface; notifying the second software system through app activity 1 to start the sub-interface in the application interface; obtaining the sub-interface in the application interface sent by the second software system through the proxy APK, and establishing a second application activity app activity 2 associated with the sub-interface; and displaying the sub-interface in the application interface in the first software system. In this way, by creating an app activity for each different interface in a target application, the app activity corresponding to a certain interface can accurately identify the user's operation on the interface, thus avoiding the situation where a target application only corresponds to one app activity, which makes it difficult for the app activity to accurately identify the user's operation, thereby being able to respond to the user's operation immediately and improving the user experience.
[0017] In a possible implementation, after the sub-interface in the application interface is displayed in the first software system, the method further includes: controlling app activity 1 to pause running.
[0018] In one possible implementation, after the sub-interface in the application interface is displayed in the first software system, the method further includes: in response to the operation of closing the sub-interface obtained by app activity 2, controlling app activity 2 to end running, and / or controlling app activity 1 to switch from a paused running state to a resumed running state.
[0019] In one possible implementation, after the application interface of the target application is displayed in the first software system, the method further includes: in response to the operation of closing the application interface obtained by app activity 1, controlling app activity 1 to end running; wherein, when the proxy APK establishes app activity 2 associated with the sub-interface of the application interface, app activity 2 associated with the sub-interface of the application interface is simultaneously controlled to end running.
[0020] In a second aspect, the present application provides a device for running an application across systems, which is contained in an electronic device and has the function of implementing the method described in the first aspect or any possible implementation of the first aspect.
[0021] In a third aspect, the present application provides an electronic device, characterized in that it includes: a processor, the processor being used to run a computer program stored in a memory so that the electronic device implements the method described in the first aspect or any possible implementation of the first aspect.
[0022] In a fourth aspect, the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, which, when executed by a processor, implements the method described in the first aspect or any possible implementation of the first aspect.
[0023] In a fifth aspect, the present application provides a computer program product, characterized in that when the computer program product runs on an electronic device, it enables the electronic device to implement the method described in the first aspect or any possible implementation of the first aspect.
[0024] In a sixth aspect, the present application provides a chip system, characterized in that the chip system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the method described in the first aspect or any possible implementation of the first aspect.
[0025] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The following is a brief introduction to the drawings required for describing the embodiments or prior art.
[0027] FIG1 is a schematic diagram of an embodiment of the present application providing a method for running an application in a Linux system on an Android system desktop;
[0028] FIG2 is a system architecture diagram of a software system installed in an electronic device according to an embodiment of the present application;
[0029] FIG3 is a schematic diagram of displaying an application icon of a Linux system on an Android system desktop according to an embodiment of the present application;
[0030] FIG4 is a flow chart of a method for running an application across systems provided by an embodiment of the present application;
[0031] FIG5 is a schematic diagram of a process of prompting a user of an Android Linux system according to an embodiment of the present application;
[0032] FIG6 is a schematic diagram of switching a display interface of an application in a Linux system on an Android system desktop provided by an embodiment of the present application;
[0033] 7 is a schematic diagram of switching the display interface of an application in a Linux system on an Android system desktop provided by an embodiment of the present application;
[0034] FIG8 is a schematic diagram of switching a display interface of an application in a Linux system on an Android system desktop provided by an embodiment of the present application;
[0035] FIG9 is a schematic diagram of a process of operating an application in a Linux system across an Android system according to an embodiment of the present application;
[0036] FIG10 is a process for managing the activity life cycle in an Android system provided by an embodiment of the present application;
[0037] FIG11 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0038] FIG12 is a schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The term "and / or" as used herein describes an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. The symbol " / " as used herein indicates that the related objects are in an "or" relationship, for example, A / B means either A or B.
[0040] The terms "first" and "second" in this specification and claims are used to distinguish different objects rather than to describe a specific order of objects. For example, "first response message" and "second response message" are used to distinguish different response messages rather than to describe a specific order of response messages.
[0041] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0042] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more, for example, multiple processing units means two or more processing units, etc.; multiple elements means two or more elements, etc.
[0043] Generally, taking an electronic device equipped with an Android system and a Linux system, and the main system of the electronic device being the Android system as an example, when the Linux system is needed, it is often necessary to run the Linux system in a virtual machine or container, and the desktop of the Linux system is displayed as a window on the desktop of the Android system. When a user operates an application in the Linux system, the operation can only be performed in the window where the desktop of the Linux system is located, and no matter how many applications in the Linux system are run, the activity range of these applications can only be within the window where the desktop of the Linux system is located, and they cannot be moved or scaled separately, resulting in a poor user experience. For example, as shown in Figure 1, if a user runs three applications in two independent windows on the Android system; the three applications are Android app, Linux app1, and Linux app2, among which the Android app is displayed on the Android desktop (i.e., the desktop of the Android system) in the form of an independent window, while the two applications Linux app1 and Linux app2 are displayed on the Linux desktop (i.e., the desktop of the Linux system), and the entire Linux desktop is displayed on the Android desktop as a window of the Android system.
[0044] Therefore, the present application proposes a method for operating applications across systems. Based on running a first software system, an electronic device can run a second software system through a virtual machine or container, and run applications through the second software system. The electronic device can also display applications that have been installed and / or running in the second software system in the interface of the first software system, so that the user can operate the applications in the second software system using the operating methods in the first software system under the first software system. Furthermore, the user can use the second software system without distinction under the first software system, realizing cross-system application operation and improving the user experience.
[0045] The following describes the software system architecture of an electronic device using an Android system and a Linux system running in a container as an example.
[0046] For example, Figure 2 illustrates the system architecture of a software system installed in an electronic device, where the first software system of the electronic device is the Android system, and the second software system is the Linux system. As shown in Figure 2, both the Android system and the Linux system utilize the Linux kernel. Furthermore, the Android system may include an application framework layer and an application layer; the Linux system includes a window service (weston) and multiple applications.
[0047] The Android system's application framework layer includes the input manager service (IMS), the activity manager service (AMS), the window manager service (WMS), and the surface flinger. The IMS manages input operations detected by electronic devices, the AMS manages the activities of individual applications, the WMS manages the windows of individual applications, and the surface flinger is the service process responsible for synthesizing all display layers in the Android system.
[0048] The Android system's application layer includes a desktop launcher and a proxy Android application package (APK). The desktop launcher is primarily used to display and manage other applications (apps) on the electronic device. The proxy APK is primarily used to interact with the Linux system, display installed applications in the Linux system, and run applications in the Linux system.
[0049] It should be noted that the Android system of the electronic device may also include a hardware abstraction layer and a system runtime library not shown in Figure 2. The system runtime library may include: an Android runtime library, the Android runtime library may include a core library and a virtual machine, and the system runtime library may also include: a C library or a C++ library, which will not be repeated here.
[0050] The multiple applications of the Linux system may include: multiple X11 applications (X11APPs) and multiple Wayland applications (Wayland apps), wherein the X11 applications are applications that match the old version of the X11 protocol, and the Wayland applications are applications that match the new version of the Wayland protocol.
[0051] In addition, the Linux system's window service (weston) can include: a system interface manager (desktop-shell), a compatible application protocol (xwayland), a compositor (compositor), and a compositor backend (compositor backend). Among them, the system interface manager is used to manage the Linux system's global interface; the compatible application protocol is used to be compatible with various X11 applications on the basis of matching with various Wayland applications; the compositor is used to combine the various layers of the application to obtain the completed interface; and the backend compositor is used to process the completed interface.
[0052] In the embodiment of the present application, the application layer proxy APK can be opened in the Android system of the electronic device. The Android system can exchange data with the Linux system through the proxy APK, display the icons of the applications installed in the Linux system on the Android system desktop, and run the applications in the Linux system.
[0053] Further, referring to FIG2 , FIG2 also shows the software architecture of the proxy APK. As shown in FIG2 , the software architecture of the proxy APK may include: a communication layer (native), a management layer (myservice), and an activity layer (activity).
[0054] The native API acts as a communication channel between the proxy APK and the Linux system, transmitting information to the Linux system and receiving feedback from the Linux system. For example, the native API can send control commands to the Linux system to launch applications located on the Linux system, detect input events, and receive window display information (such as refreshing the displayed interface) or window management information (such as adjusting the display size or position) from the Linux system.
[0055] MyService is primarily used to manage app activities, for example, creating or destroying them, thereby managing the lifecycle of app activities. For example, MyService can also be used to establish a channel connection with a Linux container and initialize windows, sessions, and input for Linux applications running on Android.
[0056] An activity may include: a main activity and an application activity. The main activity is the main program of the proxy APK, which is mainly used to interact with the Linux system to obtain icon information, application identifiers, and executable paths of applications installed in the Linux system, and register this information with the desktop launcher. This allows icons of applications installed in the Linux system to be generated and displayed on the Android system desktop, and allows applications in the Linux system to be run on the Android system desktop by operating the application icons in the Linux system on the Android system desktop. For example, as shown in Figure 3 (A), multiple application icons are displayed on the Android desktop, such as the icon of Android App1, the icon of Android App2, and the icon of the proxy APK. Continuing with Figure 3 (A), after the user clicks the icon of the proxy APK on the Android desktop, the main activity in the proxy APK can interact with Linux and register information related to applications installed in the Linux system with the Android system, so that application icons in the Linux system can be displayed on the Android system, that is, the interface shown in Figure 3 (B) is displayed. In some embodiments, the icon information of the application may be the information of the application icon displayed on the desktop of the Linux system, the application identifier may be the name, identity (ID) or other information used to uniquely indicate the application, and the executable path of the application may be the storage location of the application in the Linux system.
[0057] The app activity can be an activity in the Android system that corresponds to an application running in the Linux system, or an activity that corresponds to a submenu in an application in the Linux system running in the Android system. For example, after the user operates the application icon in the Linux system on the Android system desktop, the Android system can create an app activity corresponding to the application selected by the user. In addition, when a window of an application running in the Linux system is displayed on the Android system desktop, when the user selects a submenu in the application under the window, the Android system can also create an activity corresponding to the submenu. For example, the activity corresponding to the application can be understood as the activity corresponding to the main interface of the application, and the submenu of the application can be understood as the sub-interface under the main interface of the application.
[0058] Among them, each app activity can collect triggered input events, send the collected input events to the Linux system through native, and receive information feedback from the Linux system based on the input events through native. Then, according to the information feedback from the Linux system, the current displayed interface of the app activity is refreshed (such as displaying a floating box, icon flashing and color changes, etc.), or the window displayed by the app activity is adjusted (such as adjusting the size or position of the window), etc.
[0059] Next, based on the content described above, a method for operating an application across systems provided by an embodiment of the present application is introduced.
[0060] For example, FIG4 shows a method for operating an application across different systems. In FIG4 , for ease of description, the electronic device is described as being equipped with both the Android system and the Linux system, with the Android system being the primary system of the electronic device. Of course, the electronic device may also be equipped with other systems, and the primary system of the electronic device may also be other systems, which are not limited here. As shown in FIG4 , the method for operating an application across different systems may include the following steps:
[0061] In S401 , after the electronic device detects a user-triggered start operation on a proxy APK installed in the Android system, the main activity (main activity 1 ) of the proxy APK may be started.
[0062] In S402, main activity 1 determines whether the Android system meets the operating environment of the Linux system. If the Android system meets the operating environment of the Linux system, S404 is executed; otherwise, S403 is executed.
[0063] When determining whether the Android system meets the Linux operating environment, main activity 1 can first determine whether the Android system has the installation directory for the container required to run the Linux system based on the installation directory in the Android system. If the Android system has the installation directory for the container required to run the Linux system, since the container generally has the Linux system pre-installed, it can be determined that the Android system meets the Linux operating environment. If the Android system does not have the installation directory for the container required to run the Linux system, it can then determine whether the Android system has an image package related to the Linux system. If the image package related to the Linux system exists, it can automatically install the image package to install the Linux system in the Android system. If the image package related to the Linux system does not exist, it indicates that the Android system does not meet the Linux operating environment, and the user can be prompted to install the Linux system. For example, as shown in Figure 5 (A), after the user clicks "Proxy APK", if main activity 1 determines that the Android system does not meet the Linux operating environment, a prompt box 51 can pop up on the Android system desktop, informing the user that they need to install the Linux system themselves, i.e., displaying the interface shown in Figure 5 (B).
[0064] In S403, the user is prompted to install the Linux system. After the user successfully installs the Linux system, the process can proceed to S404 automatically or manually.
[0065] In S404, main activity 1 interacts with the Linux system to obtain application information such as application icons, application identifiers, and application executable paths of applications installed in the Linux system.
[0066] When the Linux system is not running, main activity 1 can send a startup instruction to the Linux system to start the Linux system. After the Linux system is started, main activity 1 can send a first message to the Linux system, and the first message can be used to obtain application information such as application icons, application identifiers, and executable paths of applications installed in the Linux system. After the Linux system obtains the first message, it can send a second message to main activity 1, and the second message can include application information such as application icons, application identifiers, and executable paths of applications installed on the Linux system. Among them, main activity 1 can communicate with the Linux system through the native in the proxy APK, and the communication protocol between the two can be but is not limited to the free remote desktop protocol (FreeRDP).
[0067] In S405, main activity 1 registers the application information such as the application icon, application identifier and executable path of the application installed in the Linux system with the desktop launcher of the Android system to generate a desktop icon of the application in the Linux system on the desktop of the Android system.
[0068] In some embodiments, after the main activity 1 completes generating a desktop icon of the application in the Linux system on the desktop of the Android system, it may automatically end its operation.
[0069] At this point, the desktop icons of the Linux system applications can be displayed on the desktop of the Android system. For example, the screen displayed on the desktop of the Android system at this time may be as shown in (B) of FIG. 3 .
[0070] In some embodiments, the above steps S401 to S405 are not necessary steps of the method, that is, S401 to S405 do not need to be executed every time during the execution of the method.
[0071] After creating a desktop icon for a Linux application on the Android desktop, users can select the desktop icon for the Linux application on the Android desktop to launch the Linux application on the Android system. See the following description for details.
[0072] In S406 , the electronic device detects a user triggering event of the icon of the target application in the desktop icon of the Linux system generated in the Android desktop, and may create a main activity (main activity 2 ) in the proxy APK.
[0073] When the user needs to start the target application in the Linux system, the user can operate the desktop icon of the target application in the Linux system in the desktop of the Android system of the electronic device (such as clicking, etc.), and the electronic device can detect the trigger event through the desktop launcher in the Android system, and the activity management service AMS in the Android system creates a main activity 2 in the proxy APK.
[0074] In S407 , main activity 2 notifies the Linux system to start the target application in the Linux system, and notifies the proxy APK to create an app activity (app activity 1 ) associated with the target application.
[0075] Main activity 2 can send a third message to the Linux system. This third message can include information such as the application identifier of the target application and the executable path of the target application. After receiving the third message, the Linux system can obtain the target application and the corresponding startup path (i.e., executable path) that the user wants to start, and start the target application.
[0076] In addition, main activity 2 can also notify the proxy APK to create an app activity 1 associated with the target application. After main activity 2 completes the above work, it can automatically end its operation.
[0077] In addition, the proxy APK can also register the app activity 1 it creates with the myservice of the proxy APK so that myservice can manage the app activity 1.
[0078] In S408 , app activity 1 interacts with the Linux system to display the application interface of the target application in the Android system.
[0079] After the Linux system runs the target application, the target application can automatically draw the application interface of the target application based on the resources of the target application, and send the application interface of the target application to Weston of the Linux system. Weston can then forward the application interface of the target application to the app activity 1 related to the target application in the proxy APK in the Android system. After the app activity 1 obtains the application interface of the target application, it can display the application interface of the target application. In addition, when the application interface of the target application in the Linux system is refreshed, the Linux system can also send the refresh information to the app activity 1 related to the target application in the proxy APK, so that the app activity 1 related to the target application in the proxy APK refreshes the application interface of the target application displayed in the Android system, thereby keeping the application interface of the target application displayed on the desktop of the Android system synchronized with the application interface of the target application displayed on the desktop of the Linux system.
[0080] When the target application draws its interface, it can first request a window from Weston. Weston can then allocate a window to the target application based on the configured data. Afterwards, the target application can draw its interface in the allocated window based on its resources.
[0081] The window allocated by Weston may correspond to information such as window identification, window size, and window position. The window identification is used to uniquely indicate the window, the window size is used to indicate the size of the window, and the window position is used to indicate the position where the window is displayed.
[0082] In addition, when Weston forwards the application interface of the target application, it can also carry the window information of the window allocated by Weston to the target application. The window information may include the window identifier, window size, window position, etc.
[0083] It should be noted that, in actual applications, the interface drawn by the application may include one or more layers. When multiple layers are included, the layers can be combined using Weston's compositor based on information such as the stacking relationship and transparency between the layers to obtain a synthesized application interface. For simplicity, the present embodiment of the application uses the example of the target application interface including one layer. The present embodiment of the application does not limit the number of layers included in the target application interface.
[0084] After the target application's application interface is displayed in the Android system, the user can browse the content of the target application's application interface on the Android system's desktop and perform corresponding operations. It can be understood that when the target application's application interface is displayed on the Android system's desktop, the Linux system is also running and is running in the background of the Android system.
[0085] At this point, the target application in the Linux system is launched and displayed on the Android system desktop. Afterwards, the user can operate the target application in the application interface displayed on the Android system desktop. See the following description for details.
[0086] In S409, the app activity 1 corresponding to the target application detects a user's start event on a sub-interface in the target application's application interface, and the app activity 1 sends the start event to the Linux system. The app activity 1 corresponding to the target application can monitor the user's operation events on the target application's application interface in real time, such as window display, movement, maximization, minimization, full screen, dragging, closing, and other events. In one example, the sub-interface in the target application's application interface can be a new interface opened under the application interface. For example, as shown in FIG6 , the interface 61 shown in FIG6 (A) can be the application interface of the target application; in FIG6 (B), the user can click on the "File" control 62 in the application interface 61; after the user clicks on the "File" control 62, the interface 61 can be switched to the interface 63 shown in FIG6 (C), where the interface 63 can be referred to as a sub-interface of the interface 61.
[0087] At S410, the Linux system draws a sub-interface related to the launch event based on the acquired launch event, and sends the sub-interface to the proxy APK, which creates an app activity corresponding to the sub-interface. After the Linux system acquires the launch event, it can draw the sub-interface related to the launch event in the same manner as drawing the target application's application interface.
[0088] In S411, after the proxy APK obtains the sub-interface sent by the Linux system, it can create an app activity (app activity 2) corresponding to the sub-interface. The proxy APK can obtain the sub-interface sent by Linux through its internal myservice, and send the request to create app activity 2 to the activity management service AMS in the Android system through myservice. After the activity management service AMS learns of the request from myservice, it can create app activity 2 in the proxy APK. In this way, the sub-interface of the target application required by the user can be displayed on the Android system desktop, and the user can perform corresponding operations in the sub-interface.
[0089] It can be understood that by creating an app activity for different interfaces in a target application, the app activity corresponding to a certain interface can accurately identify the user's operations on that interface. This avoids the situation where a target application only corresponds to one app activity, which makes it difficult for the app activity to accurately identify user operations. This allows for immediate response to user operations and improves the user experience.
[0090] In some embodiments, when the app activity corresponding to a sub-interface in an application receives a user input to close the sub-interface, the app activity can feedback the close event to the Linux system. After receiving the close event, the Linux system can close the sub-interface corresponding to the app activity and feedback the information about its closed interface to the myservice in the proxy APK. After receiving the information feedback from the Linux system, the myservice in the proxy APK can end the lifecycle of the app activity. In this way, the sub-interface that the user wants to close can be closed on the Android system desktop. For example, referring to Figure 7, in Figure 7 (A), a sub-interface 71 of a certain application is currently displayed; in Figure 7 (B), after the user chooses to return to the main interface (i.e., clicks the return button 72), the currently displayed interface can be switched from sub-interface 71 to main interface 73. During the operation process shown in Figure 7, the lifecycle of the app activity corresponding to sub-interface 71 switches from the running phase to the destruction phase, and the lifecycle of the app activity ends in the destruction phase.
[0091] In addition, when the user closes an application, the app activity corresponding to the main interface of the application (that is, the app activity created when the user first opens the application) can collect the event and feedback the event to the Linux system. When the Linux system learns of the event, it can close the application corresponding to the app activity and feedback the closing event to the myservice in the proxy APK. After the myservice in the proxy APK obtains the information fed back by the Linux system, it can end the life cycle of each app activity related to the application. In this way, it is possible to close the application in the Linux system in the Android system on the desktop of the Android system. For example, referring to Figure 8, in Figure 8 (A), the main interface 81 of a certain application is displayed on the electronic device; in Figure 8 (B), the display interface of the application is switched from the main interface 81 to the sub-interface 82; in Figure 8 (C), the user chooses to close the application. After closing, the electronic device can display the interface shown in Figure 8 (D). Among them, in (A) of Figure 8, the proxy APK in the electronic device can create an app activity1 corresponding to the main interface 81; in (B) of Figure 8, the proxy APK in the electronic device can create an app activity2 corresponding to the sub-interface 82. At this time, there are two app activities related to the application in the proxy APK; in (D) of Figure 8, the proxy APK can end the life cycle of app activity1 corresponding to the main interface 81 and app activity2 corresponding to the sub-interface at the same time or in sequence, so that the application in the Linux system can be closed in the Android system on the desktop of the Android system.
[0092] Therefore, by utilizing the Android system's activity lifecycle management solution and embedding the Linux application opening process into the Android system, users can quickly launch Linux applications by clicking the Linux application's desktop icon displayed on the Android system desktop. This makes launching Linux applications the same as launching Android applications, allowing users to operate Linux applications on the Android system without any difference, thus improving the user experience. Furthermore, Linux applications are no longer managed in a single emulator window on the Android system desktop, allowing users to freely operate the application interface of Linux applications on the Android system desktop, such as dragging and dropping.
[0093] To facilitate understanding, the following example is used to illustrate.
[0094] For example, Figure 9 illustrates a process for running a Linux application on an Android system. As shown in Figure 9 , electronic device 90 is equipped with both the Android and Linux systems, with Android being the primary operating system. In Figure 9 (A), the electronic device displays the Android desktop, which has three applications installed: Android App 1, Android App 2, and a proxy APK.
[0095] In Figure 9 (A), the user can click the "Proxy APK" application icon. The Proxy APK in the Android system can then interact with the Linux system and generate a desktop icon for the installed Linux application on the Android system's desktop, displaying the interface shown in Figure 9 (B). In Figure 9 (B), the desktop icon for the installed Linux application generated on the Android system's desktop is Linux App 91. The user can then launch the Linux application on the Android desktop. In Figure 9 (C), the user can click the Linux application desktop icon Linux App 91 on the Android system's desktop. After the user clicks the desktop icon Linux App 91, the Android system can display the application interface corresponding to the desktop icon Linux App 91, as shown in Figure 9 (D). In Figure 9 (D), interface 92 can be the application interface of the application corresponding to the desktop icon Linux App 91. In Figure 9 (D), the user can operate interface 92 as needed. In Figure 9 (E), the user can choose to maximize interface 92. After the user makes a selection, the interface shown in (F) of FIG. 9 may be displayed on the electronic device 90 . At this time, the interface 92 fills the display screen of the electronic device 90 , that is, fills the desktop of the Android system on the electronic device 90 .
[0096] For example, Figure 10 shows a management process for the activity lifecycle in an Android system. When the user switches between interfaces, the activity will also switch between multiple states, such as visible or invisible state, foreground or background state. When the activity switches between different states, different lifecycle methods will be called back. Among them, the Activity class can provide many callbacks that let the activity know that a certain state has changed, such as: the system is creating, stopping or resuming an activity, or destroying the process where the activity is located, etc. In order to navigate the transition between the various stages of the activity lifecycle, the Activity class provides six core callbacks: onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy(). When the activity enters a new state, the system will call one or more of these callbacks.
[0097] For example, in the onCreate() phase, when you click on an activity (Activity Launched), the system calls onCreate() of activity 1. During this phase, you can initialize activity 1, such as loading the layout using setContentView and initializing some controls and variables. At this time, activity 1 is in the background and is not visible.
[0098] After the onCreate() phase completes, Activity 1's lifecycle enters the onStart() phase. Activity 1 is visible but not yet in the foreground, and the user cannot interact with it. During this phase, you can initialize animations in Activity 1.
[0099] After the onStart() phase is completed, the lifecycle of activity 1 enters the onResume() phase. During the onResume() phase, activity 1 is currently in the running state (activity is running), and activity 1 can interact with the user.
[0100] When another activity (such as activity 2) covers activity 1 to enter the foreground interface, the life cycle of activity 1 will enter the onPouse() phase. In this phase, activity 1 is visible but cannot interact with the user.
[0101] After the onPouse() phase is completed, the life cycle of activity 1 can enter the onStop() phase. At this time, activity 1 is invisible to the user and may be recycled by the system if the system memory is tight.
[0102] After the onStop() phase is completed, the life cycle of activity 1 enters the onDestory() phase, in which activity 1 can be destroyed. After the onDestory() phase is completed, activity 1 is shut down, and the life cycle of activity 1 ends.
[0103] In addition, after the onPouse() phase is completed, if the user brings activity 1 back to the foreground interface, activity 1 can cover activity 2. At this time, the life cycle of activity 1 can re-enter the onResume() phase.
[0104] After the onStop() phase is completed, when you switch back to activity 1 from activity 2, or when you return to activity 1 from the desktop, that is, when you return to activity 1, the life cycle of activity 1 can enter onRestart(). No operations can be performed in the onRestart() phase, and the life cycle of activity 1 can enter the onStart() phase through this phase.
[0105] In addition, when the system is low on memory and a higher-priority application needs memory, the process of the lower-priority activity 1 can be killed to reclaim memory. When the user switches back to activity 1, the lifecycle of activity 1 can re-enter the onCreate() phase.
[0106] 10 , the life cycle of the activity involved in the method for running an application across systems described in FIG. 4 will be described.
[0107] 1) The process of displaying the application icon of the Linux system application on the Android system desktop
[0108] As shown in Figure 10, after the user clicks the proxy APK icon, the main activity corresponding to the proxy APK is launched (i.e., step S401 in Figure 4). At this point, the main activity begins running and enters the "Created" state, i.e., the activity launched phase in Figure 10. At this point, creating activity 1 in Figure 10 can be understood as establishing the main activity.
[0109] Next, the onCreate() phase begins. Activity 1 checks whether the container environment the Linux application relies on is already installed. If not, it prompts the user to install it and completes the installation in the current thread. If the container environment the Linux application relies on is already installed, a separate background thread is started to pull up the basic Linux operating environment (i.e., steps S402 and S403 in Figure 4, and the step of starting the Linux system in S404).
[0110] Next, enter the onStart() phase. In the onStart() phase, activity 1 can use the applist function to monitor the / usr / share / applications / *.desktop and icon directories in the Linux system to obtain application information of applications that have been installed in the Linux system, such as: application name, executable file path, and application icon, etc. (i.e., the step described in S404 in Figure 4 to obtain application information such as application icon, application identifier, and executable path of the application installed in the Linux system). After activity 1 obtains the application information of the application in the Linux system, it can dynamically register this information with the Android system desktop. After that, the desktop icons of these obtained Linux applications are automatically generated on the Android system desktop (i.e., the step described in S405 in Figure 4). In addition, after the application in the Linux system is uninstalled, the background service in the Android system can still scan the aforementioned directories in the Linux system to realize the dynamic removal operation of the Linux application shortcut icon on the Android system desktop.
[0111] Next, the onResume() phase begins. During the onResume() phase, Activity 1 can start the myservices service by sending a message through the handler. This establishes a channel connection between myservice and the launched Linux container, allowing subsequent input, window, and session initialization to be performed through myservice.
[0112] Next, it passes through the activity is running phase, the onPause() phase, and the onStop() phase, before entering the onDestroy() phase. During the onDestroy() phase, activity 1 can automatically terminate its execution. This concludes the lifecycle of activity 1. For example, activity 1 need not perform any actions during the activity running phase, onPause() phase, and onStop() phase; it simply follows the flow.
[0113] 2) The process of launching Linux applications through desktop icons on Android systems
[0114] As shown in Figure 10, after the user clicks on the application icon of the Linux application (hereinafter referred to as the "target application") on the Android system desktop, a new main activity 2 can be created in the proxy APK (i.e., the step described in S406 in Figure 4). In the onCreate() stage, the main activity 2 can send information including the application identifier of the target application and the executable path of the target application to the Linux system through myservice to start the target application in the Linux system (i.e., some steps described in S407 in Figure 4). Among them, the main activity 2 can fork the application process of the target application, and then call back through the JNI interface to notify the proxy APK to pull up a new app activity and establish a mapping relationship with the target application on the Linux side clicked by the user (i.e., some steps described in S407 in Figure 4).
[0115] Afterward, Main Activity 2 may proceed through the onStart() phase, onResume() phase, the activity is running phase, onPause() phase, and onStop() phase, ultimately entering the onDestroy() phase. During the onDestroy() phase, Main Activity 2 may automatically terminate its execution. This concludes the lifecycle of Main Activity 2. For example, the Main Activity may simply follow the flow without performing any actions during the onStart() phase, onResume() phase, the activity is running phase, onPause() phase, and onStop() phase.
[0116] The life cycle of the app activity launched by the proxy APK can also be the life cycle of the activity shown in Figure 10. At each stage of the app activity life cycle, the app activity will monitor events such as window display, movement, maximization, minimization, full screen, dragging, and closing of the target application associated with it, and transmit these events to the Linux system through a protocol (such as FreeRDP). In addition, the Linux system can also transmit the results of the response event back to the app activity through the protocol, and then the app activity will perform corresponding processing, such as adjusting the window size, etc. When the app activity monitors the event of closing the target application, the app activity can enter the onDestory() stage and remove the window from the Android system desktop, thereby achieving the same closing experience as ordinary Android.
[0117] In addition, when the app activity detects that the user has opened a sub-interface in the main interface of the target application, the proxy APK can launch an app activity corresponding to the sub-interface, thereby monitoring the user's operations on the sub-interface through the app activity corresponding to the sub-interface (i.e., the steps described in S410 and S411 in Figure 4). The life cycle of the app activity corresponding to the sub-interface can also be the life cycle shown in Figure 10. In addition, when the proxy APK launches an app activity corresponding to the sub-interface, the app activity corresponding to the main interface of the target application (i.e., the app activity that the main activity notifies the proxy APK to launch) can enter the onPause() stage, or enter the onStop() stage.
[0118] It can be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0119] Corresponding to the method for running applications across systems described in the above embodiment, an embodiment of the present application also provides a device for running applications across systems. The device has the function of implementing the method for running applications across systems described above, which will not be repeated here.
[0120] It is understood that the electronic devices involved in the embodiments of the present application may be mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, vehicle-mounted devices, smart home devices, and / or smart city devices. Exemplary embodiments of electronic devices include, but are not limited to, electronic devices running iOS, Android, Windows, Harmony OS, or other operating systems, wherein the specific type of the electronic device is not particularly limited in the embodiments of the present application.
[0121] The following describes an electronic device according to an embodiment of the present application. Referring to FIG11 , FIG11 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The electronic device may be, but is not limited to, equipped with at least two software systems, such as an Android system and a Linux system.
[0122] As shown in FIG. 11 , the electronic device 1100 may include a processor 1110 , a memory 1120 , and a display screen 1130 .
[0123] The processor 1110 may be a general-purpose processor or a dedicated processor. For example, the processor 1110 may include a central processing unit (CPU) and / or a baseband processor. The baseband processor may be used to process communication data, and the CPU may be used to implement corresponding control and processing functions, execute software programs, and process data in the software programs.
[0124] Exemplarily, the processor 1110 may include one or more processing units. The processor 1110 may include one or more of an application processor (AP), a modem, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processors may be independent devices or integrated into one or more processors.
[0125] The memory 1120 may store a program that can be executed by the processor 1110, causing the processor 1110 to perform the methods described in the embodiments of the present application. The memory 1120 may also store data. The processor 1110 may read the data stored in the memory 1120. The memory 1120 and the processor 1110 may be provided separately. Alternatively, the memory 1120 may be integrated into the processor 1110.
[0126] The display screen 1130 is used to display images, videos, etc. The display screen 1130 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. Exemplarily, the display screen 1130 can be, but is not limited to, a foldable screen, that is, a display screen that can be folded. Exemplarily, the display screen 1130 can be used to display icons of Android applications and / or icons of Linux applications, etc.
[0127] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 1100. In other embodiments of the present application, the electronic device 1100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0128] Based on the methods described in the above embodiments, the present application also provides a chip. Please refer to Figure 12, which is a schematic diagram of the structure of a chip provided in the present application. As shown in Figure 12, the chip 1200 includes one or more processors 1201 and an interface circuit 1202. Optionally, the chip 1200 may also include a bus 1203.
[0129] The processor 1201 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of the hardware in the processor 1201 or an instruction in the form of software. The above-mentioned processor 1201 can be a general-purpose processor, a neural network processor (Neural Network Processing Unit, NPU), a digital communicator (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The various methods and steps disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0130] The interface circuit 1202 can be used to send or receive data, instructions or information. The processor 1201 can use the data, instructions or other information received by the interface circuit 1202 to process it, and can send the processing completion information through the interface circuit 1202.
[0131] Optionally, chip 1200 also includes a memory, which may include a read-only memory and a random access memory, and provides operating instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory (NVRAM). The memory may be coupled to processor 1201.
[0132] Optionally, the memory stores an executable software module or a data structure, and the processor 1201 can perform corresponding operations by calling an operation instruction stored in the memory (the operation instruction can be stored in the operating system).
[0133] Optionally, the interface circuit 1202 may be configured to output the execution result of the processor 1201 .
[0134] It should be noted that the corresponding functions of the processor 1201 and the interface circuit 1202 can be implemented through hardware design, software design, or a combination of hardware and software, and there is no limitation here.
[0135] It should be understood that each step of the above method embodiment can be completed by a hardware-based logic circuit or a software-based instruction in a processor.
[0136] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0137] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0138] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)).
[0139] It will be understood that the various numerical numbers involved in the embodiments of the present application are merely distinctions for the convenience of description and are not intended to limit the scope of the embodiments of the present application.
Claims
1. A method for running an application across systems, characterized in that: Applied to an electronic device, the electronic device is equipped with a first software system and a second software system, the second software system running based on the first software system; The method comprises: In response to the acquired first operation, acquiring, through the first software system, application information of at least one target application in the second software system, the target application being an application installed in the second software system, the application information including one or more of an icon, an identifier, and an executable path of the target application; Displaying a desktop icon of the target application in the first software system.
2. The method according to claim 1, characterized in that The first software system is an Android system, and the second software system is a Linux system.
3. The method according to claim 1 or 2, characterized in that The acquiring, through the first software system, application information of at least one target application in the second software system specifically includes: According to the first operation, starting a first main activity in the proxy Android application package APK in the first software system; Sending a first message to the second software system through the first main activity, where the first message is used to obtain application information of at least one target application in the second software system; A second message fed back by the second software system is obtained through the first main activity, where the second message includes application information of the at least one target application.
4. The method according to claim 3, characterized in that Displaying the desktop icon of the target application in the first software system specifically includes: The application information of the target application is registered in the desktop launcher of the first software system through the first main activity, so as to display the desktop icon of the target application in the first software system.
5. The method according to claim 3 or 4, characterized in that After displaying the desktop icon of the target application in the first software system, the method further includes: Control the first main activity to end running.
6. The method according to any one of claims 3 to 5, characterized in that: Before sending the first message to the second software system through the first main activity, the method further includes: Determining, through the first main activity, whether the first software system meets the operating environment of the second software system; If the conditions are met, sending a first message to the second software system through the first main activity; If not, the second software system is automatically installed, or a prompt message is displayed on the display interface of the first software system, the prompt message being used to prompt the installation of the second software system.
7. The method according to any one of claims 1 to 6, characterized in that: After displaying the desktop icon of the target application in the first software system, the method further includes: In response to the acquired second operation, starting a second main activity in the proxy Android application package APK in the first software system, where the second operation is an operation of starting the target application; Notifying the second software system through the second main activity to start the target application, and notifying the proxy APK to establish a first application activity app activity 1 associated with the target application; Obtaining, through the app activity 1, an application interface of the target application sent by the second software system; An application interface of the target application is displayed in the first software system.
8. The method according to claim 7, characterized in that After notifying the second software system through the second main activity to start the target application and notifying the proxy APK to establish a first application activity app activity 1 associated with the target application, the method further includes: Control the second main activity to end running.
9. The method according to claim 7 or 8, characterized in that After displaying the application interface of the target application in the first software system, the method further includes: Obtaining a third operation through the app activity 1, where the third operation is an operation of starting a sub-interface in the application interface; Notifying the second software system to start a sub-interface in the application interface through the app activity 1; Acquire a sub-interface in the application interface sent by the second software system through the proxy APK, and establish a second application activity app activity 2 associated with the sub-interface; The sub-interface in the application interface is displayed in the first software system.
10. The method according to claim 9, characterized in that After displaying the sub-interface in the application interface in the first software system, the method further includes: Control the app activity 1 to pause running.
11. The method according to claim 9 or 10, characterized in that After displaying the sub-interface in the application interface in the first software system, the method further includes: In response to the operation of closing the sub-interface obtained by the app activity 2, the app activity 2 is controlled to end its operation, and / or the app activity 1 is controlled to switch from a paused operation state to a resumed operation state.
12. The method according to any one of claims 7 to 11, characterized in that: After displaying the application interface of the target application in the first software system, the method further includes: In response to the operation of closing the application interface obtained by the app activity 1, controlling the app activity 1 to end running; Among them, when the proxy APK establishes app activity 2 associated with the sub-interface of the application interface, the app activity 2 associated with the sub-interface of the application interface is controlled to end running at the same time.
13. An electronic device, characterized in that: include: A processor, wherein the processor is configured to run a computer program stored in a memory, so that the electronic device implements the method according to any one of claims 1 to 12.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.
15. A computer program product, characterized in that When the computer program product runs on an electronic device, the electronic device is enabled to implement the method according to any one of claims 1 to 12.
16. A chip, characterized in that: comprising at least one processor and an interface; The at least one processor obtains program instructions or data through the interface; The at least one processor is configured to execute the program line instructions to implement the method according to any one of claims 1-12.
Citation Information
Cited By
Method, device and equipment for playing Linux audio in Android equipment and medium
CN119473211A
