Android Page Loading via Binary Layout Pre-compilation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The existing page loading methods in Android operating systems face issues of poor compatibility and inefficient operation due to the need for pre-adaptation of attribute information for view objects, leading to time-consuming page loading and compatibility problems when converting layout files into program code.
Innovation Solution
A page loading method that acquires attribute information of a target page, uses a corresponding target constructor with an attribute parameter to construct a target view object, and displays the page based on this object, eliminating the need for pre-adaptation and improving loading efficiency and compatibility.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If the layout file is translated into program code in advance and compiled into the APP, then the page display speed is improved, but the compatibility and operation efficiency deteriorate due to pre-adaptation requirements
Solution Approach 1:
The patent pre-compiles layout files into binary format during the build process, storing them in the app package. This preliminary action enables fast loading during runtime without requiring pre-adaptation of attribute information, thus improving page display speed while maintaining compatibility through the use of standard constructors.
2Speed
If the layout file is translated into program code in advance, then the page display speed is improved, but the operation efficiency deteriorates due to pre-adaptation requirements
Solution Approach 1:
The patent performs the translation of layout files to binary format in advance during the build process, so that during runtime, the system can directly load and use the pre-processed data without time-consuming pre-adaptation operations, thereby improving operation efficiency while maintaining fast page display.
3Reliability
If pre-adaptation of attribute information is performed, then the page loading is completed, but the loading time increases and compatibility problems occur
Solution Approach 1:
The patent extracts the attribute information processing from the runtime execution path and moves it to the build-time compilation process. By separating the pre-adaptation requirement from the loading process and embedding the results in binary format, the system achieves reliable page loading without the time penalty of runtime pre-adaptation.
Solution Approach 2:
The patent performs attribute information adaptation in advance during the build process rather than at runtime. This preliminary action eliminates the need for time-consuming pre-adaptation during page loading, reducing loading time while ensuring reliable page loading completion.
4Reliability
If pre-adaptation of attribute information is performed, then the page loading is completed, but compatibility problems occur
Solution Approach 1:
The patent extracts the pre-adaptation requirement from the runtime execution and relocates it to the build-time compilation process. By separating these concerns and using standard constructors with pre-processed binary data, the system achieves reliable page loading while improving compatibility by eliminating runtime pre-adaptation requirements.
Data Source
AI summary
Embodiments of the present disclosure provide a page loading method and apparatus, an electronic device, and a storage medium. The method includes: acquiring attribute information of a target page, which characterizes a page layout of the target page; obtaining, in accordance with the attribute information, a corresponding target constructor which has an attribute parameter for receiving the attribute information; and constructing a target view object in accordance with the target constructor and the attribute information, and displaying the target page based on the target view object.


