[0022] In order to make the purpose, technical means and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings.
[0023] In the APP of the Android system, in order to realize specific functions, some modules may need to be implemented, and these modules are used to realize the interaction between the application layer and the system operation layer. For this type of module, after the introduction of the HIDL framework, the HIDL interface needs to be used, but the single warehouse compilation cannot be realized according to the existing method. Taking the RIL module as an example, figure 1 and figure 2 It is a schematic diagram of the interaction framework of RIL before and after the introduction of the HIDL framework. The RIL framework includes RILJ and RILC. like figure 1 As shown, before the introduction of the HIDL framework, RILJ and RILC are connected through the socket interface, which can realize single warehouse compilation. like figure 2 As shown, after the introduction of the HIDL framework, the interface between RILJ and RILC becomes a HIDL interface, but the classes HwBinder, HwBlob, HwParcel, IHwBinder, and IHwInterface that need to be inherited when implementing HIDL are @hide attributes, and the WorkSource that needs to be used The getName, get, size and other methods of the class are also @hide attributes. The base classes and methods of these @hide attributes are not open in the androidSDK; at the same time, the LTERadio interface defined in the interface that needs to be used when implementing the RIL module cannot be packaged into SDK. Since the above-mentioned hidden classes, methods, and interfaces are not packaged into the SDK, they cannot be directly provided to APK developers. As a result, single-bin compilation of RIL modules cannot be realized, which in turn affects the compilation of the entire APP.
[0024] In view of the above situation, this application provides an APP compilation method, which can realize single-compartment compilation for each module used to realize the interaction between the application layer and the system operation layer, thereby ensuring that the entire APP realizes single-compartment compilation.
[0025] image 3 It is a schematic flow chart of the APP compilation method in this application. like figure 1 As shown, the method includes:
[0026] Step 301, for each module of the interaction between the application layer and the system operation layer to be implemented by the APP, select a base class and/or method that needs to be inherited when compiling the corresponding module and that is not disclosed in the Android SDK, compile it and package it A jar package is provided to the APK of the APP for compilation.
[0027] Taking the implementation of RIL module as an example, when compiling the RIL module, you need to inherit the base classes and methods that are not public in the Android SDK, that is, the HwBinder class, HwBlob class, HwParcel class, IHwBinder class, IHwInterface class, and WorkSource class. methods such as getName, get and size, compile the above selected classes and methods and pack them into a jar package, such as hidlSupport.jar.
[0028] The same is done for other similar modules. For some modules, all the base classes that may be required for implementation are already included in the SDK, and only some methods are not included, then only these hidden methods are compiled and packaged; All methods are included in the SDK, only some base classes are not included, then only these hidden base classes are compiled and packaged. In the actual implementation process, according to the different situations of each module, select the corresponding base class and/or method to compile and package.
[0029] When providing the packaged jar package to the APK for compilation, the specific processing can be: copy the jar package to the APK compilation project, and mark it as only compiling and relying on the jar package, but the released APK does not include the jar Bag.
[0030] Step 302, corresponding to each module in step 301, pack the hidden interface between the HIDL interface for the corresponding module and the system operation layer into another jar package, and provide it to the APK as an interface dependency library for compilation.
[0031] Take the implementation of the RIL module as an example. For the RIL module, the hidden interface between the HIDL interface and the system operation layer is the LTERadio interface defined in Interface. Therefore, this interface is packaged into a jar package, such as LTERadiointerface.jar.
[0032] Corresponding to different modules, the hidden interfaces may also be different. In practical applications, select the appropriate interface according to the actual situation and package it into a jar package.
[0033]When providing the packaged interface jar package to the APK for compilation, the specific processing can be the same as in step 301: copy the jar package to the APK compilation project, and mark it as only compiling and relying on the jar package, and the published The jar package is not included in the APK.
[0034] Step 303, using the jar package for each module to compile the APK.
[0035] For an APP, if each module that the APP is to implement that depends on the HIDL interface has provided the corresponding jar package, the APK of the APP can be compiled in a single warehouse.
[0036] So far, the procedure of the APP compiling method in this application ends.
[0037] Figure 4 It is a schematic diagram of compilation dependencies for RIL modules. like Figure 4 As shown, a communication class APP (EcomApp), in order to realize the RIL module, has packaged hidlSupport.jar (from step 301) and lteradiointerface.jar (from step 302), and has established a dependency relationship with the RILJ AT component, And mark that this dependency is limited to compilation dependencies, and the released APK does not include hidlSupport.jar and lteradiointerface.jar; at the same time, the system comes with androidSdk, which can provide base classes, methods, and interfaces exposed in other SDKs. Through the above method, when compiling the APK of the APP, the base class, method and interface that the RILJ AT component needs to inherit can be found smoothly, so as to realize single warehouse compilation.
[0038] The above is the specific implementation of the APP compiling method in this application. Through the above method, the classes, methods, and interfaces that need to be used but hidden can be packaged into jar packages, and provided to APK dependencies, so as to realize single warehouse compilation of APK and improve the flexibility of developing and compiling APP.
[0039] The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the present invention. within the scope of protection.