Unlock instant, AI-driven research and patent intelligence for your innovation.

Hybrid application interface calling method, device and computer-readable storage medium

An interface call and hybrid technology, applied in the computer field, can solve problems such as poor compatibility and user experience, inability to continue to use, and inability to complete hybrid applications, so as to ensure security, improve efficiency, and ensure normal use.

Active Publication Date: 2022-01-28
PING AN TECH (SHENZHEN) CO LTD
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] During the use of hybrid applications, native code and JavaScript (a literal scripting language) code call each other and pass parameters, and can call back data, but the following problems exist in the process of mutual calling between native and JavaScript: in hybrid applications During the development process, the native code and JavaScript code are usually developed separately. When a new function needs to be added to the hybrid application, it is necessary to add a calling method corresponding to the new function in the JavaScript code, and at the same time update the native code. The update enables the native code to add an API (Application Programming Interface) corresponding to the new function; the new version of the hot-updated JavaScript code is directly released online, so the updated JavaScript code can be used directly, but the native The updated version of the code can only be used after the user updates the hybrid application, but in actual use, the user usually does not update the hybrid application in time, and will not obtain the new version of the native code in time, then when the new When the version of JavaScript executes the newly added calling method to call the native, because the native code of the old version does not include the corresponding API, the new calling method in JavaScript cannot complete the call, and the hybrid application cannot complete the corresponding function startup , or even can not continue to use, poor compatibility and user experience

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Hybrid application interface calling method, device and computer-readable storage medium
  • Hybrid application interface calling method, device and computer-readable storage medium
  • Hybrid application interface calling method, device and computer-readable storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0030] Please refer to figure 1 , shows the specific steps of the method for invoking the interface of the hybrid application, the hybrid application includes both native and JavaScript script files, and the native and JavaScript script files call each other to realize the functions of the entire hybrid application. Among them, the native is developed based on the development tools and languages ​​supported by the hardware platform, which is installed on a computer device based on this type of hardware platform and can call the hardware functions of the computer device (such as speakers, acceleration sensors and cameras, etc.), for example, native It can be developed based on Xcode or Objective-c supported by the IOS platform and installed on a computer device based on the IOS platform, or natively developed based on Eclipse or Java supported by the Android platform and installed on a computer device based on the Android platform. JavaScript script files are developed based on...

Embodiment 2

[0038] Please refer to figure 2 , which shows the specific steps when the hybrid application is allowed to call the target API during the interface call process, that is, the steps of the specific implementation method of step 140 in the first embodiment above, including:

[0039] Step 141, if the target API is included in the native API, it means that the current JavaScript script file matches the current native version, and this call can be completed, then execute the call to the target API through the current JavaScript script file, and generate the corresponding Callback ID. The callback ID is used to identify the callback function of this call. The generation method is usually: Obtain the call trigger parameters through the current JavaScript script file. The call trigger parameters are the parameters of the call trigger operation. The call trigger parameters include but Not limited to receiving the timestamp information of the call trigger operation, the number of times...

Embodiment 3

[0048] Please refer to image 3 , shows a hybrid application interface call device 300, the device is divided into one or more program modules, each program module can be further divided into one or more program sub-modules and program units, the one or more program modules A plurality of program modules are stored in a storage medium and executed by one or more processors to implement the present invention. The program module, program sub-module and program unit in the present invention refer to a series of computer program instruction segments capable of completing specific functions, which are more suitable than the program itself to describe the execution process of the interface calling device in the storage medium. The following description will introduce in detail Functions such as each module, submodule and unit of the present embodiment:

[0049] A version determination module 310, configured to determine the version number of the hybrid application when the hybrid a...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

A method for invoking an interface of a hybrid application, comprising the following steps: when a trigger operation for calling a target API through a current JavaScript script file is received through the hybrid application, determining a version number of the hybrid application, and according to the version number and the current JavaScript The script file determines whether the target API is included in the native API defined in the hybrid application, thereby prohibiting or allowing the target API to be called; the present invention realizes the version control of the pseudo-protocol for JavaScript and native interaction, and hot update is performed in JavaScript but the application In the case that the current JavaScript script file does not match the native one due to not being upgraded, if it is detected that the call cannot be completed under the current version, when responding to the above trigger operation through the current JavaScript script file, it is forbidden to call the target API and skip this directly. This call ensures the normal use of the main function of the hybrid application.

Description

technical field [0001] The present invention relates to the field of computers, in particular to a hybrid application interface calling method, device and computer-readable storage medium. Background technique [0002] Hybrid App (Hybrid App) is an application between Web App (Web App) and Native App (Native App), which means that some functions in the native (Native) code of the application use dynamic web pages (HTML5+JavaScript) To achieve this, it has both the good user interaction experience of native applications and the advantages of cross-platform development of web applications. [0003] During the use of hybrid applications, native code and JavaScript (a literal scripting language) code call each other and pass parameters, and can call back data, but the following problems exist in the process of mutual calling between native and JavaScript: in hybrid applications During the development process, the native code and JavaScript code are usually developed separately....

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/60
CPCG06F8/60
Inventor 邹国忠
Owner PING AN TECH (SHENZHEN) CO LTD