CN113301434A - H5 page display method in application program and terminal - Google Patents

H5 page display method in application program and terminal Download PDF

Info

Publication number
CN113301434A
CN113301434A CN202110608197.7A CN202110608197A CN113301434A CN 113301434 A CN113301434 A CN 113301434A CN 202110608197 A CN202110608197 A CN 202110608197A CN 113301434 A CN113301434 A CN 113301434A
Authority
CN
China
Prior art keywords
page
application program
webpage
control object
terminal
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
CN202110608197.7A
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.)
Guangdong Huanwang Technology Co Ltd
Original Assignee
Guangdong Huanwang 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 Guangdong Huanwang Technology Co Ltd filed Critical Guangdong Huanwang Technology Co Ltd
Priority to CN202110608197.7A priority Critical patent/CN113301434A/en
Publication of CN113301434A publication Critical patent/CN113301434A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4782Web browsing, e.g. WebTV

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application relates to a display method and a terminal for an H5 page in an application program, wherein the display method for the H5 page in the application program comprises the steps of creating a page control object when the application program is started, initializing the page control object, and loading an address of a webpage by using the initialized page control object so as to display the webpage. The method and the device can accelerate the display speed of the H5 webpage, reduce the waiting time for page loading and improve the user experience.

Description

H5 page display method in application program and terminal
Technical Field
The application belongs to the technical field of computers, and particularly relates to a method and a terminal for displaying an H5 page in an application program.
Background
With the development of the internet, web pages are browsed on a terminal more and more frequently, and the display of the web pages is directly related to the browsing experience of a user. The H5 page refers to a page using HTML5 standard, APP (Application): the method has a visual user interface, a user can log in the APP by using the terminal, when browsing H5 pages in the APP, more and more webpages are used, but in some terminal models with lower configuration, the webpage loading time is longer, the blank waiting time is longer, and the user experience is influenced.
Disclosure of Invention
In order to overcome the problems that web pages are used more and more when H5 pages are browsed in APP to at least a certain extent, but in some terminal models with lower configuration, the blank waiting time is longer and the user experience is influenced due to longer web page loading time, the application provides a method and a terminal for displaying H5 pages in an application program.
In a first aspect, the present application provides a method for displaying an H5 page in an application program, including:
when an application program is started, a page control object is created;
initializing the page control object;
and loading the address of the webpage by using the initialized page control object to display the webpage.
Further, the creating a page control object includes:
the page control object is created through the singleton schema.
Further, the creating page control is: a Webview object.
Further, the method also comprises the following steps:
and saving the Webview object in an oncreate method.
Further, after initializing the page control object, the method further includes:
and setting the Webview object attribute in the thread to display the webpage according to the Webview object attribute.
Further, when the webpage is displayed and quits, the method further comprises the following steps:
and clearing the cache information of the webpage.
Further, the method also comprises the following steps:
and when the application program exits, destroying the page control object.
In a second aspect, the present application provides a terminal, comprising:
a processor and a memory;
the memory is used for storing application programs and computer programs;
the processor is configured to execute a computer program stored in the memory to implement the H5 page display method in the application program according to any one of the first aspect.
Further, the terminal is an intelligent television.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
according to the H5 page display method and the terminal in the application program, the page control object is created when the application program is started, the page control object is initialized, the initialized page control object is used for loading the address of the webpage to display the webpage, the H5 webpage display speed is increased, the page loading waiting time is reduced, and the user experience is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a flowchart of a method for displaying an H5 page in an application according to an embodiment of the present application.
Fig. 2 is a flowchart of a method for displaying an H5 page in an application according to another embodiment of the present application.
Fig. 3 is a functional block diagram of a terminal according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail below. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart of a method for displaying an H5 page in an application program according to an embodiment of the present application, and as shown in fig. 1, the method for displaying an H5 page in the application program includes:
s11: when an application program is started, a page control object is created;
s12: initializing a page control object;
s13: and loading the address of the webpage by using the initialized page control object to display the webpage.
Since many pages in the APP are realized through the web page of H5, the APP is only responsible for loading the web page, but rendering the web page is time-consuming when loading the H5 page due to slow network speed or poor device performance. The control for loading the webpage is Webview in an Android system, and the main time for loading the webpage is concentrated on initialization of the Webview, so that in the embodiment, when the application program is started, the webpage control object is created, and when the webpage needs to be displayed, the initialized Webview object is directly obtained, so that the webpage loading speed can be increased, and the waiting time can be saved.
In this embodiment, when the application program is started, the page control object is created, the page control object is initialized, and the initialized page control object is used to load the address of the web page to display the web page, so that the H5 web page display speed is increased, the page loading waiting time is reduced, and the user experience is improved.
Fig. 2 is a flowchart of a method for displaying an H5 page in an application program according to an embodiment of the present application, and as shown in fig. 2, the method for displaying an H5 page in the application program includes:
s21: when an application program is started, a Webview object is created through a singleton mode;
the loading of the H5 page in the application program can be realized through the Webview object in the Android platform.
The Webview object is created through the singleton mode, and the memory can be saved.
S22: saving the Webview object in an oncreate method;
the oncreate method is called by the system when the application starts, and is the beginning of the life cycle of an object activity.
S23: initializing a Webview object;
the Webview object is initialized before the page is loaded, so that the time consumption for loading and rendering the page is avoided to be too long, and the user experience is improved.
S24: and setting the Webview object attribute in the thread to display the webpage according to the Webview object attribute.
The traditional setting of the Webview object attribute is carried out during initialization of the Webview object, which results in overlong page rendering time.
In the embodiment, the Webview object attribute is set in the thread, so that time consumption in page loading and rendering can be reduced, and user experience is further improved.
S25: loading the address of the webpage by using the Webview object with the set attributes to display the webpage;
s26: when the webpage is displayed and quits, cache information of the webpage is cleared;
by timely purging the web page cache information, other H5 page presentations may not be affected.
It should be noted that, clearing the webpage cache information may be completed by using an existing method in the Android platform, which is not limited in the present application.
S27: and destroying the Webview object when the application program exits.
When the APP is started, a global Webview object is initialized, the life cycle of the Webview object is the survival cycle of the whole APP, and when the application program exits, the Webview object is destroyed, so that system resources can be saved, and the page loading speed can be increased.
In the embodiment, when a certain page in the APP is displayed by using the H5 page, the Webview object with the set attributes is directly used for webpage loading, so that the waiting time is greatly shortened, and the user experience is improved.
An embodiment of the present invention provides a terminal, and as shown in a functional structure diagram in fig. 3, the terminal includes:
a processor 31 and a memory 32;
the memory 32 is used for storing application programs and computer programs;
the processor 31 is configured to execute a computer program stored in the memory to implement the H5 page display method in the application program as described in any one of the above embodiments.
In some embodiments, the terminal is a smart television. Due to poor performance of the traditional smart television device, the problem that the loading time is too long when the H5 page is loaded occurs, and the user experience is affected.
It should be noted that the terminal in the present application is not limited to the smart television, and may also be applied to other terminals, such as a mobile phone and a PAD.
In this embodiment, by implementing the H5 page display method in the application program described in the above embodiment in the smart television, the H5 page display speed can be increased, the page loading waiting time can be reduced, and the user experience can be improved.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that, in the description of the present application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present application, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional component mode. The integrated module, if implemented in the form of a software functional component and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.
It should be noted that the present invention is not limited to the above-mentioned preferred embodiments, and those skilled in the art can obtain other products in various forms without departing from the spirit of the present invention, but any changes in shape or structure can be made within the scope of the present invention with the same or similar technical solutions as those of the present invention.

Claims (9)

1. A method for displaying an H5 page in an application program is characterized by comprising the following steps:
when an application program is started, a page control object is created;
initializing the page control object;
and loading the address of the webpage by using the initialized page control object to display the webpage.
2. The method for displaying an H5 page in an application program according to claim 1, wherein the creating a page control object comprises:
the page control object is created through the singleton schema.
3. The H5 page display method in application program according to claim 1 or 2, wherein the creating page control is: a Webview object.
4. The H5 page display method in application program according to claim 3, further comprising:
and saving the Webview object in an oncreate method.
5. The method for displaying an H5 page in an application program according to claim 3, wherein initializing the page control object further comprises:
and setting the Webview object attribute in the thread to display the webpage according to the Webview object attribute.
6. The method for displaying the H5 page in the application program according to claim 1, further comprising, after the web page is displayed and the web page is exited, the steps of:
and clearing the cache information of the webpage.
7. The H5 page display method in application program according to claim 1, further comprising:
and when the application program exits, destroying the page control object.
8. A terminal, comprising:
a processor and a memory;
the memory is used for storing application programs and computer programs;
the processor is used for executing the computer program stored in the memory to realize the H5 page display method in the application program according to any one of claims 1 to 7.
9. The terminal according to claim 8, wherein the terminal is a smart television.
CN202110608197.7A 2021-06-01 2021-06-01 H5 page display method in application program and terminal Pending CN113301434A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110608197.7A CN113301434A (en) 2021-06-01 2021-06-01 H5 page display method in application program and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110608197.7A CN113301434A (en) 2021-06-01 2021-06-01 H5 page display method in application program and terminal

