CN113778566A - Native application calling method and device, electronic equipment and computer readable medium - Google Patents

Native application calling method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN113778566A
CN113778566A CN202110128695.1A CN202110128695A CN113778566A CN 113778566 A CN113778566 A CN 113778566A CN 202110128695 A CN202110128695 A CN 202110128695A CN 113778566 A CN113778566 A CN 113778566A
Authority
CN
China
Prior art keywords
class
operating system
calling
target
native application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110128695.1A
Other languages
Chinese (zh)
Inventor
刘川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202110128695.1A priority Critical patent/CN113778566A/en
Publication of CN113778566A publication Critical patent/CN113778566A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the disclosure discloses a native application calling method, a native application calling device, an electronic device and a computer readable medium. One embodiment of the method comprises: responding to initialization of a webpage view which runs in a first class operating system and is used for displaying a webpage, and injecting a preset script into the webpage view to generate a target management class object, wherein the target management class object is used for being combined with a method name to call a corresponding method; in response to receiving a first calling request containing a target management class object and a target method name, calling a native application running in a first class of operating systems through a calling method corresponding to the first class of operating systems, wherein the target method name is used as an incoming parameter of the calling method. According to the method and the system, the native application is called based on the management class object and the method name on the first class operating system which does not support the calling mode of the management class object plus the method name originally.

Description

