Disclosure of Invention
In view of the foregoing problems, an object of the present invention is to provide a stylized display method, apparatus, terminal and storage medium for native APP, which can implement dynamic and stylized display for native APP without upgrading a client.
The embodiment of the invention provides a stylized display method of a native APP, which comprises the following steps:
transmitting at least one key for identifying a display page to a background server according to the Http interface request;
acquiring and storing corresponding background data returned by the background server based on at least one key; wherein the background data comprises dynamic display data configured by a background and a style identification;
for the current display page, acquiring locally stored background data corresponding to the key according to the key of the current display page;
and processing the background data according to the dynamic display custom class added on the current display page, and displaying the dynamic display data in a mode corresponding to the mode identification.
Preferably, the dynamic display custom class is a RecycleView class encapsulated with a requirement pattern.
Preferably, the method further comprises the following steps:
placing the dynamic display custom class to a specific display page or a specified position of the display page according to product requirements; wherein the dynamic display custom class is reusable.
Preferably, the background data is data returned by background personnel operating the background according to the background configuration document.
An embodiment of the present invention further provides a stylized display device of a native APP, including:
the key transmitting unit is used for transmitting at least one key for identifying the display page to the background server according to the Http interface request;
the background data storage unit is used for acquiring and storing corresponding background data returned by the background server based on at least one key; wherein the background data comprises dynamic display data configured by a background and a style identification;
the background data acquisition unit is used for acquiring locally stored background data corresponding to the key according to the key of the current display page;
and the display unit is used for processing the background data according to the dynamic display custom class added on the current display page and displaying the dynamic display data in a mode corresponding to the mode identification.
Preferably, the dynamic display custom class is a RecycleView class encapsulated with a requirement pattern.
Preferably, the method further comprises the following steps:
the placing unit is used for placing the dynamic display custom class to a specific display page or a specified position of the display page according to the product requirement; wherein the dynamic display custom class is reusable.
Preferably, the background data is data returned by background personnel operating the background according to the background configuration document.
The embodiment of the present invention further provides a stylized display terminal of a native APP, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the stylized display terminal of the native APP as described above is implemented.
The embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, and when the computer program runs, the device where the computer-readable storage medium is located is controlled to execute the above style display method of the native APP.
In the embodiment, the dynamic display self-definition class encapsulated with the required style is arranged on the corresponding display page, and the background data with the style identification returned by the background server is received, so that the dynamic display self-definition class can dynamically and repeatedly display the display interface according to the style configured by the background, the dynamic display of the native APP can be realized without version upgrade or re-download installation of the native APP, and the development process and the cost are reduced.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a first embodiment of the present invention provides a stylized display method of a native APP, which can be executed by a stylized display terminal (hereinafter referred to as a terminal) of the native APP, and at least includes the following steps:
s101, according to the Http interface request, at least one key for identifying the display page is transmitted to the background server.
In this embodiment, the terminal may be a smart phone or a smart tablet, and the operating system may be an IOS system or an android system, which is not specifically limited in the present invention.
In the embodiment of the invention, the terminal is provided with a native APP (native APP), which is a native program and generally runs on a machine operating system, and has strong interaction. Static resources are mostly stored locally, so that the method has the advantages of convenience in browsing and use and high experience degree. In implementation, the iOS program is written by using Objective-c and coco Touch Framework, or the Android application program is written by selecting java + Android Framework.
Corresponding to native APP are hybrid APP (mixed APP combined with native as by H5) and webapp. The hybrid app forges an apk/ipa native program of a browser, writes the address dead, and then runs a webapp inside which is a WebView UI. But still run on the operating system of the machine, the interaction is weak, and resources are generally available in local or network, and the browsing experience is inferior. The webapp is an application living in a browser, so the webapp can only run in the browser, the host is the browser and is not an operating system any more, resources are generally on the network, and the browsing experience is improved again.
In this embodiment, when the user operates the native APP, the user may establish a connection with the background server, and transmit at least one key for identifying the display interface to the background server through the HTTP interface request. Each key corresponds to one display page or one display area on the display page.
S102, acquiring and storing corresponding background data returned by the background server based on at least one key; the background data comprises dynamic display data configured by a background server and a style identification.
In this embodiment, after receiving the key, the background server queries the corresponding background data of the display page according to the key, and sends all the background data to the terminal, and the terminal associates the key with the corresponding background data and stores the key in a local place (e.g., a local SDCard).
S103, for the current display page, obtaining locally stored background data corresponding to the key according to the key of the current display page.
And S104, processing the background data according to the dynamic display custom class added on the current display page, and displaying the dynamic display data in a mode corresponding to the mode identification.
In this embodiment, as shown in fig. 2, when the native APP is developed, a product plan and a developer first agree on a style and an operation logic that the native APP needs to display, and then the developer sets a format agreement (for example, Json data) of data returned by the background server according to the agreed requirement, and writes a background configuration document. And then, dynamically displaying self-defined encapsulation in a native APP development mode, and defining the style and operation to be displayed. And then, according to the requirements of product personnel, a developer places the RecyclerView class packaged with the requirement style to a page to be displayed or a specified position on the page, and releases the native APP after the development is finished and the test is carried out, so that the native APP can be downloaded and installed by a user.
The user may open the native APP after installation to browse the relevant display page. When the current display page is displayed, the terminal inquires at least one key of the current display page, and then obtains locally stored background data corresponding to the at least one key according to the at least one key of the current display page (the background data is data generated by background personnel operating a background server according to a background configuration document). And then, the terminal processes the background data according to the dynamic display custom class added on the current display interface, extracts the style identification in each background data, and then loads and displays the dynamic display data by adopting the style corresponding to the style identification.
In this embodiment, the dynamic display custom class may display different pages at different locations according to the difference between the key and the use location. Such as: for the display page A, a key A is adopted, and dynamic display data and a style of background data configuration corresponding to the key A are displayed; and for the display page B, adopting the key B, and displaying dynamic display data and a style configured by the background data corresponding to the key B.
It should be noted that, in the embodiment of the present invention, the dynamic display custom class may be placed in different display pages or different positions of the same display page, so as to implement reuse of the dynamic display custom class, thereby greatly reducing development time and improving development efficiency for APPs with a large number of repetitive and similar style requirements. That is, as long as the styles are defined in advance, when displaying, configuration is performed according to the background configuration document, and how many repeated styles can be displayed when displaying how many styles are desired.
In summary, in the embodiment, the dynamic display custom class encapsulated with the required style is set on the corresponding display page, and the background data with the style identifier returned by the background server is received, so that the dynamic display custom class can dynamically and repeatedly display the display interface according to the style configured by the background, thereby dynamically displaying the native APP without upgrading the version of the native APP or downloading and installing the native APP again, and reducing the development process and cost.
Referring to fig. 3, a second embodiment of the present invention provides a stylized display device of native APP, comprising:
a key transmitting unit 10, configured to transmit at least one key for identifying a display page to a background server according to the Http interface request;
the background data storage unit 20 is configured to acquire and store corresponding background data returned by the background server based on at least one key; wherein the background data comprises dynamic display data configured by a background and a style identification;
the background data acquisition unit 30 is configured to acquire, for a current display page, locally stored background data corresponding to a key according to the key of the current display page;
and the display unit 40 is used for processing the background data according to the dynamic display custom class added on the current display page and displaying the dynamic display data in a mode corresponding to the mode identification.
Preferably, the dynamic display custom class is a RecycleView class; the dynamic display custom class is packaged with at least two style layouts according to requirements.
Preferably, the dynamic display custom class is a RecycleView class encapsulated with a requirement pattern.
Preferably, the method further comprises the following steps:
the placing unit is used for placing the dynamic display custom class to a specific display page or a specified position of the display page according to the product requirement; wherein the dynamic display custom class is reusable.
Preferably, the background data is data returned by background personnel operating the background according to the background configuration document.
The third embodiment of the invention also provides a stylized display terminal of the native APP. The stylized display terminal of native APP of this embodiment comprises: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a stylized display program of a native APP. When the processor executes the computer program, the steps in the above embodiments of the stylized display method of the native APP are implemented, for example, step S101 shown in fig. 1. Alternatively, the processor implements the functions of the modules/units in the above device embodiments when executing the computer program.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program in the stylized display terminal of the native APP.
The stylized display terminal of the native APP can be computing equipment such as a desktop computer, a notebook computer, a palm computer and a cloud server. The stylized display terminal of the native APP may include, but is not limited to, a processor, a memory. It will be understood by those skilled in the art that the above-mentioned components are merely examples of the stylized display terminal of the native APP, and do not constitute a limitation on the stylized display terminal of the native APP, and may include more or less components than those described above, or some components in combination, or different components, for example, the stylized display terminal of the native APP may further include an input-output device, a network access device, a bus, etc.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor is a control center of the stylized display terminal of the native APP, and various interfaces and lines are utilized to connect various parts of the stylized display terminal of the entire native APP.
The memory may be used to store the computer programs and/or modules, and the processor may implement various functions of the stylized display terminal of the native APP by running or executing the computer programs and/or modules stored in the memory and calling data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
Wherein, the module/unit integrated with the stylized display terminal of the native APP can be stored in a computer readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, etc. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that the above-described device embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.