Publications (1)

Publication Number Publication Date
CN113301434A true CN113301434A (en) 2021-08-24

Family

ID=77326670

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110608197.7A Pending CN113301434A (en) 2021-06-01 2021-06-01 H5 page display method in application program and terminal

Country Status (1)

Country Link
CN (1) CN113301434A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109460264A (en) * 2018-09-26 2019-03-12 深圳壹账通智能科技有限公司 The acquisition methods of the H5 page, device and computer equipment in application program
CN110263275A (en) * 2019-06-14 2019-09-20 深圳前海桔子信息技术有限公司 A kind of method, apparatus, mobile terminal and storage medium accessing webpage
CN112084442A (en) * 2020-08-04 2020-12-15 北京三快在线科技有限公司 Page loading method and device, electronic equipment and storage medium
CN112364275A (en) * 2020-11-10 2021-02-12 平安普惠企业管理有限公司 Page loading method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109460264A (en) * 2018-09-26 2019-03-12 深圳壹账通智能科技有限公司 The acquisition methods of the H5 page, device and computer equipment in application program
CN110263275A (en) * 2019-06-14 2019-09-20 深圳前海桔子信息技术有限公司 A kind of method, apparatus, mobile terminal and storage medium accessing webpage
CN112084442A (en) * 2020-08-04 2020-12-15 北京三快在线科技有限公司 Page loading method and device, electronic equipment and storage medium
CN112364275A (en) * 2020-11-10 2021-02-12 平安普惠企业管理有限公司 Page loading method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
KR101790190B1 (en) Application scenario identification method, power consumption management method, apparatus, and terminal device
CN112035172B (en) Operating system starting method, device, server and storage medium
US20140258701A1 (en) Computing platform performance management with ras services
CN111813713B (en) Data acceleration operation processing method and device and computer readable storage medium
CN105765534A (en) Virtual computing systems and methods
US20060212727A1 (en) Systems and methods for providing power-loss protection to sleeping computers systems
US20190325562A1 (en) Window rendering method and terminal
CN110825419B (en) Firmware refreshing method and device, electronic equipment and storage medium
CN103703454A (en) On-demand tab rehydration
CN110910921A (en) Command read-write method and device and computer storage medium
CN106547636B (en) Debugging system and method
WO2021078161A1 (en) Method for processing rendering instruction in simulator and mobile terminal
WO2016192546A1 (en) Method and device for updating data point of dynamic curve
US11875145B2 (en) Virtual machine update while keeping devices attached to the virtual machine
KR102521654B1 (en) Computing system and method for performing graphics pipeline of tile-based rendering thereof
CN109284101B (en) Method and device for changing association of object attributes
CN113301434A (en) H5 page display method in application program and terminal
CN107918643A (en) A kind of Webpage display process and terminal
CN116866661A (en) Video prerendering method, device, equipment and storage medium
CN109408405B (en) Memory page exchange method, device, terminal and storage medium
CN110941408A (en) KVM virtual machine graphical interface output method and device
CN115878247A (en) Front-end element adaptive display method, device, storage medium and system
US20110225408A1 (en) Cache boot mechanism
CN113176923A (en) Application program running method, method and device for assisting application program running
CN115794132A (en) Operating system deployment method, device, equipment 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210824