Native application integration method, device and equipment based on Android modular base

By encapsulating the BaseWebView, BaseEventBus, and BaseInterface components, unified display and message transmission between Android native applications and front-end subsystems are achieved, solving the problem of high program coupling and improving parallel development efficiency and user stickiness.

CN119536795BActive Publication Date: 2025-09-30NO 15 INST OF CHINA ELECTRONICS TECH GRP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411686395.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-09-30
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

When Android native applications integrate multiple front-end subsystems, the program coupling is high, resulting in increased development and maintenance costs, low parallel development efficiency, and reduced user stickiness.

Method used

Adopting the method based on Android modular base, by encapsulating BaseWebView, BaseEventBus and BaseInterface components, unified interface display and message transmission between front-end subsystem and Android native applications are realized, which reduces coupling and supports parallel development.

Benefits of technology

It simplifies the development process, reduces program coupling, improves parallel development efficiency, reduces the number of version iterations, and improves user stickiness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536795B_ABST
    Figure CN119536795B_ABST
Patent Text Reader

Abstract

The present invention proposes a native application integration method, device, and equipment based on an Android modular base, the method comprising: a front-end subsystem calls a native scanning function through a pre-configured Android basic base; wherein the Android basic base comprises an Android modular base, and the Android modular base comprises a BaseWebView component, a BaseEventBus component, and a BaseInterface component; a scanning function method is defined in the BaseInterface component; a scanning result receiving method is defined in the front-end subsystem; in the scanning function method, a message of the front-end subsystem calling the scanning function module is passed to the scanning function module through the BaseEventBus component; after receiving the message, the scanning function module calls the scanning function to scan the code, and after the scanning is successful, the scanning result is passed back to the front-end subsystem through the BaseWebView component; after the front-end subsystem receives the scanning result, the next step is performed. This application encapsulates the Android native transformation into BaseWebView, BaseInterface, and BaseEventBus, realizing the parallel development of native applications and subsystems, thereby reducing development time and program coupling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer application technology, and in particular to a native application integration method, device, equipment and medium based on an Android modular base. Background Art

[0002] In mobile application development, integrating multiple front-end subsystems into Android native applications is a common requirement. Related integration methods primarily rely on Android native development components WebView and JsBridge. However:

[0003] When using WebView and JsBridge to integrate multiple front-end subsystems, the interaction between each subsystem and the Android native application will increase program coupling, making code maintenance and upgrades more complicated and increasing development and maintenance costs.

[0004] Due to high coupling, the development of different subsystems often needs to wait for the partial completion of other subsystems or native applications, which limits the efficiency of parallel development and prolongs the development cycle;

[0005] At the same time, with the rapid iteration and update of functional requirements, applications (APPs) need to frequently iterate and upgrade versions, which increases the development workload and leads to a decrease in user stickiness. Summary of the Invention

[0006] The present invention provides a native application integration method, device, equipment and medium based on an Android modular base, which solves the problems of high program coupling and limited development efficiency when Android native applications integrate multiple front-end subsystems.

[0007] To achieve the above objectives, this application adopts the following technical solutions:

[0008] In a first aspect, a native application integration method based on an Android modular base is provided, comprising:

[0009] The front-end subsystem calls the native code scanning function through a pre-configured Android base; wherein, the Android base includes an Android modular base, which includes a BaseWebView component, a BaseEventBus component, and a BaseInterface component; the BaseWebView component is an entity class formed by extracting and encapsulating a third-party web page display control, used for front-end interface display; the BaseEventBus component is an entity class formed by introducing a third-party dependency, used for message transmission between modules of the Android modular base; the BaseInterface component is a control that defines a unified interaction method between Android native applications and the front-end subsystem;

[0010] Define the code scanning function method in the BaseInterface component;

[0011] Define a method for receiving scan results in the front-end subsystem;

[0012] In the code scanning function method, the message of the front-end subsystem calling the code scanning function module is passed to the code scanning function module through the BaseEventBus component;

[0013] After receiving the message, the code scanning function module calls the code scanning function to scan the code. After the code scanning is successful, the code scanning result is sent back to the front-end subsystem through the BaseWebView component;

