CN114077367A - Method and device for realizing shortcut of android application in Linux system - Google Patents
Method and device for realizing shortcut of android application in Linux system Download PDFInfo
- Publication number
- CN114077367A CN114077367A CN202111435210.XA CN202111435210A CN114077367A CN 114077367 A CN114077367 A CN 114077367A CN 202111435210 A CN202111435210 A CN 202111435210A CN 114077367 A CN114077367 A CN 114077367A
- Authority
- CN
- China
- Prior art keywords
- android
- shortcut
- desktop
- android application
- application
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 64
- 230000001960 triggered effect Effects 0.000 claims abstract description 44
- 238000004891 communication Methods 0.000 claims description 17
- 238000007667 floating Methods 0.000 claims description 14
- 230000000694 effects Effects 0.000 claims description 8
- 238000009434 installation Methods 0.000 claims description 8
- 238000001514 detection method Methods 0.000 claims description 3
- 238000012544 monitoring process Methods 0.000 claims description 3
- 239000000126 substance Substances 0.000 claims description 2
- 230000003993 interaction Effects 0.000 abstract description 11
- 230000008569 process Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 13
- 238000004590 computer program Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 230000009977 dual effect Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000001902 propagating effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0481—Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
- G06F3/04817—Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance using icons
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0481—Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The disclosure provides a method, a device, electronic equipment and a storage medium for realizing shortcut of an android application in a Linux system, and relates to the technical field of computers. The method comprises the following steps: the method comprises the steps of detecting that an icon is designated to be operated and triggered on a Linux system desktop running with an android container, starting android system service in the android container, determining that the icon corresponds to the android application and has a shortcut of a sub-function, displaying the shortcut of the sub-function on the desktop, acquiring information of the sub-function corresponding to the triggered shortcut and sending the information to the android system service when the shortcut is triggered, and triggering the icon to execute the corresponding sub-function. According to the technical scheme, the shortcut display of the sub-functions of the android application in the Linux system is realized, the corresponding sub-functions of the android application are triggered and executed quickly through the shortcut, cross-system data interaction is avoided, the complexity of user operation is reduced, and the user experience is improved.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to the field of Linux and Android compatibility technologies.
Background
At present, when the Android application is started in the Linux system, the Android application is usually implemented by using an Inter-Process Communication (IPC) method. Firstly, a Linux system and an Android system are synchronously operated, then the Linux system acquires installed Android application information from a PKMS (Package management Service) in the Android system based on IPC (Internet protocol Security), then a corresponding Android application icon is displayed on a desktop of the Linux system, and when a user clicks the icon, the corresponding Android application is started through the IPC.
However, the Android system has a function of triggering and displaying a shortcut by pressing the Android application icon for a long time, and cannot be implemented in the Linux system at present. That is to say, after the dual systems are started, the Android application icons displayed on the desktop of the Linux system are interacted with data based on the IPC cross-system, even if the Android application icons are pressed for a long time, the display of shortcuts cannot be triggered, and even if the Android application icons are pressed for a long time, the function of quickly entering the corresponding sub-function operation interface through the shortcuts cannot be realized, so that the user experience is poor.
Disclosure of Invention
The present disclosure provides a method, an apparatus, an electronic device, a storage medium, and a computer program product for implementing a shortcut of an android application in a Linux system.
According to one aspect of the disclosure, a method for realizing shortcut of an android application in a Linux system is provided, which includes:
detecting that an icon on a desktop of a Linux system is triggered by specified operation, wherein an android container runs in the Linux system, android system service is started in the android container, and the specified operation is used for requesting to display a shortcut;
determining that the icon corresponds to an android application and the android application has a shortcut of a subfunction;
displaying shortcuts of sub-functions of the android application on the desktop;
when a shortcut is triggered, acquiring information of a subfunction corresponding to the triggered shortcut;
and sending the information to the android system service, and triggering the android system service to execute the corresponding sub-function according to the information.
According to another aspect of the present disclosure, an apparatus for implementing shortcut of an android application in a Linux system is provided, including:
the detection module is used for detecting that an icon on a desktop of a Linux system is triggered by a specified operation, an android container runs in the Linux system, android system services are started in the android container, and the specified operation is used for requesting to display a shortcut;
the determining module is used for determining that the icon corresponds to an android application and the android application has shortcuts of sub-functions;
the display module is used for displaying shortcuts of the sub-functions of the android application on the desktop;
the acquisition module is used for acquiring the information of the subfunction corresponding to the triggered shortcut when the shortcut is triggered;
and the sending module is used for sending the information to the android system service and triggering the android system service to execute the corresponding sub-function according to the information.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method in any embodiment of the disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform a method in any one of the embodiments of the present disclosure.
According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method in any of the embodiments of the present disclosure.
The technical scheme of the embodiment of the disclosure, through running android container and android system service in the Linux system, when detecting that an icon is designated to operate and trigger on a Linux system desktop, the icon is determined to correspond to the android application and display the shortcut after having the shortcut of the subfunction, and when the shortcut is triggered, the information of the corresponding subfunction is acquired and sent to the android system service, the corresponding subfunction is executed by triggering the shortcut, the display of the shortcut of the subfunction of the android application in the Linux system is realized, and the corresponding subfunction of the android application is executed quickly by triggering the shortcut, cross-system data interaction is avoided, the complexity of user operation is reduced, and the user experience is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram of a method for implementing android application shortcuts in a Linux system according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a method for implementing android application shortcuts in a Linux system according to another embodiment of the present disclosure;
FIG. 3a is a schematic diagram of a prior art dual system framework according to an embodiment of the present disclosure;
FIG. 3b is a schematic diagram of a Linux system framework including an android container, according to an embodiment of the present disclosure;
FIG. 4 is a schematic flow chart illustrating the generation of desktop files for an android application according to an embodiment of the present disclosure;
FIG. 5 is a flowchart illustrating the booting of a Linux system according to one embodiment of the present disclosure;
FIG. 6 is a schematic flow chart of starting the sub-function of the android application based on the shortcut in the Linux system according to an embodiment of the present disclosure;
FIG. 7 is a block diagram of an apparatus for implementing android application shortcuts in a Linux system according to an embodiment of the present disclosure;
FIG. 8 is a block diagram of an electronic device for implementing a method for implementing android application shortcuts in a Linux system of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The technical scheme of the embodiment of the disclosure is applied to a Linux system, an Android container runs in the Linux system, and Android system services are started in the Android container, and the method includes but is not limited to the following steps: PKMS or AMS (Activity Manager Service), etc. The embodiment of the disclosure mainly relates to Android application with subfunction shortcuts, wherein the shortcuts are a new characteristic of Android 7.1, a faster entry can be added for the key subfunction of the Android application without opening the Android application, and execution of the corresponding subfunction can be triggered through the entry. According to the technical scheme, the android system service started in the android container in the Linux system is used for displaying the shortcut of the sub-functions of the android application in the Linux system, and triggering the corresponding sub-functions of the android application to be executed quickly through the shortcut, so that cross-system data interaction is avoided, the complexity of user operation is reduced, and the user experience is improved.
Fig. 1 is a schematic diagram of a method for implementing shortcut of an android application in a Linux system according to an embodiment of the present disclosure. As shown in fig. 1, the method includes:
s101: detecting that an icon on a desktop of the Linux system is designated to be triggered by operation;
the android system service system comprises a Linux system, wherein an android container runs in the Linux system, android system services are started in the android container, and the specified operation is used for requesting to display a shortcut;
s102: determining that the icon corresponds to an android application and the android application has a shortcut of a subfunction;
s103: displaying shortcuts of the sub-functions of the android application on the desktop;
s104: when a shortcut is triggered, acquiring information of a subfunction corresponding to the triggered shortcut;
s105: and sending the information to the android system service, and triggering the android system service to execute the corresponding sub-function according to the information.
In the embodiment of the present disclosure, the android system Service refers to one Service of four major components of the android system. The Android component is an Android component which is specially used for processing long-time tasks in the background, does not provide interface presentation, and is a solution for realizing background running of programs in the Android. It is well suited to perform tasks that do not require interaction with the user and that also require long runs. The service is operated independently of any user interface, and can still keep normal operation even if the program is switched to the background or the user opens another application program.
In an embodiment, the determining that the icon corresponds to an android application and the android application has a shortcut of a sub-function may include:
acquiring a desktop file corresponding to the icon;
if the desktop file contains the android identifier, determining that the icon corresponds to the android application;
and if the desktop file contains the shortcut attribute, determining that the android application has the shortcut with the subfunction.
In one embodiment, the method may further include:
when an android application is installed in the android container, the android system service generates a desktop file for the android application, and an android identifier is added to the desktop file;
and if the android application has shortcuts of subfunctions, adding a shortcut attribute in the desktop file.
By the method, desktop files of the android application can be distinguished from desktop files of the Linux application, and the Linux system can conveniently identify whether the android application has shortcuts of sub-functions or not by adding the shortcuts, so that the system processing speed is increased.
In an embodiment, the generating, by the android system service, a desktop file for an android application, and adding an android identifier to the desktop file may include:
the android system service reads a list configuration file of the android application;
and generating a desktop file according to the installation information in the list configuration file and adding an android identifier.
In an embodiment, if the android application has a shortcut of a sub-function, adding a shortcut attribute to the desktop file may include:
and if the list configuration file contains the metadata field, determining that the android application has the shortcut with the subfunction, acquiring the subfunction information of the android application from the shortcut configuration file, and adding the shortcut attribute in the desktop file according to the subfunction information.
In the embodiment of the present disclosure, the manifest configuration file refers to an android manifest. The mode of generating the desktop file based on the list configuration file and the shortcut configuration file and adding the corresponding identification enables the generated desktop file to be convenient for rapidly identifying whether the desktop file corresponds to the android application and whether the desktop file has the shortcut of the sub-function.
In an embodiment, the obtaining information of the sub-function corresponding to the triggered shortcut when the shortcut is triggered may include:
and when a shortcut is triggered, reading an operation field in the desktop file corresponding to the icon to obtain the information of the subfunction corresponding to the triggered shortcut.
In an embodiment, the sending the information to the android system service, and triggering the android system service to execute the corresponding sub-function according to the information may include:
and sending the information to an activity management service AMS in the android system service through IPC, and triggering the AMS to execute corresponding sub-functions according to the information.
The method realizes shortcut of the android application in the Linux system based on the IPC mechanism, does not need cross-system interaction, reduces system consumption, improves system performance, realizes display of the shortcut of the sub-function of the android application in the Linux system, and triggers quick execution of the sub-function corresponding to the shortcut.
In an embodiment, the displaying a shortcut of a sub-function of an android application on a desktop may include:
and displaying a floating layer at the designated position of the desktop, and displaying shortcuts of sub-functions of the android application in the floating layer.
In one embodiment, the method may further include:
when an android application is installed in the android container, the android system service generates a desktop file for the android application and stores the desktop file in a specified directory;
and when the Linux system monitors that the newly added desktop file exists in the specified directory, displaying an application icon corresponding to the newly added desktop file on the desktop of the Linux system.
The mode of generating the desktop file of the android application and storing the desktop file in the local Linux system can ensure that the Linux system can directly read related desktop file information when the Linux system is started, so that the icon of the android application can be quickly displayed on the desktop of the Linux system when the Linux system is started, the PMS from a cross system to the android system is not required to read related installation information, the running time is shortened, and the starting speed of the Linux system and the speed of the Linux system for displaying the icon of the android application are improved.
The method provided by the embodiment of the disclosure is based on the android container and the android system service in the Linux system, so that the shortcut of the sub-function of the android application in the Linux system is displayed, the quick execution of the sub-function corresponding to the shortcut is triggered, the cross-system data interaction is avoided, the complexity of user operation is reduced, and the user experience is improved.
Fig. 2 is a schematic diagram of a method for implementing shortcut of an android application in a Linux system according to another embodiment of the present disclosure. As shown in fig. 2, the method includes:
s201: when an android application is installed in an android container in a Linux system, reading a list configuration file of the android application by using android system service, generating a desktop file according to installation information in the list configuration file, and adding an android identifier;
in the embodiment of the disclosure, the android system Service is already started in the android container, including but not limited to PKMS and AMS (Activity Manager Service). The PKMS is one of core services in the Android system, and manages all Package-related tasks, such as application installation, application uninstallation, or application information query. AMS is also an important service in android, and manages the four major components of the android in a unified way and schedules each application process in a unified way. The android system service in step S201 may specifically refer to PKMS.
In the embodiment of the present disclosure, a Desktop file (Desktop Entry) refers to a Desktop file, which is a file for describing program startup configuration information in a Linux Desktop system, and the Desktop file is named after the Desktop file is a suffix and is equivalent to a Desktop shortcut in a Windows system.
In one embodiment, the manifest configuration file may be an android manifest file of the android application, which includes information related to installation and uninstallation of the android application. The android identification can be set as required, for example, the android character string is not limited in specific content and length, and the desktop file only needs to be distinguished from corresponding android application or Linux application. Moreover, the android identifier added to the desktop file can be a mode of adding the android identifier to a specified keyword, and the specified keyword can be set as required, for example, a category attribute is set as the specified keyword, and the like, and the method is not limited specifically.
S202: if the list configuration file contains the metadata field, determining that the android application has the shortcut with the subfunction, acquiring the subfunction information of the android application from the shortcut configuration file, and adding the shortcut attribute in the desktop file according to the acquired subfunction information;
the metadata field refers to a meta-data field in an android manifest. When the meta-data field is not contained in the android Manifest.xml file, the shortcut mode of the sub-function of the android application is indicated.
S203: detecting that an icon on a desktop of the Linux system is designated to be triggered by operation;
the specific operation is used for requesting to display a shortcut, and may be configured specifically as needed, including but not limited to long-press operation, that is, long-press operation of a certain icon requests to display a sub-function shortcut of an application corresponding to the icon, which is not limited in this embodiment.
S204: acquiring a desktop file corresponding to the icon, determining an android application corresponding to the icon if the desktop file contains an android identifier, and determining a shortcut mode that the android application has a subfunction if the desktop file contains a shortcut mode attribute;
s205: when determining that the icon corresponds to the android application and has shortcuts of sub-functions, displaying the shortcuts of the sub-functions of the android application on a desktop of a Linux system;
exemplarily, the displaying of the shortcut in step S205 may be performed as follows:
and displaying a floating layer at the appointed position of the desktop of the Linux system, and displaying shortcuts of the sub-functions of the android application in the floating layer.
Illustratively, a floating layer may be displayed around the triggered icon, such as a floating layer displayed in the upper right corner of the icon, and the like, without limitation.
S206: when a shortcut is triggered, reading an operation field in the desktop file corresponding to the icon to obtain information of a subfunction corresponding to the triggered shortcut;
in the embodiment of the present disclosure, the operation field is an action field, which describes operation information corresponding to the sub-function intent, and according to the operation information, the user can jump to the operation interface corresponding to the sub-function.
For example, an icon of an android application 'WeChat' is displayed on a desktop of the Linux system, the application has three sub-functions of 'My two-dimensional code', 'Payment receipt' and 'Scan', when the icon is pressed for a long time, shortcuts of the three sub-functions are displayed around the icon, if one shortcut is clicked, the shortcut is directly jumped to an operation interface corresponding to the shortcut and displayed for a user, and quick jump execution of the android application sub-function of the Linux system is achieved.
S207: and sending the information to an AMS in the android system service through IPC, and triggering the AMS to execute corresponding sub-functions according to the information.
In the disclosed embodiment, IPC refers to propagating or exchanging information between different processes. There is a corresponding IPC mechanism under either operating system. The process address spaces under the IPC mechanism are mutually independent, each process has different user address spaces, the processes cannot access each other, and data exchange can be carried out only through a kernel. The interprocess communication usually adopts the following communication modes: half-duplex Unix pipes, FIFOs named pipes, Message queues (Message Queue), semaphores (semaphores), shared memory, sockets (Socket), and so forth. Since the file manager and the PKMS are two different processes, the data transfer between the processes needs to be realized by IPC inter-process communication.
In one embodiment, the method may further include:
when an android application is installed in an android container, generating a desktop file for the android application by the android system service and storing the desktop file in a specified directory;
and when the Linux system monitors that the newly added desktop file exists in the specified directory, displaying an application icon corresponding to the newly added desktop file on the desktop of the Linux system.
The generating of the desktop file may be performed by the PKMS, and the specified directory for storing the desktop file may be set according to needs, such as a specified/usr/share/applications directory, and the like, which is not limited specifically.
Fig. 3a is a schematic diagram of a prior art dual system framework according to an embodiment of the present disclosure. As shown in fig. 3a, in the prior art, a Linux system and an Android system operate simultaneously in one device, the Linux system and the Android system perform dual-system communication, cross-system data interaction is required to achieve communication, complexity is high, system operation performance is reduced, starting speed of an Android application is slow, and display of a sub-function shortcut of an Android application icon on a desktop of the Linux system cannot be achieved.
Fig. 3b is a schematic diagram of a Linux system framework including an android container according to an embodiment of the present disclosure. As shown in fig. 3b, in an implementation manner, Android can be started in a container manner in a Linux system, and the method has the advantages that Linux and Android dual systems do not need to be synchronously operated, but corresponding functions are realized through Android system services started in an Android container, complexity of the system is reduced, operation is more convenient and faster, further starting efficiency of Android applications is improved, shortcut of Android application sub-functions in the Linux system is displayed, corresponding sub-functions of the Android applications are triggered to be quickly executed through the shortcut, and user experience is improved.
Fig. 4 is a schematic flow chart of generating an android application desktop file according to an embodiment of the present disclosure. As shown in fig. 4, the process includes:
s401: starting and installing an android application by an android container in the Linux system;
s402: analyzing an android manifest.
This step may be performed, illustratively, by a PKMS within the android container.
Xml file is information description file of application program in android system, and defines Activity, Service, Content provider and Broadcast Receiver component information contained in the application program. Xml files must be contained under the root directory for each application, and the file name cannot be modified.
S403: reading a file package name, an application name, an icon position, metadata and activity (MainActivity) information;
the file package name refers to the name of the file package of the android application, and the application name refers to the name of the android application. The Android application Package is an APK (Android application Package), which is an application Package file format used by an Android operating system and used for distributing and installing mobile applications and middleware. The metadata is configured with related information of the sub-function shortcut of the android application, such as information of shortcuts.
S404: if the desktop file contains the metadata, reading a corresponding shortcut file based on the metadata to obtain shortcut information of the sub-functions of the android application;
and the desktop file contains metadata which indicates that the android application has shortcuts of sub-functions. Xml files contain a short field describing shortcut related information of sub-functions of the android application, including but not limited to: icons, text, prompts, operations, etc. of the shortcuts. The text refers to the sub-function name corresponding to the shortcut, i.e., the intent name, and the operation refers to the action information corresponding to the intent, which is not described herein again.
S405: generating a corresponding desktop file according to the read information, adding an android character string and a shortcut attribute in the Categories attribute of the desktop file, and respectively identifying the application corresponding to the desktop file as an android application and a shortcut with a sub-function;
the android string may also be added to other keywords in the desktop file, which is not limited in this embodiment.
S406: storing the desktop file into a specified directory;
illustratively, the desktop file may be saved to/usr/share/applications, and this embodiment is not limited specifically.
S407: saving the android application icon corresponding to the desktop file to a specified directory;
illustratively, the android application icon may be saved to/usr/share/icons/hicolors/color/scalable, and the embodiment is not limited in particular.
Correspondingly, when an android application is uninstalled, the corresponding desktop file under/usr/share/applications and the corresponding application icon under/usr/share/icons/hicolors/scalable can be deleted.
S408: and displaying the android application icon on a desktop of the Linux system.
FIG. 5 is a flowchart illustrating the booting process of a Linux system according to an embodiment of the present disclosure. As shown in fig. 5, the process includes:
s501: starting and operating an android container by the Linux system;
s502: starting Linux service and starting android service in an android container;
the started android service at least comprises PKMS and AMS.
S503: traversing all desktop files under the specified directory;
for example, the specified directory may be/usr/share/applications, and this embodiment is not limited specifically.
S504: analyzing each desktop file, reading a corresponding application icon and displaying the application icon on a desktop of Linux;
s505: monitoring desktop files under the appointed directory;
s506: judging whether a new desktop file is added or not, if so, executing S504; otherwise, S505 is executed.
FIG. 6 is a schematic flow chart of starting the sub-function of the android application based on the shortcut in the Linux system according to an embodiment of the present disclosure. As shown in fig. 6, the process includes:
s601: detecting that an icon on a desktop of the Linux system is pressed for a long time;
an android container runs in the Linux system, and android system services such as AMS (automatic dispatch system) and the like are started in the android container.
S602: judging whether the application corresponding to the icon is an android application, if so, executing S603; otherwise, go to S608;
the above judgment can be realized by analyzing the desktop file corresponding to the icon and judging whether the desktop file contains an android identifier.
S603: judging whether the android application has a shortcut of a subfunction, if so, executing S604; otherwise, go to S608;
s604: displaying a floating layer on friday of the icon, and displaying shortcuts of sub-functions of the android application in the floating layer;
s605: detecting that a shortcut is clicked, and acquiring information of a sub-function corresponding to the clicked shortcut;
s606: sending the information of the subfunction to AMS of the android container through IPC;
s607: the AMS triggers and executes corresponding subfunctions according to the received information, and the process is ended;
s608: and determining that the application corresponding to the desktop file is a Linux application, running the Linux application, and ending the process.
The method provided by the embodiment of the disclosure is based on the android container and the android system service in the Linux system, so that the shortcut of the sub-function of the android application in the Linux system is displayed, the quick execution of the sub-function corresponding to the shortcut is triggered, the cross-system data interaction is avoided, the complexity of user operation is reduced, the system performance is improved, and the user experience is improved.
FIG. 7 is a block diagram of an apparatus for implementing android application shortcuts in a Linux system according to an embodiment of the present disclosure. As shown in fig. 7, the apparatus includes:
the detection module 701 is used for detecting that an icon on a desktop of the Linux system is triggered by a designated operation, an android container runs in the Linux system, android system services are started in the android container, and the designated operation is used for requesting to display a shortcut;
a determining module 702, configured to determine that the icon corresponds to an android application and the android application has a shortcut of a sub-function;
the display module 703 is configured to display a shortcut of a sub-function of the android application on the desktop;
an obtaining module 704, configured to obtain information of a sub-function corresponding to a triggered shortcut when the shortcut is triggered;
the sending module 705 is configured to send the information to the android system service, and trigger the android system service to execute a corresponding sub-function according to the information.
In one embodiment, the determining module 702 includes:
the acquisition unit is used for acquiring the desktop file corresponding to the icon;
the first determining unit is used for determining that the icon corresponds to the android application if the desktop file contains the android identifier;
and the second determining unit is used for determining that the android application has the shortcut of the subfunction if the desktop file contains the shortcut attribute.
In one embodiment, the above apparatus further comprises:
the generation module is used for generating a desktop file for the android application by the android system service when the android application is installed in the android container, and adding an android identifier in the desktop file;
and the adding module is used for adding the shortcut attribute in the desktop file if the android application has the shortcut of the subfunction.
In one embodiment, the generation module is configured to:
reading a list configuration file of the android application by the android system service;
and generating a desktop file according to the installation information in the list configuration file and adding an android identifier.
In one embodiment, the adding module is configured to:
and if the list configuration file contains the metadata field, determining that the android application has the shortcut with the subfunction, acquiring the subfunction information of the android application from the shortcut configuration file, and adding the shortcut attribute in the desktop file according to the subfunction information.
In one embodiment, the obtaining module 704 is configured to:
and when a shortcut is triggered, reading an operation field in the desktop file corresponding to the icon to obtain the information of the subfunction corresponding to the triggered shortcut.
In one embodiment, the sending module 705 is configured to:
and sending the information to an Activity Management Service (AMS) in the android system service through interprocess communication, and triggering the AMS to execute corresponding sub-functions according to the information.
In one embodiment, the display module 703 is configured to:
and displaying a floating layer at the designated position of the desktop, and displaying shortcuts of sub-functions of the android application in the floating layer.
In one embodiment, the above apparatus further comprises:
the generation module is used for generating a desktop file for the android application by the android system service and storing the desktop file to a specified directory when the android application is installed in the android container;
and the monitoring module is used for displaying the application icon corresponding to the newly added desktop file on the desktop of the Linux system when the Linux system monitors that the newly added desktop file exists in the specified directory.
The device provided by the embodiment of the disclosure realizes the display of the shortcut of the sub-function of the android application in the Linux system and the quick execution of the sub-function corresponding to the trigger shortcut based on the android container and the android system service in the Linux system, avoids cross-system data interaction, reduces the complexity of user operation, and improves the user experience.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 8 illustrates a schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 8, the apparatus 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data required for the operation of the device 800 can also be stored. The calculation unit 801, the ROM 802, and the RAM803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the device 800 are connected to the I/O interface 805, including: an input unit 806, such as a keyboard, a mouse, or the like; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, or the like; and a communication unit 809 such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.
Claims (20)
1. A method for realizing shortcut of android application in a Linux system comprises the following steps:
detecting that an icon on a desktop of a Linux system is triggered by specified operation, wherein an android container runs in the Linux system, android system service is started in the android container, and the specified operation is used for requesting to display a shortcut;
determining that the icon corresponds to an android application and the android application has a shortcut of a subfunction;
displaying shortcuts of sub-functions of the android application on the desktop;
when a shortcut is triggered, acquiring information of a subfunction corresponding to the triggered shortcut;
and sending the information to the android system service, and triggering the android system service to execute the corresponding sub-function according to the information.
2. The method of claim 1, wherein the determining that the icon corresponds to an android application and that the android application has a shortcut of sub-functions comprises:
acquiring a desktop file corresponding to the icon;
if the desktop file contains an android identifier, determining that the icon corresponds to an android application;
and if the desktop file contains the shortcut attribute, determining that the android application has the shortcut with the subfunction.
3. The method of claim 2, further comprising:
when an android application is installed in the android container, the android system service generates a desktop file for the android application, and an android identifier is added to the desktop file;
and if the android application has shortcuts of subfunctions, adding a shortcut attribute in the desktop file.
4. The method of claim 3, wherein the android system service generates a desktop file for the android application, and adding an android identifier to the desktop file comprises:
the android system service reads a manifest configuration file of the android application;
and generating a desktop file according to the installation information in the list configuration file and adding an android identifier.
5. The method of claim 4, wherein adding a shortcut attribute in the desktop file if the android application has a shortcut of a subfunction comprises:
and if the list configuration file contains the metadata field, determining that the android application has the shortcut with the subfunction, acquiring the subfunction information of the android application from the shortcut configuration file, and adding the shortcut attribute in the desktop file according to the subfunction information.
6. The method according to claim 1, wherein the obtaining information of the sub-function corresponding to the triggered shortcut when the shortcut is triggered comprises:
and when a shortcut is triggered, reading an operation field in the desktop file corresponding to the icon to obtain information of the subfunction corresponding to the triggered shortcut.
7. The method of claim 1, wherein the sending the information to the android system service, triggering the android system service to execute the corresponding sub-function according to the information, comprises:
and sending the information to an Activity Management Service (AMS) in the android system service through interprocess communication, and triggering the AMS to execute the corresponding sub-function according to the information.
8. The method of claim 1, wherein the displaying the shortcut of sub-functions of the android application on the desktop comprises:
and displaying a floating layer at the appointed position of the desktop, and displaying the shortcut of the sub-functions of the android application in the floating layer.
9. The method according to any one of claims 1-8, further comprising:
when an android application is installed in the android container, the android system service generates a desktop file for the android application and stores the desktop file in a specified directory;
and when the Linux system monitors that a newly added desktop file exists in the specified directory, displaying an application icon corresponding to the newly added desktop file on a desktop of the Linux system.
10. An apparatus for implementing android application shortcut in Linux system, comprising:
the detection module is used for detecting that an icon on a desktop of a Linux system is triggered by a specified operation, an android container runs in the Linux system, android system services are started in the android container, and the specified operation is used for requesting to display a shortcut;
the determining module is used for determining that the icon corresponds to an android application and the android application has shortcuts of sub-functions;
the display module is used for displaying shortcuts of the sub-functions of the android application on the desktop;
the acquisition module is used for acquiring the information of the subfunction corresponding to the triggered shortcut when the shortcut is triggered;
and the sending module is used for sending the information to the android system service and triggering the android system service to execute the corresponding sub-function according to the information.
11. The apparatus of claim 10, wherein the means for determining comprises:
the acquisition unit is used for acquiring the desktop file corresponding to the icon;
the first determining unit is used for determining the android application corresponding to the icon if the desktop file contains the android identifier;
and the second determining unit is used for determining that the android application has the shortcut of the subfunction if the desktop file contains the shortcut attribute.
12. The apparatus of claim 11, further comprising:
the generating module is used for generating a desktop file for the android application by the android system service when the android application is installed in the android container, and adding an android identifier in the desktop file;
and the adding module is used for adding the shortcut attribute in the desktop file if the android application has the shortcut of the subfunction.
13. The apparatus of claim 12, wherein the generating means is configured to:
reading, by the android system service, a manifest configuration file of the android application;
and generating a desktop file according to the installation information in the list configuration file and adding an android identifier.
14. The apparatus of claim 13, wherein the adding module is to:
and if the list configuration file contains the metadata field, determining that the android application has the shortcut with the subfunction, acquiring the subfunction information of the android application from the shortcut configuration file, and adding the shortcut attribute in the desktop file according to the subfunction information.
15. The apparatus of claim 10, wherein the means for obtaining is configured to:
and when a shortcut is triggered, reading an operation field in the desktop file corresponding to the icon to obtain information of the subfunction corresponding to the triggered shortcut.
16. The apparatus of claim 10, wherein the means for transmitting is configured to:
and sending the information to an Activity Management Service (AMS) in the android system service through interprocess communication, and triggering the AMS to execute the corresponding sub-function according to the information.
17. The apparatus of claim 10, wherein the display module is to:
and displaying a floating layer at the appointed position of the desktop, and displaying the shortcut of the sub-functions of the android application in the floating layer.
18. The apparatus of any of claims 10-17, further comprising:
the generating module is used for generating a desktop file for the android application by the android system service and storing the desktop file to a specified directory when the android application is installed in the android container;
and the monitoring module is used for displaying the application icon corresponding to the newly added desktop file on the desktop of the Linux system when the Linux system monitors that the newly added desktop file is in the specified directory.
19. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
20. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111435210.XA CN114077367A (en) | 2021-11-29 | 2021-11-29 | Method and device for realizing shortcut of android application in Linux system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111435210.XA CN114077367A (en) | 2021-11-29 | 2021-11-29 | Method and device for realizing shortcut of android application in Linux system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114077367A true CN114077367A (en) | 2022-02-22 |
Family
ID=80284415
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111435210.XA Pending CN114077367A (en) | 2021-11-29 | 2021-11-29 | Method and device for realizing shortcut of android application in Linux system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114077367A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114721783A (en) * | 2022-05-16 | 2022-07-08 | 龙芯中科技术股份有限公司 | Resource file extraction method and device, electronic equipment and storage medium |
CN115454296A (en) * | 2022-11-11 | 2022-12-09 | 北京麟卓信息科技有限公司 | Intelligent fusion method for user behaviors in cross-operating environment |
WO2023109138A1 (en) * | 2021-12-14 | 2023-06-22 | 抖音视界有限公司 | Method and apparatus for starting android application in linux system, and electronic device |
WO2024087958A1 (en) * | 2022-10-25 | 2024-05-02 | 华为技术有限公司 | Method for opening functional interface of application, apparatus, and terminal device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102999334A (en) * | 2012-11-15 | 2013-03-27 | 广东欧珀移动通信有限公司 | Android platform-based shortcut implementation method, device and terminal |
WO2016095383A1 (en) * | 2014-12-19 | 2016-06-23 | 中兴通讯股份有限公司 | Method for implementing application call and virtual machine |
US20200278949A1 (en) * | 2018-02-05 | 2020-09-03 | Tencent Technnology (Shenzhen) Company Limited | Method and apparatus for viewing previously used file, and terminal |
WO2021196970A1 (en) * | 2020-03-31 | 2021-10-07 | 华为技术有限公司 | Method for creating application shortcuts, electronic device, and system |
-
2021
- 2021-11-29 CN CN202111435210.XA patent/CN114077367A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102999334A (en) * | 2012-11-15 | 2013-03-27 | 广东欧珀移动通信有限公司 | Android platform-based shortcut implementation method, device and terminal |
WO2016095383A1 (en) * | 2014-12-19 | 2016-06-23 | 中兴通讯股份有限公司 | Method for implementing application call and virtual machine |
US20200278949A1 (en) * | 2018-02-05 | 2020-09-03 | Tencent Technnology (Shenzhen) Company Limited | Method and apparatus for viewing previously used file, and terminal |
WO2021196970A1 (en) * | 2020-03-31 | 2021-10-07 | 华为技术有限公司 | Method for creating application shortcuts, electronic device, and system |
CN113542503A (en) * | 2020-03-31 | 2021-10-22 | 华为技术有限公司 | Method, electronic device and system for creating application shortcut |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023109138A1 (en) * | 2021-12-14 | 2023-06-22 | 抖音视界有限公司 | Method and apparatus for starting android application in linux system, and electronic device |
CN114721783A (en) * | 2022-05-16 | 2022-07-08 | 龙芯中科技术股份有限公司 | Resource file extraction method and device, electronic equipment and storage medium |
CN114721783B (en) * | 2022-05-16 | 2022-08-26 | 龙芯中科技术股份有限公司 | Resource file extraction method and device, electronic equipment and storage medium |
WO2024087958A1 (en) * | 2022-10-25 | 2024-05-02 | 华为技术有限公司 | Method for opening functional interface of application, apparatus, and terminal device |
CN115454296A (en) * | 2022-11-11 | 2022-12-09 | 北京麟卓信息科技有限公司 | Intelligent fusion method for user behaviors in cross-operating environment |
CN115454296B (en) * | 2022-11-11 | 2023-01-10 | 北京麟卓信息科技有限公司 | Intelligent fusion method for user behaviors in cross-operation environment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023109138A1 (en) | Method and apparatus for starting android application in linux system, and electronic device | |
JP5936157B2 (en) | Systems, methods, and computer programs for hidden automated data mirroring for native interfaces in distributed virtual machines (hidden automated data mirroring for native interfaces in distributed virtual machines ) | |
CN114077367A (en) | Method and device for realizing shortcut of android application in Linux system | |
US20190155667A1 (en) | Managing delivery of code and dependent data using application containers | |
US8676848B2 (en) | Configuring cloud resources | |
US9590859B2 (en) | Discovering resources of a distributed computing environment | |
CN111694857B (en) | Method, device, electronic equipment and computer readable medium for storing resource data | |
WO2023082716A1 (en) | Method and apparatus for operating android application in linux system, and device | |
CN113900834B (en) | Data processing method, device, equipment and storage medium based on Internet of things technology | |
US11165661B2 (en) | Dynamically grouping monitored resources in a cloud environment to collections representing a composite application | |
US20170109415A1 (en) | Platform and software framework for data intensive applications in the cloud | |
CN111679911B (en) | Management method, device, equipment and medium of GPU card in cloud environment | |
CN114253734A (en) | Resource calling method and device, electronic equipment and computer readable storage medium | |
CN113010342A (en) | Operation and maintenance diagnosis method, device, equipment and storage medium | |
CN114936173A (en) | Read-write method, device, equipment and storage medium of eMMC device | |
US20130139185A1 (en) | Intercepting and tracing interface routine transactions | |
CN110807535A (en) | Construction method and construction device of unified reservation platform and unified reservation platform system | |
CN113672671B (en) | Method and device for realizing data processing | |
CN114237765A (en) | Functional component processing method and device, electronic equipment and medium | |
CN115373869A (en) | Process processing method and device based on AAR and electronic equipment | |
CN113625998A (en) | Request processing method and device | |
CN111767489A (en) | Method, device and equipment for accelerating running of webpage and storage medium | |
CN111325456B (en) | Asset data processing method and apparatus, computer system, and storage medium | |
CN117971777A (en) | File system service distribution method and device | |
CN117675897A (en) | Application interaction method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20220330 Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing. Applicant after: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd. Address before: 2005, floor 2, No. 39, West Street, Haidian District, Beijing 100080 Applicant before: Beijing jingling Information System Technology Co.,Ltd. |