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

Android system HTML5 resource local caching method

A local cache and resource technology, applied in the computer field, can solve the problems of not being able to effectively control the effectiveness of resource cache, prolong the display time of the application interface, occupy memory, etc., and achieve the effect of improving user experience, saving mobile phone traffic, and improving response speed

Inactive Publication Date: 2019-08-23
上海有谱网络科技有限公司
View PDF4 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

But HTML5 itself is a web development technology. Various web resources, such as JS files, image files or CSS files, will be downloaded from the server to the local when they are used. The download of these resources will greatly extend the display of the application interface. time, the user cannot perform any processing until the resource download is complete
If you use the mobile phone's own caching mechanism, although it can reduce frequent network operations, reduce traffic, and improve performance, it will take up a lot of memory. Once the mobile phone kills the process, all caches in the memory will be lost, and resources cannot be effectively controlled. cache availability

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

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0015] Example 1: Assume that the server has an HTML5 page, and there is an image resource in the page, and the url is , the md5 digest of the url is e38ae4f3127f283a990a802bf4272232.

[0016] When WebView loads the page for the first time, WebView intercepts the intention to load image resources, and will first determine that the resource file e38ae4f3127f283a990a802bf4272232.png does not exist locally on the phone, and then load the page in the usual way, and at the same time, it will be loaded in the onLoadResource() method Download the resource file to the specified local directory of the mobile phone.

[0017] When WebView loads the page again, WebView intercepts the intention to load the image resource, and will first determine that the resource file e38ae4f3127f283a990a802bf4272232.png already exists locally on the mobile phone, and will not load the image resource from the server, but directly load it locally from the mobile phone This image resource "replaces" serve...

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

The invention relates to the technical field of computers, in particular to an Android system HTML5 resource local caching method. The method is characterized by comprising the following steps of: when an H5 page is loaded by adopting WebView in an application, monitoring a resource file with a specified suffix name through a shouldInterceptRequest () method in a WebViewClient class; taking the md5 abstract of the file url as a file name, trying to use a homonymous file of a local specified path for replacement, if the local file does not exist, downloading the resource file to a local specified directory in an onLoadResponce () method, and renaming the resource file by taking the md5 abstract as the file name; and when the server resource is updated, loading a resource file by adding a version number behind the server file name, and generating different m5d abstracts for the same file of different versions by the version number changing along with the product version. By adopting themethod, the WEB resources can be effectively cached, the WEB resources do not need to be repeatedly downloaded, the response speed of the APP is greatly increased, and the user experience is improved.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a method for locally caching HTML5 resources in an Android system. Background technique [0002] The advent of the mobile Internet era has subverted the development model of traditional enterprises, followed by the explosive growth of APP on these mobile devices, and people's consumption habits are gradually shifting to the mobile terminal. At present, the overall implementation process of the APP is that the user's request is transmitted from the App interface to the network, the application service to the database, and then returns to the interface to present the content. [0003] The rapid expansion of APP business has also put forward higher requirements for the APP development model. The traditional method of using native code to develop APP applications needs to be deployed for each change, and the update of the entire software will be subject to client software updates. ...

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 Applications(China)
IPC IPC(8): G06F16/957
CPCG06F16/9574
Inventor 王航赵俊辉
Owner 上海有谱网络科技有限公司