[0014] After the front-end subsystem receives the scan result, it proceeds to the next step.

[0015] In a first possible implementation of the first aspect, the Android basic base further includes:

[0016] APP application layer, which includes APP common function modules and multiple front-end subsystems;

[0017] Android Framework layer, which includes UI templates, mobile development framework, development tool set and database services;

[0018] Android mobile phone hardware module, the Android mobile phone hardware module includes at least one mobile phone hardware.

[0019] In a second possible implementation of the first aspect, building the BaseWebView component includes the following steps:

[0020] Introduce the third-party web page display control agentWeb into the project;

[0021] Create a new BaseWebView class;

[0022] Create a new function parameter method and interface loading method in the BaseWebView class;

[0023] Among them, the function parameter method is responsible for the function parameter configuration of the front-end interface, performs function configuration for WebSettings, and is uniformly called by the interface loading method; the interface loading method encapsulates the interface loading method of the agentWeb, wherein the method parameters include Activity, LinearLayout, and String. The three parameters correspond to the Activity context, the LinearLayout front-end display container, and the front-end link respectively.

[0024] Based on the second possible implementation of the first aspect, in a third possible implementation of the first aspect, building the BaseEventBus component includes the following steps:

[0025] Introducing third-party dependencies into said project;

[0026] Create a new entity class BaseEventCustom, which includes a message tag and message content;

[0027] When the BaseInterface component receives a call request from the subsystem front-end interface, it passes the message body to the demand realization module; the demand realization module receives the message from the BaseInterface to realize the specific demand, and after realizing the specific demand, it passes the message to the front-end subsystem.

[0028] Based on the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, building the BaseInterface component includes the following steps:

[0029] Create a new BaseInterface class in the project;

[0030] In the BaseInterface class, define a unified call tag, agentWeb, and Context, and also define a constructor with agentWeb and Context as parameters. This constructor will be called when the BaseWebView component's interface loading method is called.

[0031] After receiving the demand call from the subsystem front-end interface, the BaseInterface component uses the entity class BaseEventCustom to distribute the demand message to the specific implementation module.

[0032] In a second aspect, a native application integration device based on an Android modular base is provided, comprising:

[0033] The native code scanning function calling module is used by the front-end subsystem to call the native code scanning function through the pre-configured Android base. The Android base includes the Android modular base, which includes the BaseWebView component, the BaseEventBus component, and the BaseInterface component. The BaseWebView component is an entity class formed by extracting and encapsulating third-party web page display controls, used for front-end interface display. The BaseEventBus component is an entity class formed by introducing third-party dependencies, used for message transmission between modules of the Android modular base. The BaseInterface component is a control that defines a unified interaction method between Android native applications and front-end subsystems.

[0034] The code scanning function method definition module is used to define the code scanning function method in the BaseInterface component;

[0035] A code scanning result receiving method definition module, used to define a code scanning result receiving method in the front-end subsystem;

[0036] A message passing module is used to pass the message of the front-end subsystem calling the code scanning function module to the code scanning function module through the BaseEventBus component in the code scanning function method;

[0037] The code scanning result feedback module is used to call the code scanning function to scan the code after the code scanning function module receives the message. After the code scanning is successful, the code scanning result is sent back to the front-end subsystem through the BaseWebView component;

[0038] The code scanning result receiving module is used for the front-end subsystem to perform the next operation after receiving the code scanning result.

[0039] In a first possible implementation of the second aspect, the Android basic base further includes:

[0040] APP application layer, which includes APP common function modules and multiple front-end subsystems;

[0041] Android Framework layer, which includes UI templates, mobile development framework, development tool set and database services;

[0042] Android mobile phone hardware module, the Android mobile phone hardware module includes at least one mobile phone hardware.

[0043] In a second possible implementation of the second aspect, building the BaseWebView component includes the following steps:

[0044] Introduce the third-party web page display control agentWeb into the project;

[0045] Create a new BaseWebView class;

[0046] Create a new function parameter method and interface loading method in the BaseWebView class;

[0047] The function parameter method is responsible for configuring the function parameters of the front-end interface, performing function configuration for WebSettings, and is uniformly called by the interface loading method; the interface loading method encapsulates the interface loading method of the agentWeb, wherein the method parameters include Activity, LinearLayout, and String, which correspond to the Activity context, LinearLayout front-end display container, and front-end link respectively;

[0048] Building the BaseEventBus component includes the following steps:

[0049] Introducing third-party dependencies into said project;

[0050] Create a new entity class BaseEventCustom, which includes a message tag and message content;

[0051] When the BaseInterface component receives a call request from the subsystem front-end interface, it passes the message body to the demand realization module; the demand realization module receives the message from the BaseInterface to realize the specific demand, and after realizing the specific demand, it passes the message to the front-end subsystem;

[0052] Building the BaseInterface component involves the following steps:

[0053] Create a new BaseInterface class in the project;

[0054] In the BaseInterface class, define a unified call tag, agentWeb, and Context, and also define a constructor with agentWeb and Context as parameters. This constructor will be called when the BaseWebView component's interface loading method is called.

[0055] After receiving the demand call from the subsystem front-end interface, the BaseInterface component uses the entity class BaseEventCustom to distribute the demand message to the specific implementation module.

[0056] In a third aspect, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the native application integration method based on the Android modular base as described in the first aspect are implemented.

[0057] In a fourth aspect, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the native application integration method based on the Android modular base as described in the first aspect are implemented.

[0058] Beneficial effects:

[0059] This application transforms and encapsulates the Android native system into BaseWebView, BaseInterface, and BaseEventBus. BaseWebView encapsulates the existing Android system's built-in WebView control, unifies the interface display and calling methods, simplifies the calling process, and thus realizes the unified display of various front-end subsystems in Android native applications. After BaseInterface encapsulates the BaseWebView control to realize the display of various systems in Android native applications, the interactive calls between each system and Android native can realize message communication between each interface through the encapsulated BaseEventBus. The BaseEventBus message transmission module is built to realize message communication between the interfaces of Android native applications and various subsystems.

[0060] This solution can standardize the development framework, encapsulate unified service modules, design a unified interface style, formulate the notification process for mutual adjustment between Android native applications and subsystems, realize the parallel development of Android native applications and subsystems, and achieve the purpose and effect of reducing development time and program coupling. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1A schematic flow chart of a native application integration method based on an Android modular base provided in an embodiment of the present application;

[0062] Figure 2 A schematic flow chart of another native application integration method based on an Android modular base provided in an embodiment of the present application;

[0063] Figure 3 An Android base architecture diagram provided in an embodiment of the present application;

[0064] Figure 4 A structural block diagram of a native application integration device based on an Android modular base provided in an embodiment of the present application;

[0065] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0066] To further illustrate the technical means and effects of the present invention to achieve its intended purpose, the technical solutions in the embodiments of this application are clearly described. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of this application are within the scope of protection of this application.

[0067] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0068] The description of the method flow in the specification of this application and the steps in the flowcharts in the drawings of the specification of this application do not necessarily need to be strictly executed according to the step numbers. The method steps can be executed in a different order. In addition, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.

[0069] The following is a detailed description of the native application integration method, device, equipment and medium based on the Android modular base provided in the embodiments of the present application in combination with the accompanying drawings and preferred embodiments.

[0070] First, the application scenario of the native application integration method based on the Android modular base in the embodiment of the present application is described in detail.

[0071] In related technologies, most Android native applications integrate multiple front-end subsystems starting from the Android native development components WebView and JsBridge. Considering factors in multiple dimensions such as development time, labor cost, and program coupling, this method will result in high program coupling and low parallel development efficiency. At the same time, the rapid iterative updates of functional requirements greatly increase the number of APP version iterations and upgrades, thereby reducing user stickiness.