Native application calling method and device, electronic equipment and computer readable medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a method and a device for calling a native application, an electronic device and a computer-readable medium.
Background
In most cases, native applications need to be called on web pages displayed by terminals such as smart phones. Typically, the operating system provides call methods by which the web page can implement calls to the native application.
However, when the above-described manner is adopted for the native application, there are often the following technical problems:
the operating systems hosted by different terminals may be different, and the calling methods provided by different operating systems are different. When the native application needs to be called, the terminal needs to determine which operating system is currently running, so that the native application is called by using a corresponding calling method. Therefore, the development complexity is increased.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. Some embodiments of the present disclosure propose a native application invocation method, apparatus, electronic device and computer readable medium to address one or more of the technical problems noted in the background section above.
In a first aspect, some embodiments of the present disclosure provide a native application invocation method, the method comprising: responding to initialization of a webpage view which runs in a first class operating system and is used for displaying a webpage, and injecting a preset script into the webpage view to generate a target management class object, wherein the target management class object supports a method name to be combined to call a corresponding method, and the method name is matched with a method name used for calling the corresponding method in a second class operating system; in response to receiving a first calling request containing a target management class object and a target method name, calling a native application running in a first class of operating systems through a calling method corresponding to the first class of operating systems, wherein the target method name is used as an incoming parameter of the calling method.
In a second aspect, some embodiments of the present disclosure provide a native application invocation apparatus, the apparatus comprising: the management class generation unit is configured to respond to the initialization of a webpage view running in a first class operating system and used for displaying a webpage, and inject a preset script into the webpage view to generate a target management class object, wherein the target management class object supports a method name to be combined to call a corresponding method, and the method name is matched with the method name used for calling the corresponding method in a second class operating system; and the native application calling unit is configured to respond to a received first calling request containing the target management class object and the target method name, and call the native application running in the first class operating system through a calling method corresponding to the first class operating system, wherein the target method name is used as an incoming parameter of the calling method.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following advantages: the method realizes calling the native application based on the management class object and the method name on the first class operating system which does not support the calling mode of the management class object plus the method name originally. In practice, this calling mode is also supported by the second class of operating systems themselves. Therefore, the calling modes of the first-class operating system and the second-class operating system can be unified, and the currently running operating system does not need to be judged, so that the development complexity is reduced.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
FIG. 1 illustrates an exemplary flow diagram of a related native application invocation method;
FIG. 2 is a schematic diagram of one application scenario of a native application invocation method, in accordance with some embodiments of the present disclosure;
FIG. 3 is a flow diagram of some embodiments of a native application invocation method in accordance with the present disclosure;
FIG. 4 is a flow diagram of further embodiments of a native application invocation method according to the present disclosure;
FIG. 5 is a schematic block diagram of some embodiments of a native application invocation device according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
To better illustrate the present disclosure, the relevant native application invocation is first described. FIG. 1 illustrates an exemplary flow diagram of a related native application invocation method.
As shown in fig. 1, before calling a native application, the web page view 101 needs to determine whether the currently running operating system is an operating system of a first category or an operating system of a second category. For example, the first class of operating system may be an iOS operating system and the second class of operating system may be an Android operating system. Other operating systems may be used as desired. On the basis, if the native application is the first-class operating system, the native application is called by adopting a calling mode 102 provided by the first-class operating system. By way of example, the iOS operating system provides the following calling methods: window. webkit. messagehandles. < functionName >. postmessage (params) >. If the second type operating system is adopted, the native application is called by adopting a calling mode 103 provided by the second type operating system. As an example, the Android operating system provides the following calling methods: < objectname.funtionancame () >. That is, in the development stage of the application, the technician needs to consider the difference of the operating systems used by different platforms, which increases the development complexity of the application.
To solve the technical problems in the related native application calling manner described above, the present disclosure will be described in detail with reference to the accompanying drawings in conjunction with embodiments.
FIG. 2 is a schematic diagram of one application scenario of a native application invocation method of some embodiments of the present disclosure.
In the application scenario of fig. 2, whether native application 202 of the first type of operating system or native application 203 of the second type of operating system, web page view 201 may be invoked by managing class objects in conjunction with method names. Among other reasons, the reason why it is possible to call the native application 202 of the first class operating system by combining the management class object with the method name is that: script injection is performed when the first type of operating system exposes the web page.
It should be noted that, in practice, the native application 202 of the first type of operating system and the native application 203 of the second type of operating system may be run on two different devices, or may be run on the same device, for comparison, the disclosure is not limited thereto.
With continued reference to fig. 3, a flow 300 of some embodiments of a native application invocation method in accordance with the present disclosure is illustrated. The native application calling method comprises the following steps:
step 301, in response to initialization of a web page view for displaying a web page running in the first class operating system, injecting a preset script into the web page view to generate a target management class object, where the target management class object is used for calling a corresponding method in combination with a method name.
In some embodiments, the first class operating system is generally not supported for such calling of management class objects plus method names. For example, the first class operating system may be an iOS operating system. In practice, the call mode provided by the iOS operating system is: window. webkit. messagehandles. < functionName >. postmessage (params) >. Wherein, the funtionanName is the name of the method to be called. In practice, the operating system provides some users with a web page view of the exposed web page. For example, the iOS operating system provides wkbwebview, a control for exposing web pages.
In some embodiments, an execution subject (e.g., a terminal device) of the native application invocation method may inject a preset script into the webpage view in response to the initialization of the webpage view for exposing the webpage running the first class operating system. The preset script may be pre-included in the sdk (software Development kit) of the application. The preset script can be used for creating the management class object after the webpage view is injected. After the preset script is injected into the webpage view, the script can generate a target management object when running.
The target management class object may be obtained by initializing a target management class, which is predefined in a preset script, as an example. For example, the target management class object may be JDBridge, and the target management class (JDBridge class) is defined by:
Figure BDA0002924337210000051
the management class can be initialized in the following way, and a management class object JDbridge is obtained:
var JDbridge=new JDBridgeClass();
on the basis, the corresponding method can be called in a mode of adding the method name to the management class object. Jdbridge. camera () can be used to call a camera, for example.
Step 302, in response to receiving a first call request including a target management class object and a target method name, calling a native application running in a first class operating system through a call method corresponding to the first class operating system, wherein the target method name is used as an incoming parameter of the call method.
In some embodiments, on the basis of step 301, in response to receiving a first call request including a target management class object and a target method name, the execution subject may call a Native application (Native APP) running on a first class operating system through a call method corresponding to the first class operating system. In practice, the native application may be a third-party application written using a native program and running based on a local operating system of a terminal device such as a smartphone. Corresponding to native applications, there is also a Web application (Web App) that runs based on a browser. The web page described in this disclosure is a page in a web application.
For example, in response to receiving a call request: jdbridge. callcamera (), because the management class definition already described in step 301 exists, at this time, window. webkit. message handlers [ callcamera ]. postMessage (), that is, the calling method corresponding to the first class operating system, is substantially called, so as to implement calling the native application.
In some embodiments described above, invoking native applications based on management class objects and method names is implemented on a first class operating system that does not otherwise support the invocation of management class objects plus method names. In practice, this calling mode is also supported by the second class of operating systems themselves. Therefore, the calling modes of the first-class operating system and the second-class operating system can be unified, and the currently running operating system does not need to be judged, so that the development complexity is reduced.
With further reference to FIG. 4, a flow 400 of further embodiments of a native application invocation method is illustrated. The flow 400 of the native application calling method includes the following steps:
step 401, in response to initialization of a web page view for displaying a web page running in a first class operating system, injecting a preset script into the web page view to generate a target management class object, where the target management class object is used for calling a corresponding method in combination with a method name.
Step 402, in response to receiving a first call request including a target management class object and a target method name, calling a native application running in a first class operating system through a call method corresponding to the first class operating system, wherein the target method name is used as an incoming parameter of a bridge call method.
In some embodiments, the method name may match a method name used to invoke a corresponding method in the second class of operating systems. For example, the first class operating system and the second class operating system may agree in advance to have the method names used to invoke the camera unified as: a callcamera. Therefore, the first operating system and the second operating system can be called by the same method name, the universality of the application calling method on different operating systems is further increased, and the development complexity is further reduced.
In some embodiments, specific implementations of the remaining features of steps 401-402 and technical effects thereof may refer to those embodiments corresponding to fig. 3, and are not described herein again.
And step 403, in response to a second call request sent by the webpage view running on the second category operating system, calling the native application running on the second category operating system through the mapping class object and the method name included in the second call request.
In some embodiments, the calling method corresponding to the second category of operating system includes a class and a method name. That is, the second class operating system may be an operating system that itself supports calls by way of class objects plus method names. For example, the Android operating system.
On the basis, responding to a second calling request sent by the webpage view running on the second category operating system. The native application running on the second class operating system is invoked by the mapping class object and the method name included in the second invocation request, wherein the mapping class object may be predefined.
Optionally, the mapping class object may be defined by the following steps: first, a target mapping class is defined that applies to the second class of operating systems. Then, a method to be called is created in the target mapping class, and a mapping class object is obtained. For example, for an Android operating system, object mapping may be performed through addjavascript interface () of WebView, and an Android class in mapping relation with a Javascript object is defined: AndroidtoJs. Then, creating a method which needs to be called by Javascript in the class, and annotating by @ Javascript interface. Therefore, Javascript can be called by adding the method name to the class android Js. Due to the object mapping, calling the Android objects is equal to calling the Android mapped objects.
As can be seen from fig. 4, the flow 400 of the native application invocation method in some embodiments corresponding to fig. 4 adds a step of invoking the native application on the second type of operating system, compared to the description of some embodiments corresponding to fig. 3. Thus, the solutions described in these embodiments may be applicable to the second class of operating systems. In addition, because the method names used for calling the corresponding methods in the first class of operating systems and the second class of operating systems are matched, the universality of the application calling method on different operating systems is increased, and the development complexity is further reduced.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a native application invocation apparatus, which correspond to those of the method embodiments shown in fig. 3, and which may be applied in various electronic devices in particular.
As shown in fig. 5, the native application invocation device 500 of some embodiments includes: a management class generation unit 501 and a native application calling unit 502. The management class generating unit 501 is configured to, in response to initialization of a web page view for displaying a web page running in the first class operating system, inject a preset script into the web page view to generate a target management class object, where the target management class object supports calling a corresponding method in combination with a method name. The native application calling unit 502 is configured to, in response to receiving a first call request including a target management class object and a target method name, call a native application running on a first class operating system through a calling method corresponding to the first class operating system, wherein the target method name is an incoming parameter of the calling method.
In an optional implementation of some embodiments, the management class generation unit 501 is further configured to: and responding to the initialization of the webpage view running in the first class operating system and used for displaying the webpage, and injecting a preset script into the webpage view so as to initialize the target management class defined in the preset script and obtain a target management class object.
In an alternative implementation of some embodiments, the method name matches a method name used in the second class of operating systems to invoke the corresponding method.
In an optional implementation manner of some embodiments, the calling method corresponding to the second class operating system includes mapping a class object and a method name; the native application invocation unit 502 may be further configured to: and in response to a second calling request sent by the webpage view running on the second category operating system, calling the native application running on the second category operating system by using the mapping class object and the method name included in the second calling request, wherein the mapping class object is predefined.
In an alternative implementation of some embodiments, the mapping class object is defined by: defining a target mapping class applied to a second class of operating systems; and creating a method to be called in the target mapping class to obtain a mapping class object.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 3. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
Referring now to fig. 6, shown is a schematic diagram of an electronic device 600 suitable for use in implementing some embodiments of the present disclosure. The electronic device in some embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: responding to initialization of a webpage view which runs in a first class operating system and is used for displaying a webpage, and injecting a preset script into the webpage view to generate a target management class object, wherein the target management class object is used for being combined with a method name to call a corresponding method; in response to receiving a first calling request containing a target management class object and a target method name, calling a native application running in a first class of operating systems through a calling method corresponding to the first class of operating systems, wherein the target method name is used as an incoming parameter of the calling method.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a management class generation unit and a native application invocation unit. Where the names of these units do not in some cases constitute a limitation on the units themselves, for example, the management class generation unit may also be described as a "unit that generates a target management class object".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A native application invocation method, comprising:
responding to webpage view initialization running in a first class operating system and used for displaying a webpage, and injecting a preset script into the webpage view to generate a target management class object, wherein the target management class object is used for being combined with a method name to call a corresponding method;
in response to receiving a first calling request containing the target management class object and a target method name, calling a native application running on the first class operating system through a calling method corresponding to the first class operating system, wherein the target method name is used as an incoming parameter of the calling method.
2. The method of claim 1, wherein the injecting a preset script into the webpage view to generate the target management class object in response to the webpage view initialization for exposing the webpage running on the first class operating system comprises:
responding to the initialization of a webpage view which runs in a first-class operating system and is used for displaying a webpage, and injecting a preset script into the webpage view so as to initialize a target management class defined in the preset script and obtain the target management class object.
3. The method of claim 1, wherein the method name matches a method name used in a second class of operating systems to invoke a corresponding method.
4. The method of claim 1, wherein the calling method corresponding to the second class of operating system comprises mapping a class object and a method name; and
the method further comprises the following steps:
in response to a second call request sent by the webpage view running on the second category operating system, calling a native application running on the second category operating system through a mapping class object and a method name included in the second call request, wherein the mapping class object is predefined.
5. The method of claim 4, wherein the mapping class object is defined by:
defining a target mapping class for application to the second class of operating systems;
and creating a method to be called in the target mapping class to obtain the mapping class object.
6. A native application invocation apparatus, comprising:
the management class generation unit is configured to respond to webpage view initialization running in a first class operating system and used for displaying a webpage, and inject a preset script into the webpage view so as to generate a target management class object, wherein the target management class object supports a method name to be combined to call a corresponding method;
and the native application calling unit is configured to respond to a received first calling request containing the target management class object and a target method name, and call a native application running on the first class operating system through a calling method corresponding to the first class operating system, wherein the target method name is used as an incoming parameter of the calling method.
7. The apparatus of claim 6, wherein the management class generation unit is further configured to:
and responding to the initialization of the webpage view running in the first class operating system and used for displaying the webpage, and injecting a preset script into the webpage view so as to initialize the target management class defined in the preset script and obtain a target management class object.
8. The apparatus of claim 6, wherein the method name matches a method name used to invoke a corresponding method in the second class of operating systems.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
10. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-5.
CN202110128695.1A 2021-01-29 2021-01-29 Native application calling method and device, electronic equipment and computer readable medium Pending CN113778566A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110128695.1A CN113778566A (en) 2021-01-29 2021-01-29 Native application calling method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110128695.1A CN113778566A (en) 2021-01-29 2021-01-29 Native application calling method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN113778566A true CN113778566A (en) 2021-12-10

