Native object calling method for JS, and storage medium
A native and object technology, applied in the field of application development, it can solve problems such as poor user experience and interface freezes, shortening the interface request time, optimizing user experience, and solving interface freezes.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Example Embodiment
[0064] Example one
[0065] Please refer to Figure 2-Figure 11 This embodiment provides a method for calling native objects based on the JS of the React-Native framework. This embodiment is extended on the basis of the native module pool corresponding to the native module created on the JS layer of the prior art, which can realize the calling of the instance through the JS layer, can directly operate on the native instance, and then realize the in the instance pool The multiple native instances of NAS perform parallel operations, that is, multiple interfaces are operated in parallel, thereby shortening the time of data request, solving the interface stuck problem, and optimizing the user experience.
[0066] The method of this embodiment may include:
[0067] 1. Preliminary preparation stage:
[0068] Create a native class pool, a native instance pool, and a native intermediary module in the native layer, and map them to the JS layer to obtain a corresponding JS class pool, a JS in...
Example Embodiment
[0123] Example two
[0124] This embodiment corresponds to the first embodiment and provides a computer-readable storage medium on which a computer program is stored. The program can implement the JS call based on the React-Native framework described in the first embodiment when the program is executed by a processor. All the steps involved in the method of the native object. For specific steps, please refer to the record in the first embodiment, which will not be repeated here.
Example Embodiment
[0125] Example three
[0126] This embodiment corresponds to Embodiment 1 and Embodiment 2, and provides a specific application scenario:
[0127] Suppose the requirement is to implement a page that contains a carousel diagram and a list of movies.
[0128] The data of the carousel picture and the data of the movie list are obtained through different network requests. The parameters are shown in the following table:
[0129]
[0130] Table I
[0131] We can do it through the following steps:
[0132] 1. Customize a network module to implement injection interface and create interface.
[0133] 2. After the App is started, the network module will be saved in the native class pool; at the same time, when the page is created, a corresponding class will also be generated in the JS class pool.
[0134] 3. In the JS code, we can find the class corresponding to the network module in the JS class pool; then create two JS objects, namely JS instances; one is passed in the parameter initialization of...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap