WebView-based mobile application program extension method and device and medium
By embedding WebView components in mobile applications and configuring API interfaces, the compatibility and maintainability issues of mobile applications on different platforms are solved, high-performance and flexible application expansion is achieved, and a rich user experience is provided. and streamlined maintenance processes.
Patent Information
- Application Number
- CN202410682298.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-13
AI Technical Summary
It is difficult to ensure the compatibility and maintainability of mobile applications on different operating systems and platforms, resulting in unstable user experience and high development complexity, making it difficult to achieve flexible expansion and high degree of customization.
By embedding WebView components into mobile applications, defining extension pages and configuring API interfaces, using JavaScript files to achieve two-way communication between WebView and mobile applications, and building operation request processing logic to implement application expansion.
It improves the cross-platform compatibility and maintainability of mobile applications, reduces development costs, provides a rich user experience and flexible development methods, and simplifies the application update and maintenance process.
Smart Images

Figure CN118642697A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of mobile application development, and in particular to a method, device and medium for expanding a mobile application based on WebView. Background Art
[0002] With the rapid development of mobile Internet and the widespread popularity of smart devices, mobile applications have penetrated into people's daily lives, providing users with convenient services and rich entertainment experiences. However, in actual applications, the functional implementation and user experience of mobile applications are often limited by factors such as hardware performance, operating system characteristics, and platform specifications. Such limitations require developers to consider many compatibility and adaptability issues when designing and developing mobile applications, which increases the complexity and difficulty of development.
[0003] More importantly, as user needs become increasingly diversified and personalized, how to achieve flexible expansion and high customization of applications on mobile devices using different operating systems and platforms has become a common focus of developers and users. This demand not only requires that applications can run stably in various environments, but also requires the ability to increase or decrease functions and adjust the interface according to the specific needs of users.
[0004] At present, there are already some mobile application extension solutions on the market, such as implementing application extension and customization through plug-in mechanisms or modular design. These solutions do provide flexibility and customizability of applications to a certain extent. However, they also have obvious shortcomings. Due to the differences between different operating systems and platforms, the compatibility of these plug-ins or modules is often difficult to guarantee, resulting in a fragmented and unstable user experience. In addition, as the number of plug-ins or modules increases, the complexity and maintenance costs of the application will also increase, placing a heavy burden on developers.
[0005] Therefore, for the expansion of mobile applications, how to improve compatibility and maintainability while ensuring high performance and flexibility has become a technical problem that needs to be solved urgently. Summary of the invention
[0006] The embodiments of the present application provide a WebView-based mobile application expansion method, device, and medium to solve the following technical problem: for the expansion of mobile applications, how to improve compatibility and maintainability while ensuring high performance and flexibility.
[0007] In the first aspect, an embodiment of the present application provides a mobile application expansion method based on WebView, characterized in that the method includes: based on development requirements, selecting a component embedding method to be applied to embed the WebView component into the mobile application to be expanded; defining the page to be expanded, and based on preset extension call configuration information, configuring the loadUrl loading method of the WebView component to enable the loadability of the page to be expanded; configuring the API interface between the mobile application to be expanded and the page to be expanded, and constructing the processing logic of each operation request in the page to be expanded in the mobile application to be expanded, so as to realize the expansion of the mobile application.
[0008] In one implementation of the present application, development requirements include: page visual display, dynamic control interaction; based on the development requirements, select the component embedding method to be applied to embed the WebView component into the mobile application to be expanded, specifically including: when the development requirement is page visual display, add the WebView component to the layout file of the mobile application to be expanded; when the development requirement is dynamic control interaction, use Java code to create the WebView component in the mobile application to be expanded.
[0009] In one implementation of the present application, after embedding the WebView component into the mobile application to be expanded, the method also includes: creating a communication JavaScript file; the communication JavaScript file is used to receive requests from the WebView component and forward the requests to the mobile application to be expanded for processing, and to receive responses from the mobile application to be expanded and return the responses to the WebView component.
[0010] In one implementation of the present application, defining a page to be extended specifically includes: designing the functions and layout of the page to be extended based on development requirements; writing the HTML, CSS and JavaScript codes of the page to be extended, and saving them as a web page file corresponding to the page to be extended.
[0011] In one implementation of the present application, after defining the page to be expanded, the method further includes: placing the page to be expanded in a preset local file path corresponding to the mobile application to be expanded; or, publishing an accessible web page URL corresponding to the page to be expanded.
[0012] In one implementation of the present application, based on the preset extension call configuration information, the loadUrl loading method of the WebView component is configured to realize the loadability of the page to be extended, specifically including: determining the loading address of the page to be extended according to the extension call configuration information; establishing a communication connection between the WebView component and the mobile application to be extended through a communication JavaScript file; when the loading address is a local file path, configuring the WebView component to load the page to be extended corresponding to the local file path through the loadUrl method; when the loading address is a network URL, configuring the WebView component to load the page to be extended corresponding to the network URL through the loadUrl method.
[0013] In one implementation of the present application, the API interface between the mobile application to be expanded and the page to be expanded is configured, specifically including: determining the functional points that the page to be expanded needs to interact with the mobile application to be expanded; for each functional point, defining the corresponding API interface, including the interface name, request parameters and response parameters; implementing the API interface in the mobile application to be expanded, so that the page to be expanded calls the functions of the mobile application to be expanded through the API interface.
[0014] In one implementation of the present application, the processing logic for each operation request in the page to be expanded is constructed in the mobile application to be expanded, specifically including: analyzing the operation request type in the page to be expanded, and writing corresponding processing logic code for each operation request type; integrating the processing logic code into the mobile application to be expanded.
[0015] In the second aspect, an embodiment of the present application also provides a mobile application expansion device based on WebView, characterized in that the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: based on development requirements, select a component embedding method to be applied to embed the WebView component into the mobile application to be expanded; define the page to be expanded, and based on preset extension call configuration information, configure the loadUrl loading method of the WebView component to enable the page to be loaded; configure the API interface between the mobile application to be expanded and the page to be expanded, and construct the processing logic of each operation request in the page to be expanded in the mobile application to be expanded, so as to realize the expansion of the mobile application.
[0016] In the third aspect, the embodiment of the present application also provides a non-volatile computer storage medium for mobile application expansion based on WebView, storing computer executable instructions, characterized in that the computer executable instructions are set to: based on development requirements, select a component embedding method to be applied to embed the WebView component into the mobile application to be expanded; define the page to be expanded, and based on preset extension call configuration information, configure the loadUrl loading method of the WebView component to enable the loadability of the page to be expanded; configure the API interface between the mobile application to be expanded and the page to be expanded, and construct the processing logic of each operation request in the page to be expanded in the mobile application to be expanded, so as to realize the expansion of the mobile application.
[0017] The embodiments of the present application provide a method, device and medium for expanding a mobile application based on WebView, which have the following beneficial effects:
[0018] 1. By embedding the WebView component, developers can easily combine Web technology with mobile applications, thereby utilizing rich Web resources and development tools to improve development efficiency. At the same time, the flexibility of WebView allows developers to choose different embedding methods according to specific needs, such as page visual display or dynamic control interaction, further improving development flexibility.
[0019] 2. The introduction of the WebView component enables mobile applications to load and display richer and more diverse page content, including dynamic web pages, interactive content, etc., thereby providing users with a more colorful and interactive user experience.
[0020] 3. As a universal web page container, WebView can provide consistent web page rendering effects on different platforms, thereby enhancing the cross-platform compatibility of mobile applications.
[0021] 4. The page content loaded by WebView can be updated independently of the application, which means that developers can quickly update or modify the content loaded by WebView without updating the entire application, thereby simplifying the maintenance and update process of the application.
[0022] 5. By configuring the API interface between the WebView component and the mobile application, this method realizes two-way communication and interaction between the mobile application and the Web page. This not only enriches the functionality of the application, but also provides a strong foundation for its future functional expansion.
[0023] 6. Since WebView can directly load and display Web content, developers can use existing Web development resources and experience to develop extension pages for mobile applications, thereby reducing development costs and learning curves. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0025] Figure 1 A flow chart of a method for extending a mobile application based on WebView provided in an embodiment of the present application;
[0026] Figure 2 A schematic diagram of the internal structure of a WebView-based mobile application expansion device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0028] The embodiments of the present application provide a WebView-based mobile application expansion method, device, and medium to solve the following technical problem: for the expansion of mobile applications, how to improve compatibility and maintainability while ensuring high performance and flexibility.
[0029] The technical solution proposed in the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0030] Figure 1 A flow chart of a method for extending a mobile application based on WebView is provided in an embodiment of the present application. Figure 1 As shown, a method for extending a mobile application based on WebView provided in an embodiment of the present application specifically includes the following steps:
[0031] Step 101: Based on development requirements, a component embedding method to be applied is selected to embed the WebView component into the mobile application to be expanded.
[0032] The first thing that needs to be explained is that the focus of development requirements is generally on page layout and visual effects or on dynamic control and interactivity. Depending on the differences, development requirements are divided into page visual display and dynamic control interaction.
[0033] In one embodiment of the present application, in order to implement the expansion of a mobile application based on WebView, firstly, based on the development requirements, a component embedding method to be applied is selected to embed the WebView component into the mobile application to be expanded.
[0034] Specifically, when the development requirement is for visual display of the page, the WebView component is added to the layout file of the mobile application to be expanded; when the development requirement is for dynamic control of interaction, the WebView component is created in the mobile application to be expanded using Java code.
[0035] In one embodiment, when the development requirements are mainly focused on the visual display of the page, a concise and direct way to integrate the WebView component into the mobile application needs to be selected. Specifically, the WebView component is directly added to the layout file of the mobile application to be extended as one of the layout elements. This step usually involves editing the XML layout file, in which the position, size and other visual attributes of the WebView component need to be defined. In this way, WebView can be seamlessly integrated into the user interface of the application, providing rich visual content and interactive experience. However, when the development requirements turn to dynamically controlled interactions, another strategy needs to be selected. In this case, Java code is used to dynamically create WebView components in the mobile application to be extended. This approach provides greater flexibility and control, allowing WebView instances to be created, configured and managed as needed at runtime. Through Java code, it is possible to precisely control the loading content of WebView, handle user interaction events, and even perform complex data exchange and communication with other parts of the native application. When implementing these two methods, the balance between performance and user experience is fully considered. For visual display requirements, the WebView component is closely integrated with other UI elements of the application to ensure visual unity and fluency. For dynamic control interaction needs, the performance of Java code is optimized to reduce resource consumption and response time, thereby improving the user experience.
[0036] Furthermore, after the WebView component is embedded in the mobile application to be expanded, a communication JavaScript file needs to be created; the communication JavaScript file is used to receive requests from the WebView component and forward the requests to the mobile application to be expanded for processing, and to receive responses from the mobile application to be expanded and return the responses to the WebView component.
[0037] In one embodiment, the communication JavaScript file plays a crucial bridging role in the entire interactive process. The communication JavaScript file can receive various requests issued by the WebView component. These requests may include but are not limited to data acquisition, function calls, or interface updates. Once these requests are received, the JavaScript file will forward these requests to the mobile application to be expanded through a predetermined interface or mechanism for corresponding processing. At the same time, the communication JavaScript file is also responsible for receiving the response of the mobile application to be expanded. When the mobile application processes the request of the WebView component, it will send the processing results or response data back to this JavaScript file. Subsequently, the JavaScript file will accurately return these responses to the WebView component, thereby completing a complete communication cycle.
[0038] Step 102: define the page to be extended, and configure the loadUrl loading method of the WebView component based on the preset extension call configuration information to enable the page to be extended to be loaded.
[0039] In one embodiment of the present application, after the WebView component is embedded in the mobile application to be expanded, the page to be expanded is defined.
[0040] Specifically, based on development requirements, design the functions and layout of the page to be extended; write the HTML, CSS, and JavaScript codes of the page to be extended, and save them as web page files corresponding to the page to be extended.
[0041] In one embodiment,
[0042] Further, after the page to be extended is defined, the page to be extended is placed in a preset local file path corresponding to the mobile application to be extended; or, an accessible webpage URL corresponding to the page to be extended is published.
[0043] In one embodiment, the page to be extended is defined. First, based on clear development requirements, the functions and layout of the page to be extended are carefully designed. This includes determining the content elements that need to be displayed on the page, such as text, pictures, buttons, etc., and planning their layout and presentation methods. At the same time, the interactive logic of the page should also be taken into account to ensure that users can operate conveniently and obtain timely feedback. Next, the code of the page to be extended is written using the three core technologies of front-end development, HTML, CSS and JavaScript. HTML is used to define the basic structure and content of the page, and CSS is responsible for the style design of the page, including the setting of visual effects such as color, font, layout, etc. JavaScript is used to implement dynamic effects and interactive functions of the page, such as responding to user click events, processing form data, etc. Finally, the written HTML, CSS and JavaScript code is saved as a complete web page file. This file will be integrated into the mobile application as the content to be loaded by the WebView component.
[0044] In one embodiment of the present application, after determining the loading path of the page to be extended, the loadUrl loading mode of the WebView component is configured based on preset extension call configuration information to enable the page to be extended to be loadable.
[0045] Specifically, according to the extension call configuration information, the loading address of the page to be expanded is determined; a communication connection is established between the WebView component and the mobile application to be expanded through a communication JavaScript file; when the loading address is a local file path, the WebView component is configured to load the page to be expanded corresponding to the local file path through the loadUrl method; when the loading address is a network URL, the WebView component is configured to load the page to be expanded corresponding to the network URL through the loadUrl method.
[0046] In one embodiment, in order to realize the loadability of the page to be extended, after determining the loading path of the page to be extended, the loadUrl loading method of the WebView component is configured in detail based on a set of preset extension call configuration information. First, the specific loading address of the page to be extended is determined according to the extension call configuration information. This address can be a path pointing to a local file or a network URL. This step is crucial to ensure that WebView can accurately load the target page. The communication connection between the WebView component and the mobile application to be extended is established through the previously created communication JavaScript file. This JavaScript file is not only responsible for processing the data transmission between WebView and the native application, but also ensures that the interaction between the two can proceed smoothly. After determining the loading address and establishing the communication connection, the loadUrl method of the WebView component is configured according to the type of the address. If the loading address is a local file path, the WebView component will be configured to directly load the page to be extended corresponding to the path through the loadUrl method. This method is suitable for pages that have been pre-downloaded to the device and can be quickly presented to the user without relying on a network connection. If the loading address is a network URL, the WebView component is configured to load the page to be extended corresponding to the URL through the loadUrl method. In this case, WebView will initiate a request to the specified server to download and render the corresponding web page content. This method is suitable for scenarios that require real-time updates or rely on external data sources.
[0047] Step 103: configure the API interface between the mobile application to be extended and the page to be extended, and construct the processing logic of each operation request in the page to be extended in the mobile application to be extended, so as to realize the extension of the mobile application.
[0048] In one embodiment of the present application, after the page to be expanded is made loadable, an API interface between the mobile application to be expanded and the page to be expanded is configured.
[0049] Specifically, determine the functional points that the page to be expanded needs to interact with the mobile application to be expanded; for each functional point, define the corresponding API interface, including interface name, request parameters and response parameters; implement the API interface in the mobile application to be expanded, so that the page to be expanded can call the functions of the mobile application to be expanded through the API interface.
[0050] In one embodiment, configuring the API interface between the mobile application to be extended and the page to be extended is a key step, which ensures smooth interaction and data sharing between the two. First, it is necessary to analyze the functional requirements of the page to be extended and determine which functional points need to interact with the mobile application to be extended. These functional points may include data acquisition, user authentication, device function call, etc. Clarifying these functional points helps to define the required API interface more accurately. For each functional point, define the corresponding API interface. This includes assigning a clear and descriptive name to the interface so that developers can easily identify its purpose. At the same time, determine the parameters of the interface request, which are the data passed to the mobile application by the page to be extended to perform the corresponding function. In addition, we also define the response parameters of the interface, that is, the data returned by the mobile application to the page to be extended after executing the function. After defining the API interface, implementing these interfaces in the mobile application to be extended usually involves writing corresponding code to handle interface requests, perform the required functions, and return response data.
[0051] Furthermore, a processing logic for each operation request in the page to be expanded in the mobile application to be expanded is constructed.
[0052] Specifically, the operation request types in the page to be expanded are analyzed, and corresponding processing logic codes are written for each operation request type; the processing logic codes are integrated into the mobile application to be expanded.
[0053] The above is an embodiment of the method proposed in this application. Based on the same inventive concept, the embodiment of this application also provides a mobile application expansion device based on WebView, whose structure is as follows Figure 2 shown.
[0054] Figure 2 A schematic diagram of the internal structure of a mobile application extension device based on WebView provided in an embodiment of the present application. Figure 2 As shown, the device includes:
[0055] at least one processor 201;
[0056] and, a memory 202 communicatively connected to the at least one processor;
[0057] The memory 202 stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor 201 to enable at least one processor 201 to:
[0058] Based on development requirements, select the component embedding method to be applied to embed the WebView component into the mobile application to be expanded;
[0059] Define the page to be extended, and based on the preset extension call configuration information, configure the loadUrl loading method of the WebView component to enable the page to be extended to be loaded;
[0060] Configure the API interface of the mobile application to be expanded and the page to be expanded, and build the processing logic of each operation request in the page to be expanded in the mobile application to be expanded, so as to realize the expansion of the mobile application.
[0061] Some embodiments of the present application provide corresponding Figure 1 A non-volatile computer storage medium based on a WebView mobile application extension stores computer executable instructions, wherein the computer executable instructions are set to:
[0062] Based on development requirements, select the component embedding method to be applied to embed the WebView component into the mobile application to be expanded;
[0063] Define the page to be extended, and based on the preset extension call configuration information, configure the loadUrl loading method of the WebView component to enable the page to be extended to be loaded;
[0064] Configure the API interface of the mobile application to be expanded and the page to be expanded, and build the processing logic of each operation request in the page to be expanded in the mobile application to be expanded, so as to realize the expansion of the mobile application.
[0065] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the IoT device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0066] The system and medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the system and medium also have similar beneficial technical effects to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the system and medium will not be repeated here.
[0067] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0068] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0069] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0070] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0071] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0072] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0073] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0074] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0075] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for extending a mobile application based on WebView, characterized in that: The method comprises: Based on development requirements, select the component embedding method to be applied to embed the WebView component into the mobile application to be expanded; Define the page to be extended, and configure the loadUrl loading mode of the WebView component based on the preset extension call configuration information to enable the page to be extended to be loaded; The API interface between the mobile application to be expanded and the page to be expanded is configured, and the processing logic of each operation request in the page to be expanded in the mobile application to be expanded is constructed to realize the expansion of the mobile application.
2. According to a WebView-based mobile application expansion method according to claim 1, it is characterized in that: The development requirements include: page visual display, dynamic control interaction; Based on development requirements, select the component embedding method to be applied to embed the WebView component into the mobile application to be expanded, including: When the development requirement is a visual display of a page, adding the WebView component to a layout file of the mobile application to be expanded; When the development requirement is dynamic control interaction, a WebView component is created in the mobile application to be expanded using Java code.
3. According to a WebView-based mobile application expansion method according to claim 1, it is characterized in that: After embedding the WebView component into the mobile application to be expanded, the method further includes: Create the communication JavaScript file; The communication JavaScript file is used to receive a request from the WebView component and forward the request to the mobile application to be expanded for processing, and is used to receive a response from the mobile application to be expanded and return the response to the WebView component.
4. According to a WebView-based mobile application expansion method according to claim 1, it is characterized in that: Defining the page to be expanded includes: Based on the development requirements, design the functions and layout of the page to be expanded; Write the HTML, CSS and JavaScript codes of the page to be extended, and save them as the web page file corresponding to the page to be extended.
5. The method for expanding a mobile application based on WebView according to claim 1, characterized in that: After defining the page to be expanded, the method further includes: Placing the page to be expanded in a preset local file path corresponding to the mobile application to be expanded; or, Publish the accessible webpage URL corresponding to the page to be expanded.
6. A method for expanding a mobile application based on WebView according to claim 3, characterized in that: Based on the preset extension call configuration information, the loadUrl loading mode of the WebView component is configured to enable the page to be extended to be loaded, specifically including: Determining the loading address of the page to be expanded according to the extended call configuration information; Establishing a communication connection between the WebView component and the mobile application to be expanded through the communication JavaScript file; When the loading address is a local file path, configure the WebView component to load the page to be expanded corresponding to the local file path through the loadUrl method; When the loading address is a network URL, the WebView component is configured to load the page to be expanded corresponding to the network URL through the loadUrl method.
7. The method for expanding a mobile application based on WebView according to claim 1, characterized in that: Configuring the API interface of the mobile application to be expanded and the page to be expanded specifically includes: Determine the function points that the page to be expanded needs to interact with the mobile application to be expanded; For each function point, define the corresponding API interface, including interface name, request parameters and response parameters; The API interface is implemented in the mobile application to be expanded, so that the page to be expanded calls the function of the mobile application to be expanded through the API interface.
8. The method for expanding a mobile application based on WebView according to claim 1, characterized in that: Constructing the processing logic of each operation request in the page to be expanded in the mobile application to be expanded, specifically including: Analyze the operation request types in the page to be expanded, and write corresponding processing logic codes for each operation request type; Integrate the processing logic code into the mobile application to be expanded.
9. A mobile application extension device based on WebView, characterized in that: The device comprises: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: Based on development requirements, select the component embedding method to be applied to embed the WebView component into the mobile application to be expanded; Define the page to be extended, and configure the loadUrl loading mode of the WebView component based on the preset extension call configuration information to enable the page to be extended to be loaded; The API interface between the mobile application to be expanded and the page to be expanded is configured, and the processing logic of each operation request in the page to be expanded in the mobile application to be expanded is constructed to realize the expansion of the mobile application.
10. A non-volatile computer storage medium for WebView-based mobile application extension, storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Based on development requirements, select the component embedding method to be applied to embed the WebView component into the mobile application to be expanded; Define the page to be extended, and configure the loadUrl loading mode of the WebView component based on the preset extension call configuration information to enable the page to be extended to be loaded; The API interface between the mobile application to be expanded and the page to be expanded is configured, and the processing logic of each operation request in the page to be expanded in the mobile application to be expanded is constructed to realize the expansion of the mobile application.