[0072] In response to the above technical problems, this application proposes a native application integration method based on the Android modular base, which aims to reduce program coupling and improve parallel development efficiency, analyze existing needs, and improve the original WebView component of traditional Android native development, thereby solving the problems of high program coupling and low parallel development efficiency; by upgrading and transforming the Android native WebView display component and encapsulating it into a BaseWebView front-end subsystem display control, the interface display of each subsystem in the Android native application is realized; by encapsulating a unified Android native application and front-end subsystem interaction module BaseInterface, the unified call of Android native application and subsystem methods is realized, thereby reducing the amount of duplicate code; building a BaseEventBus message transmission module to realize the message communication of the interface between Android native applications and subsystems.

[0073] This solution unifies the Android application interface style, component services, development framework, and development specifications, packaging them into a unified APK installation package for distribution, enabling unified management of Android native applications and subsystems. The entire system utilizes a single software package, enabling parallel development of Android native applications and subsystems, reducing development time and program coupling, and meeting the needs of diverse user scenarios.

[0074] See Figure 1-2 , the embodiment of the present application provides a native application integration method based on the Android modular base, such as Figure 1-2 As shown, the integration method of the embodiment of the present application includes the following steps:

[0075] In step S1, the front-end subsystem calls the native code scanning function through the pre-configured Android base.

[0076] Wherein, the Android basic base includes an Android modular base, and the Android modular base includes a BaseWebView component, a BaseEventBus component, and a BaseInterface component;

[0077] The BaseWebView component is an entity class formed by extracting and encapsulating a third-party web page display control, used for front-end interface display. Specifically, it is the core control displayed by the subsystem in native Android applications. It uses Gradle, Android's native dependency management tool, to introduce the third-party web page display control agentWeb. The core methods of agentWeb are extracted and encapsulated to form the BaseWebView class. By encapsulating agentWeb, agentWeb calls are simplified, providing unified configuration and management, and implementing common features such as interaction with JavaScript, network request processing, and page loading state management. Furthermore, the subsystem can be integrated into native Android applications.

[0078] The BaseEventBus component is an entity class formed by introducing third-party dependencies, used for messaging between modules in the Android modular base. Specifically, after the BaseInterface message hub component introduces a call method from the front-end interface, this component distributes the method request to the specific module that implements the request. BaseEventBus is a publish-subscribe event bus with three main elements: Event, Publisher, which can publish events on any thread, and Subscriber. Based on the Observer pattern, it separates the event receiver and sender, simplifying communication between components.

[0079] The BaseInterface component is a control that defines a unified interaction method between Android native applications and front-end subsystems. Specifically, this component is a core hub control that encapsulates a unified interaction method between Android native applications and subsystems. By defining interaction methods within this component, Android native applications and subsystem front-end applications can call each other's interaction methods. Through this interaction hub control, Android native applications and subsystem front-end applications can use a unified calling process, calling rules, and calling methods. The same function can be called using a single method, effectively reducing code duplication.

[0080] For example, see Figure 3: The above-mentioned Android basic base includes the APP application layer, Android modular base, Android Framework layer and Android mobile phone hardware module. The APP application layer includes APP public function modules and multiple front-end subsystems, and usually integrates login functions. The Android modular base includes BaseWebView components, BaseInterface components and BaseEventBus components. The Android Framework layer includes UI templates, mobile development frameworks, development tool sets and database services. Android mobile phone hardware modules can include mobile phone hardware such as cameras, GPS / Beidou, sensors, Bluetooth / WiFi, and audio and video data players.

[0081] In some possible implementations, building a BaseWebView component includes the following steps:

[0082] Step S111: introduce a third-party web page display control agentWeb into the project.

[0083] Step S112: Create a new BaseWebView class.

[0084] Step S113, creating a function parameter method and an interface loading method in the BaseWebView class;

[0085] Among them, the function parameter method is responsible for the function parameter configuration of the front-end interface, performs function configuration for WebSettings, and is uniformly called by the interface loading method; the interface loading method encapsulates the interface loading method of agentWeb, and the method parameters include Activity, LinearLayout, and String. The three parameters correspond to the Activity context, LinearLayout front-end display container, and front-end link respectively.

[0086] In the specific implementation, in the interface loading method, first obtain a JavaScript interface holder from the agentWeb object; then create an instance of BaseInterface and pass the necessary parameters agentWeb and activity; use the addJavaObject method of the interface holder to add the BaseInterface instance to the holder, where BaseInterface.className is the key (or identifier) ​​and baseInterfaceInstance is the value (or the actual object). The example code is as follows:

[0087] agentWeb.getJsInterfaceHolder().addJavaObject(BaseInterface.className,new BaseInterface(agentWeb,activity))

[0088] The Activity responsible for displaying the interface calls the BaseInterface method. In addition, the function parameter method needs to be called in the interface loading method to display the display properties of the front-end interface.

[0089] In your Activity, call the createWebView method of the BaseWebView instance and pass the necessary parameters: the current Activity context, the LinearLayout to place the WebView, and the URL of the web page to load. The createWebView method returns an AgentWeb instance that has been configured and associated with the LinearLayout. It loads the specified web page and displays it in the Activity. The example code is as follows:

[0090] AgentWeb agentWeb=newBaseWebView().createWebView(this,llWeb,mWebUrl).

[0091] In other words, the aforementioned function parameter method primarily binds the front-end subsystem to the methods provided by the Android Dock to the front-end subsystem, enabling the front-end subsystem to call Android Dock methods. The aforementioned interface loading method primarily involves the Android Dock calling the front-end subsystem address, enabling the Android Dock to load the front-end interface. Using these two methods together, you can achieve the effect of displaying the front-end subsystem on the Android Dock and allowing the front-end subsystem and Android Dock to call methods on each other.

[0092] In some possible implementations, building a BaseEventBus component includes the following steps:

[0093] Step S121: introduce a third-party dependency (org.simple:androideventbus) into the project. This dependency is responsible for implementing message communication between internal modules.

[0094] Step S122: Create a new entity class, BaseEventCustom, which includes message tags and message content. For example, the entity class includes variables such as tag, content1, content2, and content3. Tag is responsible for transmitting tags and ensuring that messages are sent and received accurately by the receiving end. The remaining variables are responsible for transmitting message content.

[0095] When the BaseInterface component receives a call request from the subsystem's front-end interface, it passes the message body to the request implementation module. In implementation, it first finds the default instance of EventBus and sends a baseEventCustom event object that encapsulates the specific information. The message is then sent by calling the post method, passing the baseEventCustom object as a parameter. The following example code demonstrates this: EventBus.getDefault().post(baseEventCustom).

[0096] The requirement implementation module receives messages from the BaseInterface to implement specific requirements and then passes the messages to the front-end subsystem. In practice, the requirement implementation module first registers with the EventBus to receive messages, registering the current instance as an EventBus subscriber. Next, it defines a method that will be called by the EventBus upon receiving a matching event to process the received message. It then processes the specific requirements based on the event's tag and other content, processing the received message (BaseEventCustom event). Finally, it uses AgentWeb to pass the processing results to the front-end subsystem. The following is an example code snippet:

[0097] EventBus.getDefault().register(this)

[0098] AgentWeb.getJsEntraceAccess().quickCallJs(front-end method body, message).

[0099] In some possible implementations, constructing a BaseInterface component includes the following steps:

[0100] Step S131: Create a new BaseInterface class in the project.

[0101] In step S132, define a unified call tag, agentWeb (front-end display control), and Context in the BaseInterface class, and also define a constructor with agentWeb and Context as parameters. This method will be called when the BaseWebView component's interface loading method is called.

[0102] After the BaseInterface component receives the demand call from the subsystem front-end interface, it uses the entity class BaseEventCustom to distribute the demand message to the specific implementation module.

[0103] Step S2: Define a code scanning function method in the BaseInterface component of the Android modular base. For example, define the code scanning function method as scanForH5().

[0104] Step S3: Define the method for receiving the scan result in the front-end subsystem. For example, define the method for receiving the scan result as postScanResult(String result).

[0105] Step S4: In the code scanning function method, the message that the front-end subsystem calls the code scanning function module is passed to the code scanning function module through the BaseEventBus component.

[0106] BaseEventCustom can be used to pass the message from the front-end subsystem calling the code scanning function module to the code scanning function module.

[0107] Step S5: After receiving the message, the code scanning function module calls the code scanning function to scan the code. After the code scanning is successful, the code scanning result is sent back to the front-end subsystem through the BaseWebView component.

[0108] After a successful scan, the scan result is transmitted back to the front-end subsystem via AgentWeb. In implementation, first obtain a permission to access the JavaScript interface from the AgentWeb object. Then, define a function to quickly call a JavaScript method, which accepts three parameters: the interface access permission, the JavaScript method name, and the parameters to pass to the method. This function then calls the JavaScript method named postScanResult with the interface access permission, passing the variable result as a parameter. The following example code is provided: AgentWeb.getJsEntraceAccess().quickCallJs("postScanResult",result).

[0109] Step S6: After the front-end subsystem receives the scan result, it proceeds to the next step.

[0110] Based on the above integration method, this application has the following technical effects:

[0111] This application transforms and encapsulates the Android native system into BaseWebView, BaseInterface, and BaseEventBus. BaseWebView encapsulates the existing Android system's built-in WebView control, unifies the interface display and calling methods, simplifies the calling process, and thus realizes the unified display of various front-end subsystems in Android native applications. After BaseInterface encapsulates the BaseWebView control to realize the display of various systems in Android native applications, the interactive calls between each system and Android native can realize message communication between each interface through the encapsulated BaseEventBus. The BaseEventBus message transmission module is built to realize message communication between the interfaces of Android native applications and various subsystems.

[0112] This solution can standardize the development framework, encapsulate unified service modules, design a unified interface style, formulate the notification process for mutual adjustment between Android native applications and subsystems, realize the parallel development of Android native applications and subsystems, and achieve the purpose and effect of reducing development time and program coupling.

[0113] See also Figure 4 Corresponding to the above-mentioned embodiment of the native application integration method based on the Android modular base, the embodiment of the present application provides a native application integration device based on the Android modular base, the integration device comprising:

[0114] Native code scanning function calling module 1001 is used for the front-end subsystem to call the native code scanning function through the pre-configured Android base base; wherein, the Android base base includes the Android modular base, and the Android modular base includes the BaseWebView component, the BaseEventBus component and the BaseInterface component; the BaseWebView component is an entity class formed by extracting and encapsulating third-party web page display controls, used for front-end interface display; the BaseEventBus component is an entity class formed by introducing third-party dependencies, used for message transmission between modules of the Android modular base; the BaseInterface component is a control that defines a unified interaction method between Android native applications and front-end subsystems;

[0115] The code scanning function method definition module 1002 is used to define the code scanning function method in the BaseInterface component;

[0116] A code scanning result receiving method definition module 1003 is used to define a code scanning result receiving method in the front-end subsystem;

[0117] A message delivery module 1004 is used to deliver the message of the front-end subsystem calling the code scanning function module to the code scanning function module through the BaseEventBus component in the code scanning function method;

[0118] The code scanning result feedback module 1005 is used for the code scanning function module to call the code scanning function to scan the code after receiving the message, and after the code scanning is successful, the code scanning result is sent back to the front-end subsystem through the BaseWebView component;

[0119] The code scanning result receiving module 1006 is used for the front-end subsystem to perform the next operation after receiving the code scanning result.

[0120] Furthermore, the Android base also includes:

[0121] APP application layer, which includes APP common function modules and multiple front-end subsystems;

[0122] Android Framework layer, which includes UI templates, mobile development framework, development tool set and database services;

[0123] Android mobile phone hardware module, the Android mobile phone hardware module includes at least one mobile phone hardware.

[0124] Furthermore, constructing the BaseWebView component includes the following steps:

[0125] Introduce the third-party web page display control agentWeb into the project;

[0126] Create a new BaseWebView class;

[0127] Create a new function parameter method and interface loading method in the BaseWebView class;

[0128] The function parameter method is responsible for configuring the function parameters of the front-end interface, performing function configuration for WebSettings, and is uniformly called by the interface loading method; the interface loading method encapsulates the interface loading method of the agentWeb, wherein the method parameters include Activity, LinearLayout, and String, which correspond to the Activity context, LinearLayout front-end display container, and front-end link respectively;