Family

ID=78835464

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110128695.1A Pending CN113778566A (en) 2021-01-29 2021-01-29 Native application calling method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN113778566A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115017436A (en) * 2022-08-05 2022-09-06 太平金融科技服务(上海)有限公司深圳分公司 Data interaction method and device of application program, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461575A (en) * 2014-12-26 2015-03-25 北京华电万通科技有限公司 Device and method for JavaScript native interface calling conducted by crossing mobile operating system platform
CN109743359A (en) * 2018-12-13 2019-05-10 平安普惠企业管理有限公司 Hybrid Communication processing method, apparatus, computer equipment and storage medium
CN111722935A (en) * 2019-03-20 2020-09-29 阿里巴巴集团控股有限公司 Communication method and device of page end and native end, electronic equipment and readable medium
CN112015384A (en) * 2019-05-29 2020-12-01 北京京东尚科信息技术有限公司 Interface mapping method and device
CN112100561A (en) * 2020-11-03 2020-12-18 南京研利科技有限公司 Method, electronic device and storage medium for calling local function by webpage

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461575A (en) * 2014-12-26 2015-03-25 北京华电万通科技有限公司 Device and method for JavaScript native interface calling conducted by crossing mobile operating system platform
CN109743359A (en) * 2018-12-13 2019-05-10 平安普惠企业管理有限公司 Hybrid Communication processing method, apparatus, computer equipment and storage medium
CN111722935A (en) * 2019-03-20 2020-09-29 阿里巴巴集团控股有限公司 Communication method and device of page end and native end, electronic equipment and readable medium
CN112015384A (en) * 2019-05-29 2020-12-01 北京京东尚科信息技术有限公司 Interface mapping method and device
CN112100561A (en) * 2020-11-03 2020-12-18 南京研利科技有限公司 Method, electronic device and storage medium for calling local function by webpage

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
PEIHP_: "混合开发:android原生webview与H5, js的交互", pages 1 - 11, Retrieved from the Internet <URL:https://blog.csdn.net/P876643136/article/details/88738477> *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115017436A (en) * 2022-08-05 2022-09-06 太平金融科技服务(上海)有限公司深圳分公司 Data interaction method and device of application program, computer equipment and storage medium
CN115017436B (en) * 2022-08-05 2023-01-10 太平金融科技服务(上海)有限公司深圳分公司 Data interaction method and device of application program, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111580879A (en) Applet running method and device, electronic equipment and computer storage medium
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN111581555B (en) Document loading method, device, equipment and storage medium
CN110098998B (en) Method and apparatus for processing information
CN111930534A (en) Data calling method and device and electronic equipment
CN111459364B (en) Icon updating method and device and electronic equipment
CN111324376B (en) Function configuration method, device, electronic equipment and computer readable medium
CN111400068B (en) Interface control method and device, readable medium and electronic equipment
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN110377273B (en) Data processing method, device, medium and electronic equipment
CN115470432A (en) Page rendering method and device, electronic equipment and computer readable medium
CN113391860B (en) Service request processing method and device, electronic equipment and computer storage medium
CN112800363A (en) Page display method and device, electronic equipment and computer readable medium
CN110619101B (en) Method and apparatus for processing information
CN113778566A (en) Native application calling method and device, electronic equipment and computer readable medium
CN111752644A (en) Interface simulation method, device, equipment and storage medium
CN110618811A (en) Information presentation method and device
CN113835790B (en) Paging page display method and device based on Android
CN109669679B (en) Service detection and processing method and device and electronic equipment
CN113518183A (en) Camera calling method and device and electronic equipment
CN113709171A (en) Method and device for cross-component state communication
CN114428925A (en) Page rendering method and device, electronic equipment and computer readable medium
CN113296771A (en) Page display method, device, equipment and computer readable medium
CN111290812A (en) Application control display method and device, terminal and storage medium
CN111258786A (en) Decoupling method and device in layered architecture, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination