Application program installation method, electronic equipment, storage medium and program product
By installing only application component files that match the device parameters on the terminal device, the problem of memory waste caused by redundant resources and library files in the application installation package is solved, and efficient memory utilization is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-03-10
AI Technical Summary
Installing applications on terminal devices with different resolutions and processor architectures leads to wasted memory space because the application installation package contains multiple sets of redundant resources and library files, failing to effectively utilize the terminal's memory space.
During the application installation process, the installation package is parsed to obtain the target application component files that match the terminal device parameters, and only these files are copied to the terminal memory, while deleting or removing redundant files that do not match.
By streamlining the application installation process, the terminal memory usage is reduced, and the effective utilization of memory is improved.
Smart Images

Figure CN121635908A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of terminal application, and in particular, relate to an application installation method, an electronic device, a storage medium and a program product. BACKGROUND
[0002] At present, various electronic devices (for example, mobile phones, tablets, computers, car machines, smart watches, etc.) can install application programs (application, APP). Developers need to develop various APPs for these electronic devices. With the development of the market of mobile terminals and the like, various brands of terminal products have appeared on the market at present, and the resolutions are different by thousands. This poses a huge challenge to the development of application programs (App). The same APP needs to ensure that the user interface (User interface, UI) interface can have a better performance on mobile terminals with different resolutions. The resource files in the APP installation package are more and more, thereby causing the APP to occupy more and more memory space after installation.
[0003] Taking the installation of an APP on an Android electronic device as an example, all virtual machine executable binary (Dalvik VM executes, Dex) files, resources (Resource), assets (Assets, a directory for storing resource files), and native libraries (Native libraries) in an Android installation package (Android Package, Apk) are installed into the device.
[0004] However, some of the resources are multiple sets of resources packaged for adapting to different resolution models, and multiple sets of dynamic link libraries (which can be referred to as native library files) with the suffix.so are stored for adapting to different Advanced RISC Machine (ARM) architectures, such as (arm64-v8a, armeabi, armeabi-v7a, x86, x86_64). However, only one set matches the current terminal, and the others belong to redundant content, thereby causing a waste of the memory space of the device. SUMMARY
[0005] Embodiments of the present application provide an application installation method, an electronic device, a storage medium and a program product to save the memory space occupied by an application program.
[0006] To solve the above technical problems, the present application is implemented as follows:
[0007] In a first aspect, a method for installing an application program is provided, which is applied to a terminal and includes: receiving a control instruction for installing an application program; in response to the control instruction, parsing an installation package of the application program, obtaining a plurality of application component files of the application program; obtaining a target application component file from the plurality of application component files; wherein the target application component file is at least part of the application component files in the plurality of application component files that match a device parameter of the terminal; copying the target application component file into a memory of the terminal for storage, and completing installation of the application program.
[0008] In a second aspect, an electronic device is provided, which includes a processor and a memory, the memory storing a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method for installing an application program according to the first aspect.
[0009] In a third aspect, a readable storage medium is provided, which stores a program or instructions, and the program or instructions, when executed by a processor, implement the steps of the method for installing an application program according to the first aspect.
[0010] In a fourth aspect, a computer program product is provided, which includes a computer program stored on a non-transitory computer readable storage medium, and the computer program includes program instructions that, when executed by a computer, cause the computer to perform the steps of the method for installing an application program according to the first aspect.
[0011] In the embodiments of the present application, a control instruction for installing an application program is received; in response to the control instruction, an installation package of the application program is parsed, and a plurality of application component files of the application program are obtained; a target application component file is obtained from the plurality of application component files; wherein the target application component file is at least part of the application component files in the plurality of application component files that match a device parameter of the terminal; the target application component file is copied into a memory of the terminal for storage, and installation of the application program is completed, so that only the application component files that match the device parameter of the terminal are stored in the memory of the terminal, and waste of memory space of the terminal is avoided.
[0012] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not limiting to the present application. BRIEF DESCRIPTION OF DRAWINGS
[0013] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0014] Figure 1A flowchart of an installation method of an application program is shown in an example embodiment of the present application.
[0015] Figure 2 A flowchart of an application program installation in the related art is shown.
[0016] Figure 3 A flowchart of an application program installation in an embodiment of the present application is shown.
[0017] Figure 4 A diagram of a list of duplicate resources obtained in an example embodiment of the present application is shown.
[0018] Figure 5 A diagram of determining an optimal matching resource in an example embodiment of the present application is shown.
[0019] Figure 6 A diagram of a deduplicated resource in an example embodiment of the present application is shown.
[0020] Figure 7 A flowchart of a deduplication process of a library file in an example embodiment of the present application is shown.
[0021] Figure 8 A block diagram of an electronic device provided in an example embodiment of the present application is shown. DETAILED DESCRIPTION
[0022] The example embodiments will be described in detail herein with reference to the drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following example embodiments are not meant to represent all implementations consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.
[0023] In the related art, in order to adapt to different manufacturers and different models of terminals, application installation packages need to include application component files adapted to various manufacturers and various models. For example, for terminals with different resolutions, the application installation package includes multiple sets of resources packaged to adapt to different resolution models. In addition, in order to adapt to different system architectures, the application installation package includes multiple sets of library files of different architecture types.
[0024] Taking the installation of an Android terminal App as an example, an Android installation package (Apk) of an Android application can generally be regarded as a compressed package, and its main structure is shown in Table 1.
[0025] Table 1.
[0026]
[0027] The resource folder (res) and library file (lib) are described in detail below.
[0028] The resource folder contains all the resources used by the application, such as layout files, strings, images, animations, etc.
[0029] The structure of the resource folder is as follows:
[0030] res / drawable / and res / mipmap: Store image resources (PNG, JPEG, etc.)
[0031] res / layout / : Store layout files that define the interface layout structure of the application
[0032] res / values / : Store various resource values, such as strings, colors, dimensions, etc.
[0033] res / raw / : Store raw resource files, such as audio, video, etc.
[0034] Among them, Drawable and Mipmap directories are used to store various image resources for the user interface and other image needs of the application. It is also the main memory consumption.
[0035] In Drawable and Mipmap directories, the following common conventions are usually included:
[0036] mdpi: Image resources suitable for medium density screens (Medium Density, about 160dpi).
[0037] hdpi: Image resources suitable for high-density screens (High Density, about 240dpi).
[0038] xhdpi: Image resources suitable for extra high-density screens (Extra High Density, about 320dpi).
[0039] xxhdpi: Image resources suitable for extra extra high-density screens (Extra Extra High Density, about 480dpi).
[0040] xxxhdpi: Image resources suitable for extra extra extra high-density screens (Extra Extra Extra High Density, about 640dpi).
[0041] In addition, some applications may also have other targeted directories, such as:
[0042] drawable-w600dp: Resources for an "w" layout direction needs at least 600dp of width.
[0043] drawable-h1024dp: Resources for an "h" layout direction needs at least 1024dp of height.
[0044] drawable-sw600dp: Resources for an "sw" layout direction needs at least 600dp of smallest width.
[0045] drawable-sh720dp: Resources for an "sh" layout direction needs at least 720dp of smallest height.
[0046] Apk runtime, Android system will load the appropriate icon resources from the corresponding Drawable and Mipmap directory according to the screen density of the device.
[0047] The lib directory under the Android system stores the native libraries of the application, which are usually written in C or C++ and compiled for different processor architectures. Android system supports multiple processor architectures, mainly including the following:
[0048] lib / armeabi-v7a / : Store native library files for ARMv7 architecture.
[0049] lib / arm64-v8a / : Store native library files for ARMv8 64-bit architecture.
[0050] lib / x86 / : Store native library files for x86 architecture.
[0051] lib / x86_64 / : Store native library files for x86 64-bit architecture.
[0052] lib / armeabi / : Store native library files for ARMv5 and earlier versions of architecture.
[0053] However, whether it is res under different dpi or so file under different architecture, essentially after installation, the terminal will only use one set of application component files that adapt to the terminal, and the repeated res, so are redundant files, wasting memory.
[0054] Similarly, in the handheld device operating system (IOS) developed by Apple, there is also a similar Retina mechanism, 1x, 2x, 3x, etc., and multiple files adapted to different device parameters are also included in the application installation package.
[0055] It can be seen that, whether it is the Android platform or the iOS, the windows operating system, etc., on a certain terminal device, the resources, so libraries, etc. in an APP only need to be determined, and the same-named resources under different resolutions are useful for APP manufacturers to adapt to different models, but for a known terminal device, it is a waste of the memory in the body.
[0056] In view of the above problems, an embodiment of the present application provides a solution, in the installation program of the terminal, a simplified program is added, and when the App is installed, the resources and libraries, etc. that are not applicable to the terminal are deleted, instead of directly copying all the contents in the App installation package to the terminal device, so as to reduce the memory occupation of the body and improve the effective utilization rate of the terminal memory.
[0057] The application program installation scheme provided by the embodiment of the present application will be described in detail in combination with some embodiments and application scenarios
[0058] Figure 1A flowchart of an installation method of an application program provided by an example embodiment of the present application is shown. The method can be applied to a terminal, i.e., the method can be executed by a terminal, which can be a terminal-side device such as a mobile phone, a Tablet Personal Computer, a Laptop Computer, a notebook computer, a Personal Digital Assistant (PDA), a palm computer, a netbook, an Ultra-mobile Personal Computer (UMPC), a Mobile Internet Device (MID), an Augmented Reality (AR) device, a Virtual Reality (VR) device, a robot, a wearable device, a flight vehicle, a Vehicle User Equipment (VUE), a shipboard device, a Pedestrian User Equipment (PUE), a smart home (a home device with a wireless communication function, such as a refrigerator, a television, a washing machine, or furniture, etc.), a game console, a Personal Computer (PC), a kiosk, or a self-service machine, etc. The wearable device includes a smart watch, a smart bracelet, a smart earphone, smart glasses, smart jewelry (a smart bracelet, a smart necklace, a smart ring, a smart necklace, a smart anklet, a smart necklace, etc.), a smart wristband, smart clothing, etc. The vehicle-mounted device can also be referred to as a vehicle-mounted terminal, a vehicle-mounted controller, a vehicle-mounted module, a vehicle-mounted component, a vehicle-mounted chip, or a vehicle-mounted unit, etc. It should be noted that the specific type of the terminal is not limited in the embodiments of the present application. For example, as shown in the figure, the method mainly includes the following steps. Figure 1
[0059] S110, receiving a control instruction for installing an application program.
[0060] For example, the terminal receives a control instruction for installing an application program input by a user in an application store interface, and the terminal can download an installation package of the application program.
[0061] S112, in response to the control instruction, parsing the installation package of the application program, and obtaining a plurality of application component files of the application program.
[0062] The installation package is a compressed archive file containing all the resources and code of the application. The operating system of the terminal first decompresses these files into a temporary directory, and the application component files in the temporary directory can be processed in subsequent processing. Then the operating system of the terminal can parse the installation package of the application to obtain the configuration information of the application, such as the application name, permission declaration, component declaration, for example, for the Android system, the operating system can solve the decompressed file AndroidManifest.xml: AndroidManifest.xml file, which contains the configuration information of the application, such as the application name, permission declaration, component declaration, etc. By parsing this file, the operating system can understand the basic information and requirements of the application.
[0063] In addition, the operating system can also parse other resource files in the installation package, such as icons, layout files, strings, etc. These resource files are part of the interface and functionality of the application.
[0064] In some embodiments, before installing the application on the device, the operating system can also perform signature verification on the installation package file to ensure the following points:
[0065] 1) Integrity verification: Check if the installation package file has been tampered with during transmission or storage.
[0066] 2) Identity verification: Verify the signature certificate of the installation package file to ensure that the file is indeed signed and published by the developer of the application.
[0067] If the signature verification fails, the operating system refuses to continue installing the application and displays an error message.
[0068] In some embodiments, the application may need to access various resources and functions of the terminal, such as the camera, location information, storage space, etc. Therefore, before installing the application, the operating system shows the user a list of permissions requested by the application and asks the user if they agree to grant these permissions. The user can choose to accept or reject each permission request.
[0069] S114, obtaining a target application component file from the plurality of application component files; wherein the target application component file is at least part of the application component files in the plurality of application component files that match the device parameters of the terminal.
[0070] In the embodiments of the present application, when the terminal installs the application, it does not copy all the application component files into the memory of the terminal for storage, but finds at least part of the application component files that match the device parameters of the terminal.
[0071] In some embodiments, the target application component file can be obtained from the plurality of application component files by the following steps:
[0072] Step 1, obtaining a plurality of application component files with the same function for different terminals from the plurality of application component files.
[0073] Step 2, obtaining a target application component file matching the device parameters of the terminal from the plurality of application component files with the same function.
[0074] In the installation package of the application program, in order to adapt to different terminals, there can be a plurality of application component files for the same function, for example, for the same picture content, there can be a plurality of resource pictures with different resolutions, or for the same content library file, there can be a plurality of library files for different architecture types, etc. In the above embodiments, a target application component file matching the device parameters of the terminal is obtained from the plurality of application component files, for example, for a plurality of resource pictures for the same picture content, a resource picture matching the resolution of the terminal is obtained, and for a plurality of library files for the same content, a library file matching the architecture type of the terminal is obtained.
[0075] In some embodiments, in step 2 above, obtaining a target application component file matching the device parameters of the terminal from the plurality of application component files with the same function can include the following steps:
[0076] Step 21, obtaining the device parameters of the terminal.
[0077] For example, the screen density, architecture type, etc. of the terminal can be obtained.
[0078] Step 22, obtaining the target application component file from the plurality of application component files with the same function based on the device parameters of the terminal, wherein the device parameters corresponding to the target application component file match the device parameters of the terminal.
[0079] For example, the installation package of the application program can include resource pictures for different screen density ranges, and then the terminal can obtain the screen density range to which the screen density of the current terminal belongs, and further obtain the application component file corresponding to the screen density range.
[0080] In some embodiments, different application component files with the same function can be stored in different directories of the installation package with the same identifier. Thus, the obtaining of the application component files with the same function for different terminals from the plurality of application component files can include: obtaining the application component files with the same identifier from the application component files in different directories by scanning all the directories, wherein the application component files in different directories correspond to different device parameters. Through this embodiment, the application component files with the same function can be conveniently obtained.
[0081] Optionally, the identifier can be a file name.
[0082] In some embodiments, the application component files include resource files, wherein the resource files include image files suitable for different screen density ranges. In these embodiments, the obtaining of the target application component file from the plurality of application component files can include the following steps:
[0083] Step a: obtaining the screen density of the terminal; for example, for an Android system, the screen density (densityDpi) of the current terminal can be obtained through a native interface provided by a DisplayMetrics class.
[0084] Step b: determining a target screen density range that matches the screen density of the terminal from the different screen density ranges.
[0085] Step c: obtaining an image file suitable for the target screen density range from the image files suitable for different screen density ranges.
[0086] Through the above embodiments, an image file that matches the screen density of the terminal can be obtained from a plurality of image files suitable for different screen density ranges, instead of all the image files in the installation package.
[0087] In some embodiments, the application component files include native library files, for example, dynamic link libraries with a.so suffix, wherein the native library files include library files suitable for different architecture types. In these embodiments, the obtaining of the target application component file from the plurality of application component files can include the following steps:
[0088] Step a: obtaining the architecture type of the terminal; for example, ARMv7 architecture.
[0089] Step b: obtaining a library file that matches the architecture type of the terminal from the library files suitable for different architecture types.
[0090] For example, the parsed application group files can be stored in different directories, and the library file matching the architecture type of the terminal can be acquired from the directory corresponding to the architecture type of the terminal. For example, the directory corresponding to the ARMv7 architecture can be lib / armeabi-v7a / , and the library file in the directory is the library file matching the architecture type of the terminal.
[0091] In S116, the target application component file is copied to the memory of the terminal for storage, and the installation of the application program is completed.
[0092] In the embodiment of the present application, after the target application component file matching the device parameter of the terminal is acquired, the acquired target application component file can be copied to the memory of the terminal for storage, instead of copying all the application component files to the memory of the terminal for storage, so that the memory space of the terminal can be saved.
[0093] It should be noted that, although the above description is described by taking the terminal acquiring the target application component file matching the device parameter of the terminal as an example, in actual application, the terminal can also acquire the application component file not matching the device parameter of the terminal, and delete the application component file, and then copy the remaining application component file to the memory of the terminal. It can be understood that such a technical solution belongs to the same replacement of the present application.
[0094] The technical solution provided by the embodiment of the present application will be described below by taking the operating system of the terminal as an Android system.
[0095] Figure 2 An installation process of an Apk in the related art is shown, as shown in FIG. 1, the installation process mainly includes the following steps: Figure 2
[0096] In S201, the APK file is parsed.
[0097] After receiving the control instruction of installing the application program input by the user, for example, the user clicks the installation button displayed on the terminal, the operating system of the terminal starts to parse the APK file, and the process includes the following steps:
[0098] Step 1, decompression, the APK file is a compressed archive file containing all resources and codes of the application program. The operating system first decompresses these files into a temporary directory for subsequent processing.
[0099] Step 2, parse AndroidManifest.xml, the AndroidManifest.xml file contains the configuration information of the application program, such as application name, permission declaration, component declaration, etc. The system parses this file to understand the basic information and requirements of the application program.
[0100] Step 3, parsing other resource files, the operating system also parses other resource files in the APK, such as icons, layout files, strings, etc. These resource files are components of the application interface and functions.
[0101] Step 202, signature verification.
[0102] Before installing the application to the device, the operating system performs signature verification on the APK file. Mainly includes the following:
[0103] 1) Integrity verification: Check if the APK file has been tampered with during transmission or storage.
[0104] 2) Identity verification: Verify the signature certificate of the APK file to ensure that the file is indeed signed and published by the developer of the application.
[0105] If the signature verification fails, the operating system refuses to continue installing the application and displays an error message.
[0106] Step 203, permission confirmation.
[0107] In the Android system, the application may need to access various resources and functions of the device, such as the camera, location information, storage space, etc.
[0108] Therefore, before installing the application, the operating system shows the user a list of permissions requested by the application and asks the user whether to grant these permissions. The user can choose to accept or reject each permission request.
[0109] Step 204, file copying.
[0110] If the signature verification passes and the user grants the required permissions, the operating system will copy the decompressed and verified application file to a specific location on the terminal device, for example, a third-party application can be copied under the / data / app directory. And generate a base.apk file. This location is the storage location after the application is installed, ensuring that the application can be normally accessed and managed by the system.
[0111] Step 205, end installation.
[0112] The embodiments of the present application mainly optimize the file copying step in the above installation process, and only copy the component files suitable for the terminal device parameters.
[0113] Figure 3 The installation process provided by the embodiments of the present application is shown in the schematic diagram as shown in Figure 3 Before file copying, the process performs deduplication 206 to delete useless resource component files, library files, etc.
[0114] Specifically, the deduplication 206 mainly includes the following steps.
[0115] Step 1, scanning.
[0116] Taking a resource directory (res) as an example, for the parsed apk, the drawable and mipmap directories of the res directory are scanned to find the same name resources therein, and these same name resources exist in different dpi directories. The repeated resources are iterated out.
[0117] As shown in the following table, if the current value is 330 dpi, xxhdpi is matched, and then the xxhdpi corresponding picture in the list obtained by the above iteration is found, which is the best matching picture. Figure 4 Figure 4 As shown in the following table, if the current value is 330 dpi, xxhdpi is matched, and then the xxhdpi corresponding picture in the list obtained by the above iteration is found, which is the best matching picture.
[0118] Step 2, best matching.
[0119] The screen density of the current device is obtained, such as the densityDpi of the current device screen density provided by the Display Metrics class in Android, and then the dpi division data in Table 2 is looked up downward.
[0120] Table 2.
[0121]
[0122] As shown in the above table, if the current value is 330 dpi, xxhdpi is matched, and then the xxhdpi corresponding picture in the list obtained by the above iteration is found, which is the best matching picture.
[0123] If there is no xxhdpi, according to the resource matching mechanism of Android, continue to look down, xhdpi, hdpi, mdpi…, and so on.
[0124] Of course, if the current terminal supports display size adjustment, such as some Android terminals have large, medium and small three display size displays, in this case, the pictures matched by the three displays are all retained.
[0125] As shown in the following table, if the current value is 330 dpi, xxhdpi is matched, and then the xxhdpi corresponding picture in the list obtained by the above iteration is found, which is the best matching picture. Figure 5
[0126] Step 3, pruning.
[0127] When the matching is completed, only the best resource found in the previous step can be reserved, and the best res library can be deleted for the remaining redundant invalid resources.
[0128] The final best matching picture is obtained, and other pictures are invalid resources and can be discarded, as shown in Figure 6
[0129] Step 4, end.
[0130] After the above deletion process is performed, the reduced Apk can be copied to the data / APP directory to become the final running base.apk file, that is, it returns to the normal installation process.
[0131] For native library files, taking a dynamic link library file (.so) as an example, the simplification process is similar to res. Scan the dynamic link library files in different architecture directories, find the dynamic link library files with the same name, and make a record. Then, according to the architecture type of the current model, find the unique dynamic link library file, and then simplify, as shown in Figure 7 At this point, the simplification process has ended, and the copying process can be returned.
[0132] Figure 8 A structural block diagram of an electronic device 800 is shown, which is shown in an example embodiment of the present application. The electronic device 800 can be implemented as the electronic device described above. For example: smart phone, tablet computer, notebook computer, desktop computer, smart watch and television, etc. The electronic device 800 can also be referred to as a user device, a portable electronic device, a laptop electronic device, a desktop electronic device, and other names.
[0133] Generally, the electronic device 800 includes a processor 801 and a memory 802.
[0134] The processor 801 can include one or more processing cores, such as a 4-core processor, a 10-core processor, etc. The processor 801 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), a PLA (Programmable Logic Array). The processor 801 can also include a main processor and a coprocessor, the main processor being a processor for processing data in an awake state, also known as a CPU (Central Processing Unit), and the coprocessor being a low-power processor for processing data in a standby state. In some embodiments, the processor 801 can be integrated with a GPU (Graphics Processing Unit) for rendering and drawing content required to be displayed by the display screen. In some embodiments, the processor 801 can further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
[0135] The memory 802 can include one or more computer-readable storage media that can be non-transitory. The memory 802 can also include a high-speed random access memory, and a nonvolatile memory such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory readable storage medium in the memory 802 is used to store at least one instruction for being executed by the processor 801 to implement all or part of the steps in the installation method of the application program shown in the method embodiment of the present application.
[0136] In some embodiments, the electronic device 800 can further optionally include a peripheral device interface 803 and at least one peripheral device. The processor 801, the memory 802, and the peripheral device interface 803 can be connected through a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 803 through a bus, a signal line, or a circuit board. Specifically, the peripheral device includes at least one of a radio frequency circuit 804, a display screen 805, a camera assembly 806, an audio circuit 807, and a power supply 808.
[0137] In some embodiments, the electronic device 800 further includes one or more sensors 809. The one or more sensors 809 include, but are not limited to, an acceleration sensor 810, a gyroscope sensor 811, a pressure sensor 812, an optical sensor 813, and a proximity sensor 814.
[0138] Those skilled in the art can understand that Figure 8 The structure shown in the middle does not constitute a limitation on the electronic device 800, and can include more or fewer components than shown, or combine some components, or use different arrangements of components.
[0139] In an exemplary embodiment, a readable storage medium is also provided, and the computer readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement all or part of the steps of the installation method of the application program described above. For example, the readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0140] In an exemplary embodiment, a computer program product is also provided, and the computer program product includes at least one computer program, which is loaded and executed by a processor to implement all or part of the steps of the installation method of the application program shown in any of the embodiments described above.
[0141] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the application be limited only by the scope of the claims, which will be construed in accordance with the principles of patent law including 35 U.S.C. § 112(f). The summary of the application and its advantages are illustrative only and are not intended to be in any way limiting. Other advantages of the application will become apparent in light of the following detailed description and the drawings.
[0142] It should be understood that the application is not limited to the precise construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application is limited only by the claims that follow, and the embodiment described and illustrated above is merely exemplary of the application claimed.
Claims
1. An installation method of an application program, characterized by, Applied to a terminal, comprising: receiving a control instruction for installing an application program; in response to the control instruction, parsing an installation package of the application program, and obtaining a plurality of application component files of the application program; obtaining a target application component file from the plurality of application component files; wherein the target application component file is at least part of the application component files in the plurality of application component files that matches the device parameters of the terminal; copying the target application component file to the memory of the terminal for storage, and completing the installation of the application program.
2. The method according to claim 1, characterized in that The target application component file is obtained from the plurality of application component files, comprising: obtaining a plurality of application component files with the same effect for different terminals from the plurality of application component files; obtaining a target application component file that matches the device parameters of the terminal from the plurality of application component files with the same effect.
3. The method of claim 2, wherein, The plurality of application component files with the same effect for different terminals are obtained from the plurality of application component files, comprising: by scanning all directories under the application component file, obtaining a plurality of application component files under different directories with the same identifier, wherein the application component files under different directories correspond to different device parameters.
4. The method of claim 3, wherein, The identifier includes a file name.
5. The method of claim 2, wherein, The target application component file that matches the device parameters of the terminal is obtained from the plurality of application component files with the same effect, comprising: obtaining the device parameters of the terminal; based on the device parameters of the terminal, obtaining the target application component file from the plurality of application component files with the same effect, wherein the device parameters corresponding to the target application component file match the device parameters of the terminal.
6. The method according to any one of claims 1 to 5, characterized in that, The application component file includes a resource file, wherein the resource file includes image files suitable for different screen density ranges; The target application component file is obtained from the plurality of application component files, comprising: obtaining the screen density of the terminal; determining a target screen density range that matches the screen density of the terminal from the different screen density ranges; obtaining an image file suitable for the target screen range from the image files suitable for different screen density ranges.
7. The method according to any one of claims 1 to 5, characterized in that, The application component file includes a native library file, wherein the native library file includes library files suitable for different architecture types; The target application component file is obtained from the plurality of application component files, comprising: obtaining the architecture type of the terminal; obtaining a library file that matches the architecture type of the terminal from the library files suitable for different architecture types.
8. An electronic device, comprising: The electronic device includes a processor and a memory, the memory stores programs or instructions that can be run on the processor, and the programs or instructions are executed by the processor to implement the steps of the application program installation method according to any one of claims 1 to 7.
9. A readable storage medium, characterized by, The readable storage medium stores programs or instructions, which are executed by the processor to implement the steps of the application program installation method according to any one of claims 1 to 7.
10. A computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to carry out the steps of the installation method of the application program as claimed in any one of claims 1 to 7.