[0129] Building the BaseEventBus component includes the following steps:

[0130] Introducing third-party dependencies into said project;

[0131] Create a new entity class BaseEventCustom, which includes a message tag and message content;

[0132] When the BaseInterface component receives a call request from the subsystem front-end interface, it passes the message body to the demand realization module; the demand realization module receives the message from the BaseInterface to realize the specific demand, and after realizing the specific demand, it passes the message to the front-end subsystem;

[0133] Building the BaseInterface component involves the following steps:

[0134] Create a new BaseInterface class in the project;

[0135] In the BaseInterface class, define a unified call tag, agentWeb, and Context, and also define a constructor with agentWeb and Context as parameters. This constructor will be called when the BaseWebView component's interface loading method is called.

[0136] After receiving the demand call from the subsystem front-end interface, the BaseInterface component uses the entity class BaseEventCustom to distribute the demand message to the specific implementation module.

[0137] The above-mentioned native application integration device based on the Android modular base implements the steps and various processes of the above-mentioned native application integration method embodiment based on the Android modular base, and can achieve the same technical effect. To avoid repetition, they will not be repeated here.

[0138] See also Figure 5Corresponding to the above-mentioned embodiment of the native application integration method based on the Android modular base, the embodiment of the present application provides an electronic device, which includes: a memory, a processor, and a computer program stored on the memory and capable of running on the processor. When the computer program is executed by the processor, the steps and various processes of the above-mentioned embodiment of the native application integration method based on the Android modular base are implemented, and the same technical effect can be achieved. To avoid repetition, they will not be repeated here.

[0139] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0140] Processor 1010 may include one or more processing units. Optionally, processor 1010 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 1010.

[0141] Corresponding to the above-mentioned embodiment of the native application integration method based on the Android modular base, the embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by the processor, the steps and various processes of the above-mentioned embodiment of the native application integration method based on the Android modular base are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0142] The processor is the processor in the electronic device described in the embodiment of the present application. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0143] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0144] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0145] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.

Claims

1. A native application integration method based on Android modular base, characterized in that: include: The front-end subsystem calls the native code scanning function through a pre-configured Android base; wherein, the Android base includes an Android modular base, which includes a BaseWebView component, a BaseEventBus component, and a BaseInterface component; the BaseWebView component is an entity class formed by extracting and encapsulating a third-party web page display control, used for front-end interface display; the BaseEventBus component is an entity class formed by introducing a third-party dependency, used for message transmission between modules of the Android modular base; the BaseInterface component is a control that defines a unified interaction method between Android native applications and the front-end subsystem; Define the code scanning function method in the BaseInterface component; Define a method for receiving scan results in the front-end subsystem; In the code scanning function method, the message of the front-end subsystem calling the code scanning function module is passed to the code scanning function module through the BaseEventBus component; After receiving the message, the code scanning function module calls the code scanning function to scan the code. After the code scanning is successful, the code scanning result is sent back to the front-end subsystem through the BaseWebView component; After the front-end subsystem receives the scan result, it proceeds to the next step.

2. The native application integration method based on Android modular base according to claim 1, characterized in that: The Android basic base further includes: APP application layer, which includes APP common function modules and multiple front-end subsystems; Android Framework layer, which includes UI templates, mobile development framework, development tool set and database services; Android mobile phone hardware module, the Android mobile phone hardware module includes at least one mobile phone hardware.

3. The native application integration method based on Android modular base according to claim 1, characterized in that: Building the BaseWebView component includes the following steps: Introduce the third-party web page display control agentWeb into the project; Create a new BaseWebView class; Create a new function parameter method and interface loading method in the BaseWebView class; Among them, the function parameter method is responsible for the function parameter configuration of the front-end interface, performs function configuration for WebSettings, and is uniformly called by the interface loading method; the interface loading method encapsulates the interface loading method of the agentWeb, wherein the method parameters include Activity, LinearLayout, and String. The three parameters correspond to the Activity context, the LinearLayout front-end display container, and the front-end link respectively.

4. The native application integration method based on Android modular base according to claim 3, characterized in that: Building the BaseEventBus component includes the following steps: Introducing third-party dependencies into said project; Create a new entity class BaseEventCustom, which includes a message tag and message content; When the BaseInterface component receives a call request from the subsystem front-end interface, it passes the message body to the demand realization module; the demand realization module receives the message from the BaseInterface to realize the specific demand, and after realizing the specific demand, it passes the message to the front-end subsystem.

5. The native application integration method based on Android modular base according to claim 4, characterized in that: Building the BaseInterface component involves the following steps: Create a new BaseInterface class in the project; Define a unified call tag, agentWeb and Context in the BaseInterface class, and define a construction method at the same time. The construction method parameters are agentWeb and Context. The construction method will be called in the interface loading method of the BaseWebView component; After receiving the demand call from the subsystem front-end interface, the BaseInterface component uses the entity class BaseEventCustom to distribute the demand message to the specific implementation module.

6. Native application integration device based on Android modular base, characterized in that: include: The native code scanning function calling module is used by the front-end subsystem to call the native code scanning function through the pre-configured Android base. The Android base includes the Android modular base, which includes the BaseWebView component, the BaseEventBus component, and the BaseInterface component. The BaseWebView component is an entity class formed by extracting and encapsulating third-party web page display controls, used for front-end interface display. The BaseEventBus component is an entity class formed by introducing third-party dependencies, used for message transmission between modules of the Android modular base. The BaseInterface component is a control that defines a unified interaction method between Android native applications and front-end subsystems. The code scanning function method definition module is used to define the code scanning function method in the BaseInterface component; A code scanning result receiving method definition module, used to define a code scanning result receiving method in the front-end subsystem; A message passing module is used to pass the message of the front-end subsystem calling the code scanning function module to the code scanning function module through the BaseEventBus component in the code scanning function method; The code scanning result feedback module is used to call the code scanning function to scan the code after the code scanning function module receives the message. After the code scanning is successful, the code scanning result is sent back to the front-end subsystem through the BaseWebView component; The code scanning result receiving module is used for the front-end subsystem to perform the next operation after receiving the code scanning result.

7. The native application integration device based on the Android modular base according to claim 6, characterized in that: The Android basic base further includes: APP application layer, which includes APP common function modules and multiple front-end subsystems; Android Framework layer, which includes UI templates, mobile development framework, development tool set and database services; Android mobile phone hardware module, the Android mobile phone hardware module includes at least one mobile phone hardware.

8. The native application integration device based on the Android modular base according to claim 6, characterized in that: Building the BaseWebView component includes the following steps: Introduce the third-party web page display control agentWeb into the project; Create a new BaseWebView class; Create a new function parameter method and interface loading method in the BaseWebView class; The function parameter method is responsible for configuring the function parameters of the front-end interface, performing function configuration for WebSettings, and is uniformly called by the interface loading method; the interface loading method encapsulates the interface loading method of the agentWeb, wherein the method parameters include Activity, LinearLayout, and String, which correspond to the Activity context, LinearLayout front-end display container, and front-end link respectively; Building the BaseEventBus component includes the following steps: Introducing third-party dependencies into said project; Create a new entity class BaseEventCustom, which includes a message tag and message content; When the BaseInterface component receives a call request from the subsystem front-end interface, it passes the message body to the demand realization module; the demand realization module receives the message from the BaseInterface to realize the specific demand, and after realizing the specific demand, it passes the message to the front-end subsystem; Building the BaseInterface component involves the following steps: Create a new BaseInterface class in the project; Define a unified call tag, agentWeb and Context in the BaseInterface class, and define a construction method at the same time. The construction method parameters are agentWeb and Context. The construction method will be called in the interface loading method of the BaseWebView component; After receiving the demand call from the subsystem front-end interface, the BaseInterface component uses the entity class BaseEventCustom to distribute the demand message to the specific implementation module.

9. An electronic device, characterized in that: The electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the native application integration method based on the Android modular base as described in any one of claims 1 to 5 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the native application integration method based on the Android modular base as described in any one of claims 1 to 5 are implemented.