WO2022083477A1 - 一种mvvm架构的应用的开发方法及终端 - Google Patents

一种mvvm架构的应用的开发方法及终端 Download PDF

Info

Publication number
WO2022083477A1
WO2022083477A1 PCT/CN2021/123319 CN2021123319W WO2022083477A1 WO 2022083477 A1 WO2022083477 A1 WO 2022083477A1 CN 2021123319 W CN2021123319 W CN 2021123319W WO 2022083477 A1 WO2022083477 A1 WO 2022083477A1
Authority
WO
WIPO (PCT)
Prior art keywords
viewmodel
interface
control
application
interface description
Prior art date
Application number
PCT/CN2021/123319
Other languages
English (en)
French (fr)
Inventor
袁梓惠
熊石一
李阳
陈晓晓
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP21881895.3A priority Critical patent/EP4216052A4/en
Priority to US18/250,055 priority patent/US20230393820A1/en
Publication of WO2022083477A1 publication Critical patent/WO2022083477A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/74Reverse engineering; Extracting design information from source code

Definitions

  • the present application relates to the field of terminals, and in particular, to a development method and terminal of an application of an MVVM architecture.
  • Model-View-ViewModel (Model-View-ViewModel, MVVM) architecture is a software architecture pattern.
  • the MVVM architecture separates the development of the Graphical User Interface (GUI) from the development of business logic or backend logic (data model).
  • GUI Graphical User Interface
  • an application based on the MVVM architecture is abstracted into Model (model, that is, background data), View (view, that is, UI interface), and ViewModel.
  • Model model, that is, background data
  • View view, that is, UI interface
  • ViewModel Application developers can define a ViewModel, and use the ViewModel to bind various controls in the UI interface to the data objects in the background data.
  • the background data is automatically updated accordingly.
  • the UI interface is also automatically updated accordingly.
  • the process of automatic updating of data and UI interface eliminates the need for users to write complex and repetitive program codes, reducing the development cost of application developers.
  • the DataBinding tool library implements the MVVM architecture.
  • Application developers use Android Studio (a Integrated development tools) to develop the interface description file of the application, etc., declare the package name of the background data in the interface description file, and declare the data object to be bound in the specified UI element.
  • Android APT a tool for processing annotations
  • binding logic such as auxiliary extensible markup language (xml) files, binding settings Java files, BR class files, Mapper files, etc.
  • the application development method and terminal for an MVVM architecture application provided by the present application can support developers to develop applications based on the MVVM architecture using multiple interface description languages, thereby simplifying development costs.
  • a first aspect provides an application development method of an MVVM architecture, which is applied to an application development device.
  • the method includes: receiving a ViewModel object in background data in a user-defined first application, and a user-defined UI of the first application. interface description file; parse the UI interface description file, and identify the binding relationship between the first UI control and the ViewModel object in the UI interface description file; set a monitor for the first UI control to update the ViewModel object; set an instance of the ViewModel object, And set a monitor for the instance, which is used to update the first UI control; when a change of the first UI control is monitored, or a change of the instance is monitored, the first UI interface of the first application is updated.
  • the developer can use the interface provided by the development tool of the MVVM architecture provided by the embodiment of the present application to customize some data objects of the background data.
  • the developer declares the binding relationship between some controls in the UI interface and the data object of the background data in the interface description file. Then, in the process of parsing the interface description file designed by the developer, the declared binding relationship is automatically identified, and the binding relationship is registered in the development tool of the MVVM architecture provided by the embodiment of the present application, and corresponding monitoring is set. , to establish a refresh channel. In this way, in the process of developing the UI interface, when a change of a control in the UI interface is monitored, the data object bound to the control will be automatically updated.
  • the MVVM architecture development tool provided by this application automatically recognizes the binding relationship between the UI control and the ViewModel in the process of parsing the UI interface description file, and sets the two-way monitoring of the UI control and the ViewModel object, This enables two-way binding. It can be seen that the development method provided by this application no longer relies on The Android Studio development tool and the Android APT pre-compilation mechanism can realize the decoupling of the application development of the MVVM architecture and the xml language. In other words, the development method provided by the embodiments of the present application does not limit the interface description language used by the developer.
  • the UI interface description file of the first application supports at least two interface description languages, and the at least two interface description languages include any of extensible markup language xml, domain-specific language DSL, or embedded domain-specific language EDSL. two. It can be seen that the methods provided in the embodiments of the present application can support application development based on the MVVM architecture for multiple interface description languages, which is beneficial for developers to focus on UI interface design and arrangement without being limited to using a specific interface description language Develop UI interface files to reduce application development costs.
  • the ViewModel object includes one or more members, and the first UI control includes one or more elements; the binding relationship between the first UI control and the ViewModel object includes: the first element in the first UI control It has a corresponding relationship with the first member in the ViewModel object.
  • the first UI interface of the first application is updated, specifically: when it is monitored that the user modifies the first member of the ViewModel object
  • the content of the first element in the first UI interface is detected, the content of the first element in the first UI interface is automatically updated; when it is monitored that the user modifies the content of the first element in the first UI interface, the content of the first member in the ViewModel object is automatically updated.
  • the development device stores a registry, and the registry records the correspondence between the identifier of the first element of the first UI control and the identifier of the first member in the ViewModel object.
  • the development device includes a parsing engine for parsing the UI interface description file, and the parsing engine includes a grammatical logic definition of the binding relationship between the first UI control and the ViewModel object.
  • a development device for an application based on an MVVM architecture includes a processor, a display screen, and a memory.
  • the display screen is coupled to the processor, and the memory is used to store computer program code, and the computer program code includes a computer instruction, when the processor reads the computer instruction from the memory, so that the development device performs the following operations: receiving the ViewModel object in the background data in the user-defined first application, and the UI interface description file of the user-defined first application; parsing UI interface description file, and identify the binding relationship between the first UI control and the ViewModel object in the UI interface description file; set a monitor for the first UI control to update the ViewModel object; set an instance of the ViewModel object, and set a monitor for the instance , which is used to update the first UI control; when the first UI control is monitored to change, or the instance is monitored to change, the first UI interface of the first application is updated.
  • the UI interface description file of the first application supports at least two interface description languages, and the at least two interface description languages include any of extensible markup language xml, domain-specific language DSL, or embedded domain-specific language EDSL. two.
  • the ViewModel object includes one or more members, and the first UI control includes one or more elements; the binding relationship between the first UI control and the ViewModel object includes: the first element in the first UI control It has a corresponding relationship with the first member in the ViewModel object.
  • the first UI interface of the first application is updated, specifically: when it is monitored that the user modifies the first member of the ViewModel object
  • the content of the first element in the first UI interface is detected, the content of the first element in the first UI interface is automatically updated; when it is monitored that the user modifies the content of the first element in the first UI interface, the content of the first member in the ViewModel object is automatically updated.
  • the development device stores a registry, and the registry records the correspondence between the identifier of the first element of the first UI control and the identifier of the first member in the ViewModel object.
  • the development device includes a parsing engine for parsing the UI interface description file, and the parsing engine includes a grammatical logic definition of the binding relationship between the first UI control and the ViewModel object.
  • an apparatus in a third aspect, is provided, the apparatus is included in a development device, and the apparatus has the function of implementing the behavior of the development device in any of the methods in the above aspect and possible implementation manners.
  • This function can be implemented by hardware or by executing corresponding software by hardware.
  • the hardware or software includes at least one module or unit corresponding to the above-mentioned functions. For example, a communication module or unit, and a processing module or unit, and the like.
  • a computer-readable storage medium comprising computer instructions, which, when the computer instructions are executed on a development device, cause the development electronic device to perform the above-mentioned first aspect and any one of the possible first aspects. method in the implementation.
  • a fifth aspect provides a computer program product that, when the computer program product runs on a computer, enables the computer to execute the method in the first aspect and any possible implementation manner of the first aspect.
  • a chip system including a processor.
  • the processor executes an instruction
  • the processor executes the method in the first aspect and any possible implementation manner of the first aspect.
  • FIG. 1 is a schematic structural diagram of an MVVM architecture
  • FIG. 2 is a schematic structural diagram of a development device provided by an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of an application development tool of an MVVM architecture provided by an embodiment of the present application
  • FIG. 4 is a schematic flowchart of an application development method of an MVVM architecture provided by an embodiment of the present application
  • FIG. 5 is a schematic diagram of a method for adapting a parsing engine of an interface description language according to an embodiment of the present application
  • FIG. 6 is a schematic diagram of a method for registering a binding relationship between a UI interface and background data provided by an embodiment of the present application
  • FIG. 7 is a schematic diagram of a method for instantiating a ViewModel object provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a method for binding an instance of a ViewModel object and a control in a UI interface provided by an embodiment of the present application;
  • FIG. 9 is a schematic diagram of interfaces of some applications provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a chip system according to an embodiment of the present application.
  • first and second are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features.
  • a feature defined as “first” or “second” may expressly or implicitly include one or more of that feature.
  • plural means two or more.
  • words such as “exemplary” or “for example” are used to represent examples, illustrations or illustrations. Any embodiments or designs described in the embodiments of the present application as “exemplary” or “such as” should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as “exemplary” or “such as” is intended to present the related concepts in a specific manner.
  • the embodiment of the present application provides an application development method of the MVVM architecture, which may not limit the language used by the developer when developing the interface description file.
  • the development method of the MVVM architecture provided by the embodiment of the present application can support the developer to use various interface description languages to develop the application development with the MVVM architecture.
  • the development method of the MVVM architecture provided by the embodiments of the present application may not depend on In the process of parsing the interface description file, the binding relationship between the UI interface and the background data is dynamically set to realize the MVVM architecture.
  • the developer uses an integrated development environment (Integrated Development Environment, IDE) tool on the development device to develop the application.
  • IDE Integrated Development Environment
  • the IDE tool is an integrated development software service suite that integrates code writing functions, analysis functions, compilation functions, and debugging functions.
  • typical IDE tools for Android systems include Android Studio, DevEco Studio, and so on.
  • the embodiments of the present application provide a development tool (which may also be referred to as a data binding tool) of an MVVM architecture, which can be integrated into an IDE tool, for example, in the form of a Lib library.
  • a development tool which may also be referred to as a data binding tool
  • the developer imports the MVVM architecture development tool provided by the embodiment of the present application into the IDE tool by adding a dependency library.
  • Interface description refers to the use of an interface description language to describe the layout of the UI, the controls used, and the visual style of the layout and controls.
  • Interface behavior definition refers to defining dynamic changes or responses of the interface, such as responses to user's UI operations.
  • developers can use, for example, extensible markup language (xml), domain specific language (DSL), embedded domain specific language (embedded domain specific language, EDSL), etc. to develop the UI of the application interface to form an interface description file.
  • the developer can use the interface provided by the development tool of the MVVM architecture provided by the embodiment of the present application to customize some data objects of the background data.
  • the developer declares the binding relationship between some controls in the UI interface and the data object of the background data in the interface description file. Then, in the process of parsing the interface description file designed by the developer, the declared binding relationship is automatically identified, and the binding relationship is registered in the development tool of the MVVM architecture provided by the embodiment of the present application, and corresponding monitoring is set.
  • the development device in this embodiment of the present application may be, for example, a mobile phone, a tablet computer, a personal computer (PC), a personal digital assistant (PDA), a smart watch, a netbook, a wearable electronic device, an enhanced Reality (augmented reality, AR) equipment, virtual reality (virtual reality, VR) equipment, vehicle-mounted equipment, smart screen, etc.
  • a mobile phone a tablet computer
  • PC personal computer
  • PDA personal digital assistant
  • VR virtual reality
  • netbook a wearable electronic device
  • an enhanced Reality (augmented reality, AR) equipment virtual reality (virtual reality, VR) equipment
  • vehicle-mounted equipment smart screen, etc.
  • the specific form of the electronic equipment is not specifically limited in this application.
  • FIG. 2 shows a schematic structural diagram of the development device 100 .
  • the development device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, an internal memory 140, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a display screen 190, and the like.
  • USB universal serial bus
  • the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the development device 100 .
  • the development device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a graphics processor (graphics processing unit, GPU), a controller, a baseband processor, and the like. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • graphics processor graphics processing unit
  • controller controller
  • baseband processor baseband processor
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or cycled by processor 110. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration, and does not constitute a structural limitation of the development device 100 .
  • the development device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the wireless communication function of the development device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • the mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G and the like applied on the development device 100 .
  • the wireless communication module 160 can provide applications on the development device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
  • WLAN wireless local area networks
  • BT wireless fidelity
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the development device 100 implements a display function through a GPU, a display screen 190, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 190 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the display screen 190 is used to display images, videos, and the like.
  • the display screen 190 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • LED liquid crystal display
  • AMOLED organic light-emitting diode
  • FLED flexible light-emitting diode
  • Miniled MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the development device 100 may include 1 or N display screens 190 , where N is a positive integer greater than 1.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the development device 100 .
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • the USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the development device 100, and can also be used to transfer data between the development device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones.
  • Internal memory 140 may be used to store computer executable program code, which includes instructions.
  • the internal memory 140 may include a stored program area and a stored data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area can store data (such as audio data, phone book, etc.) created during the use of the development device 100 and the like.
  • the internal memory 140 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the processor 110 executes various functional applications and data processing of the development device 100 by executing instructions stored in the internal memory 140 and/or instructions stored in a memory provided in the processor.
  • the development device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, and an application processor. Such as music playback, recording, etc.
  • FIG. 3 it is a software structure diagram of an application development tool provided by an embodiment of the present application.
  • the application development tool can adopt software of layered architecture, including UI layer, MVVM module layer and data layer respectively.
  • the MVVM module layer is used to establish a binding channel between the UI layer and the data layer.
  • the UI layer includes an interface description file, a parsing engine and an execution engine.
  • the data layer includes the ViewModel module.
  • the MVVM module layer includes a registration module, a binder module, a listener module, and a user interface.
  • the registration module is used to record and maintain the binding relationship between the UI layer and the data layer, for example, the two-way binding relationship between a control in the UI layer and a data object in the data layer.
  • the Binder module is used to save the references and properties of controls in the UI layer, the references and properties of bound data objects and other information, and to set monitoring.
  • the monitoring module is used to establish the refresh channel of the UI layer and the data layer.
  • the user interface is used for common processing of different types of data, so that data can be exchanged between the MVVM module layer and the data layer. The specific functions of each module will be described in detail below in conjunction with specific processes.
  • the interface description file can include the following structure:
  • version represents the version number of the interface description file; exemplarily, the version format is x.y.z, where x indicates the product, y indicates the subsystem of the product, and z indicates the number of times of development.
  • the version of the interface description file needs to match the version of the custom UI engine.
  • the version of the custom UI engine is the same as the version of the interface description file, or is newer than the version of the interface description file, in order to successfully parse the interface description file.
  • import is used to import object types, and model is used to declare objects.
  • model is used to declare objects.
  • An example is as follows:
  • layout-data-common is used to describe common UI.
  • Various types of electronic devices parse the content in layout-data-common, and lay out a common UI according to the content in layout-data-common.
  • layout-data-uimode is used to describe the UI of the specified device.
  • the difference between the specified device UI and the generic UI is declared in layout-data-uimode.
  • layout-data-uimode declares all conditions applicable to the UI of the specified device.
  • the specified device may be a mobile phone, a watch, a car device, a smart home device (for example, a smart TV, a smart screen, a smart speaker, etc.), a large screen, a laptop computer, a desktop computer, and the like.
  • the specific form of layout-data-uimode may include layout-data-phone (for mobile phones), layout-data-watch (for watches), layout-data-television (for TVs) and so on.
  • styles is used to define custom parameters and supports custom style layout. For example, a developer defines myTextStyle in style, and can call this custom parameter in layout-data-common as $style.myTextStyle.
  • FIG. 4 a schematic flowchart of an application development method based on an MVVM architecture provided by the present application is described in detail below with reference to the accompanying drawings.
  • IDE tools such as Android Studio, DevEco Studio, or other tools
  • the IDE tool itself integrates the lib library of the MVVM architecture provided by the embodiment of the present application (that is, the MVVM module in FIG. 3 ), or the developer can also manually add the lib library of the MVVM architecture provided by the embodiment of the present application (that is, the MVVM architecture provided by the embodiment of the present application).
  • the MVVM module in Figure 3) is the library that the development application depends on.
  • the interface development of the application includes interface description and interface behavior definition.
  • Interface description refers to the use of an interface description language to describe the layout of the UI, the controls used, and the visual style of the layout and controls.
  • the developer may use any interface description language, such as xml language, DSL language, etc., and the embodiment of the present application does not limit the interface description language.
  • Interface behavior definition refers to defining dynamic changes or responses of the interface, such as responses to user's UI operations.
  • the interface behavior definition may be developed using the Java programming language.
  • the developer can use the user interface provided by the MVVM module to customize the ViewModel class to be used by the application in the ViewModel module, and import the file path of the customized ViewModel type into the Java code. Further customize the data object of the ViewModel type to be used in the interface description file (such as a json file), which is referred to as the ViewModel object for short.
  • the interface description file such as a json file
  • the developer declares the required ViewModel object in the model block of the interface description file (such as a json file), for example:
  • the developer declares the binding relationship between the controls in the UI interface and the custom ViewModel object in the interface description file.
  • the attributes and attribute values of the control can be passed in ⁇ in the format of "Attribute 1: attribute value 1, attribute 2: attribute value 2".
  • An example of declaring the weather control in the UI interface is given below, as follows:
  • the user declares the binding relationship between the WeatherHomeView control and the ViewModel object-weather in the interface description file, including the binding relationship between each element in the WeatherHomeView control and each member in the ViewModel object.
  • “city”:"$weather.city” declares that the city element in WeatherHomeView directly accesses the variable value of city in weather. In other words, the city element in WeatherHomeView establishes a binding relationship with the city member in the ViewModel object-weather.
  • currentTemperature "$weather.currentTemperature”: declares that the currentTemperature element in WeatherHomeView directly accesses the variable value of currentTemperature in weather, in other words, the currentTemperature element in WeatherHomeView establishes a binding relationship with the currentTemperature member in the ViewModel object-weather.
  • the developer completes the development of the UI interface of the application, and obtains a complete interface description file.
  • the parsing engine converts the content in the interface description file into a data format matching the execution engine, so that the execution engine draws a corresponding UI interface.
  • the parsing engine may also perform syntax verification on the content in the interface description file. If the syntax verification of the interface description file is successful, the interface description file is parsed; if the syntax verification of the interface description file is unsuccessful, the parsing of the interface description file is not executed.
  • the parsing engine parses the data in fields such as declaration (model), style (style), layout (layout-data-common, layout-data-uimode) in the interface description file, and saves it in the database after preprocessing.
  • the electronic device specifically uses the control parser in the parsing engine to parse the data in the layout field, recursively calls the execution engine to instantiate the controls according to the logical structure described by the layout, and forms a UI control tree. Then use the property parser in the parsing engine to parse the property fields of each control, call the execution engine to set properties for each control, and complete the UI drawing.
  • the execution engine is used to construct UI controls (instantiated controls and property settings) according to the data parsed by the parsing engine, arrange the layout of the controls, and generate the interface declared in the interface description file; it can also realize the connection between device events and user behaviors. , and perform actions corresponding to user behaviors defined in the interface description file in response to user behaviors.
  • UI controls instantiated controls and property settings
  • the parsing engine also needs to parse out the binding relationship between the control and the ViewModel object.
  • any interface description language can be used to generate the interface description file in this application, it is necessary to carry out simple grammatical logic definition and adaptation of the binding relationship between the control and the ViewModel object for the analysis engines of different interface description languages. configuration, so that the parsing engine can parse out the binding relationship between the controls declared in the interface description file and the ViewModel object.
  • the DSLBindingTool is used in the Java code to parse the binding relationship between the control and the ViewModel object in the interface description file.
  • the code 501 marks the parsing format DslParserNewFormat defined in the parsing engine.
  • the registration module in the MVVM module registers the identified binding relationship.
  • the registration module may set the reference of the View in the binding relationship, and set the property of the View as the binding property, so as to set monitoring on the identified binding relationship, that is, to realize the binding.
  • the code 601 marks the registration of the binding relationship between the identified control and the ViewModel object.
  • the adhesive module records the reference of the control with the binding relationship, and uses the set monitoring for the control.
  • An example of setting a listener for a radio button (RadioButton) is given below, as follows:
  • radio button supports setOnClickListener for monitoring click events, and the onClick (click) event can be bound to the radio button (RadioButton) in the interface description file. Then the monitoring module will start monitoring whether the radio button (RadioButton) is clicked.
  • the developer creates an instance of a custom ViewModel object in Java code, that is, runs the instance of the ViewModel object in the ViewModel module.
  • an instance of WeatherViewModel is created in Java code, and each member of the WeatherViewModel instance is assigned values.
  • the member "city” has been assigned the value of "Shanghai”
  • "currentTemperature” has been assigned the value of "20”
  • “highTemperature” has been assigned the value of "26”
  • code 801 implements the binding of the instance of the ViewModel object to the controls in the UI interface.
  • the binder module records the reference to the ViewModel object, and sets a listener for the ViewModel object.
  • An example of setting up listeners for ViewModel objects is given below, as follows:
  • monitoring is set for the controls and ViewModel objects in the UI interface with binding relationships, respectively, and a binding channel for the controls in the UI interface and the ViewModel objects is established to realize the two-way binding of the controls in the UI interface and the ViewModel objects. .
  • the execution engine After completing the two-way binding of the controls in the UI interface and the ViewModel object, the execution engine refreshes the UI interface.
  • step S509-step S511 when the developer modifies the business logic in the application in the Java code and causes the data in the ViewModel object to change, the monitoring module sends a monitoring event to the adhesive module, and the glue The agent module notifies the execution engine to refresh the UI interface through the established two-way binding channel, and modifies the content of the controls bound to the ViewModel object accordingly.
  • the monitoring module sends a monitoring event to the adhesive module, and the adhesive module notifies the ViewModel module to modify the binding of the control through the established two-way binding channel. data in a given ViewModel object.
  • the application development method of the MVVM architecture provided by the embodiment of the present application can support the developer to use various interface description languages to develop the application development with the MVVM architecture.
  • the method provided by the embodiments of the present application can be used to quickly and easily develop an application based on the MVVM architecture.
  • the development method of the MVVM architecture provided by the embodiments of the present application no longer relies on The Android APT pre-compilation mechanism, and in the process of parsing the interface description file, dynamically set the binding relationship between the UI interface and the background data, which has a wide range of applications.
  • the interface description file can be as follows:
  • the interface shown in (1) in Figure 9 can be drawn.
  • the value of "$weather.city” in the background data is "Shanghai”
  • the value of "$weather.currentTemperature” is "20°C”.
  • the value of "$weather.city” in the background data is changed to "Beijing”
  • the value of "$weather.currentTemperature” is changed to "15°C”
  • the interface shown in (1) in Figure 9 It will automatically change to the interface shown in (2) in Figure 9. It can be seen that, by using the method provided by the embodiment of the present application, application development based on the MVVM architecture can be implemented.
  • the chip system includes at least one processor 1101 and at least one interface circuit 1102 .
  • the processor 1101 and the interface circuit 1102 may be interconnected by wires.
  • the interface circuit 1102 may be used to receive signals from other devices, such as the memory of the development apparatus 100 .
  • the interface circuit 1102 may be used to send signals to other devices (eg, the processor 1101).
  • the interface circuit 1102 may read the instructions stored in the memory and send the instructions to the processor 1101 .
  • the electronic device can be made to execute various steps executed by the development device 100 (eg, a mobile phone) in the above-mentioned embodiment.
  • the chip system may also include other discrete devices, which are not specifically limited in this embodiment of the present application.
  • An embodiment of the present application further provides an apparatus, the apparatus is included in a development device, and the apparatus has a function of implementing the behavior of the development device in any of the methods in the foregoing embodiments.
  • This function can be implemented by hardware or by executing corresponding software by hardware.
  • the hardware or software includes at least one module or unit corresponding to the above-mentioned functions. For example, a detection module or unit, a display module or unit, a determination module or unit, and a calculation module or unit, etc.
  • Embodiments of the present application further provide a computer storage medium, including computer instructions, when the computer instructions are executed on the development device, the development device is made to execute any of the methods in the foregoing embodiments.
  • Embodiments of the present application further provide a computer program product, which, when the computer program product runs on a computer, causes the computer to execute any of the methods in the foregoing embodiments.
  • the above-mentioned terminal and the like include corresponding hardware structures and/or software modules for executing each function.
  • the embodiments of the present application can be implemented in hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the embodiments of the present invention.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. It should be noted that, the division of modules in the embodiment of the present invention is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
  • Each functional unit in each of the embodiments of the embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
  • a computer-readable storage medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

一种MVVM架构的应用的开发方法及终端,涉及终端领域,可以支持开发者使用多种界面描述语言开发基于MVVM架构的应用,简化开发成本,该方法包括:开发者自定义一些后台数据的数据对象,并在界面描述文件中声明UI界面中某些控件与后台数据的数据对象的绑定关系,其中界面描述文件可以采用任意的界面描述语言;而后在对开发者设计的界面描述文件进行解析的过程中,自动识别出声明的绑定关系,并注册该绑定关系,以及设置相应的监听,以建立双向绑定通道。

Description

一种MVVM架构的应用的开发方法及终端
本申请要求于2020年10月22日提交国家知识产权局、申请号为202011141087.6、发明名称为“一种UI语言的适配方法及终端”的中国专利申请的优先权,以及要求于2021年02月05日提交国家知识产权局、申请号为202110163963.3、发明名称为“一种MVVM架构的应用的开发方法及终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端领域,尤其涉及一种MVVM架构的应用的开发方法及终端。
背景技术
模型-视图-视图模型(Model-View-ViewModel,MVVM)架构是一种软件架构模式。MVVM架构将图形用户界面(Graphical User Interface,GUI)的开发,与业务逻辑或后端逻辑(数据模型)的开发分离开来。
如图1所示,基于MVVM架构的应用被抽象成Model(模型,即后台数据)、View(视图,即UI界面)以及ViewModel。应用开发者可以在定义ViewModel,并通过ViewModel将UI界面中的各个控件与后台数据中的数据对象进行绑定。这样,当UI界面发生变化时,后台数据相应自动更新。当后台数据因为业务逻辑更新等原因发生改变时,UI界面也相应自动更新。数据和UI界面自动更新的过程,无需用户编写复杂重复的程序代码,减少了应用开发者的开发成本。
目前主要基于
Figure PCTCN2021123319-appb-000001
的DataBinding工具库实现的MVVM架构。应用开发者使用集成了DataBinding工具库的Android Studio(一种
Figure PCTCN2021123319-appb-000002
集成开发工具)开发应用的界面描述文件等,在界面描述文件中声明后台数据的包名,以及在指定的UI元素中声明需绑定的数据对象。而后,可以使用Android APT(一种处理注解的工具)对界面描述文件进行预编译,生成若干的具有绑定逻辑的文件,例如辅助可扩展标记语言(extensible markup language,xml)文件,绑定设置的java文件,BR类文件,Mapper文件等,用于实现UI界面与后台数据的绑定,从而完成基于MVVM架构的应用开发。
在该方案中,开发MVVM架构的应用依赖于
Figure PCTCN2021123319-appb-000003
的Android Studio开发工具,以及Android APT预编译机制。并且,该技术方案与xml语言绑定,无法为其他的界面描述语言提供MVVM架构的开发。因此,亟需其他不依赖xml语言的支持MVVM架构的应用开发的技术方案。
发明内容
本申请提供的一种MVVM架构的应用的开发方法及终端,可以支持开发者使用多种界面描述语言开发基于MVVM架构的应用,简化开发成本。
为了实现上述目的,本申请实施例提供了以下技术方案:
第一方面、提供一种MVVM架构的应用的开发方法,应用于应用的开发设备, 该方法包括:接收用户定义的第一应用中后台数据中的ViewModel对象,以及用户定义的第一应用的UI界面描述文件;解析UI界面描述文件,并识别出UI界面描述文件中第一UI控件与ViewModel对象的绑定关系;为第一UI控件设置监听,用于更新ViewModel对象;设置ViewModel对象的实例,并为实例设置监听,用于更新第一UI控件;当监听到第一UI控件发生变化,或者监听到实例发生变化,更新第一应用的第一UI界面。
也就是说,开发者可以利用本申请实施例提供的MVVM架构的开发工具提供的接口,自定义一些后台数据的数据对象。开发者在界面描述文件中声明UI界面中某些控件与后台数据的数据对象的绑定关系。而后在对开发者设计的界面描述文件进行解析的过程中,自动识别出声明的绑定关系,并在本申请实施例提供的MVVM架构的开发工具中注册该绑定关系,以及设置相应的监听,以建立刷新通道。这样,在开发者开发UI界面的过程中,当监听到UI界面中某个控件发生改变时,会自动更新该控件绑定的数据对象。当监听到后台数据中某个数据对象发生改变时,会自动更新该数据对象绑定的控件。由此,实现了基于MVVM架构的应用开发,这样有助于开发者专注于UI界面设计与编排,简化UI界面开发过程,降低应用的开发成本。
可以注意到,本申请提供的MVVM架构的开发工具时在对UI界面描述文件进行解析的过程中,自动识别出UI控件与ViewModel的绑定关系的,并设置UI控件和ViewModel对象的双向监听,从而实现双向绑定。可见,本申请提供的开发方法,不再依赖于
Figure PCTCN2021123319-appb-000004
的Android Studio开发工具,以及Android APT预编译机制,能够实现MVVM架构的应用开发与xml语言的解耦。换言之,本申请实施例提供的开发方法不限定开发者使用的界面描述语言。
一种可能的实现方式中,第一应用的UI界面描述文件支持至少两种界面描述语言,至少两种界面描述语言包括可扩展标记语言xml、领域专用语言DSL或嵌入式领域专用语言EDSL中任两项。由此可见,本申请实施例提供的方法可支持对多种界面描述语言实现基于MVVM架构的应用开发,有利于开发者专注于UI界面设计与编排,而不受限于使用特定的界面描述语言开发UI界面文件,降低应用的开发成本。
一种可能的实现方式中,ViewModel对象包括一个或多个成员,第一UI控件包括一个或多个元素;第一UI控件与ViewModel对象的绑定关系,包括:第一UI控件中第一元素与ViewModel对象中第一成员具有对应关系。
一种可能的实现方式中,当监听到第一UI控件发生变化,或者监听到实例发生变化,更新第一应用的第一UI界面,具体为:当监听到用户修改ViewModel对象中第一成员的内容时,自动更新第一UI界面中第一元素的内容;当监听到用户修改第一UI界面中第一元素的内容时,自动更新ViewModel对象中第一成员的内容。
一种可能的实现方式中,开发设备存储有注册表,注册表记录第一UI控件的第一元素的标识,与ViewModel对象中第一成员的标识的对应关系。
一种可能的实现方式中,开发设备包括用于解析UI界面描述文件的解析引擎,解析引擎包含第一UI控件与ViewModel对象的绑定关系的语法逻辑定义。
换言之,在各个界面描述语言对应的解析引擎中,需要定义使用该界面描述语言开发UI界面文件时定义UI控件与ViewModel对象的绑定关系的语法逻辑。这样,在 解析引擎解析该UI界面文件时,可以基于定义的语法逻辑解析出开发者定义的绑定关系。
第二方面、提供一种基于MVVM架构的应用的开发设备,开发设备包括处理器、显示屏,以及存储器,显示屏,存储器与处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当处理器从存储器中读取计算机指令,以使得开发设备执行如下操作:接收用户定义的第一应用中后台数据中的ViewModel对象,以及用户定义的第一应用的UI界面描述文件;解析UI界面描述文件,并识别出UI界面描述文件中第一UI控件与ViewModel对象的绑定关系;为第一UI控件设置监听,用于更新ViewModel对象;设置ViewModel对象的实例,并为实例设置监听,用于更新第一UI控件;当监听到第一UI控件发生变化,或者监听到实例发生变化,更新第一应用的第一UI界面。
一种可能的实现方式中,第一应用的UI界面描述文件支持至少两种界面描述语言,至少两种界面描述语言包括可扩展标记语言xml、领域专用语言DSL或嵌入式领域专用语言EDSL中任两项。
一种可能的实现方式中,ViewModel对象包括一个或多个成员,第一UI控件包括一个或多个元素;第一UI控件与ViewModel对象的绑定关系,包括:第一UI控件中第一元素与ViewModel对象中第一成员具有对应关系。
一种可能的实现方式中,当监听到第一UI控件发生变化,或者监听到实例发生变化,更新第一应用的第一UI界面,具体为:当监听到用户修改ViewModel对象中第一成员的内容时,自动更新第一UI界面中第一元素的内容;当监听到用户修改第一UI界面中第一元素的内容时,自动更新ViewModel对象中第一成员的内容。
一种可能的实现方式中,开发设备存储有注册表,注册表记录第一UI控件的第一元素的标识,与ViewModel对象中第一成员的标识的对应关系。
一种可能的实现方式中,开发设备包括用于解析UI界面描述文件的解析引擎,解析引擎包含第一UI控件与ViewModel对象的绑定关系的语法逻辑定义。
第三方面、提供一种装置,该装置包含在开发设备中,该装置具有实现上述方面及可能的实现方式中任一方法中开发设备行为的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括至少一个与上述功能相对应的模块或单元。例如,通信模块或单元、以及处理模块或单元等。
第四方面、提供一种计算机可读存储介质,包括计算机指令,当所述计算机指令在开发设备上运行时,使得所述开发电子设备执行上述第一方面以及第一方面中任一种可能的实现方式中的方法。
第五方面、提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述第一方面以及第一方面中任一种可能的实现方式中的方法。
第六方面、提供一种芯片系统,包括处理器,当处理器执行指令时,处理器执行上述第一方面以及第一方面中任一种可能的实现方式中的方法。
可以理解地,上述提供的第二方面所述的开发设备,第三方面所述的装置,第四方面所述的计算机存储介质,第五方面所述的计算机程序产品,以及第六方面所述的芯片系统所能达到的有益效果,可参考第一方面及其任一种可能的设计方式中的有益 效果,此处不再赘述。
附图说明
图1为一种MVVM架构的结构示意图;
图2为本申请实施例提供的一种开发设备的结构示意图;
图3为本申请实施例提供的一种MVVM架构的应用开发工具的结构示意图;
图4为本申请实施例提供的一种MVVM架构的应用开发方法的流程示意图;
图5为本申请实施例提供的一种界面描述语言的解析引擎的适配方法的示意图;
图6为本申请实施例提供的一种UI界面和后台数据的绑定关系的注册方法的示意图;
图7为本申请实施例提供的一种ViewModel对象实例化的方法的示意图;
图8为本申请实施例提供的一种ViewModel对象的实例与UI界面中控件的绑定方法示意图;
图9为本申请实施例提供的一些应用的界面的示意图;
图10为本申请实施例提供一种芯片系统的结构示意图。
具体实施方式
在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
本申请实施例提供一种MVVM架构的应用开发方法,可以不限定开发者开发界面描述文件时采用的语言。换言之,本申请实施例提供的MVVM架构的开发方法,可以支持开发者采用各种界面描述语言开发具有MVVM架构的应用开发。并且,本申请实施例提供的MVVM架构的开发方法,可以不依赖
Figure PCTCN2021123319-appb-000005
的Android APT预编译机制,而是在解析界面描述文件的过程中,动态地设置UI界面与后台数据的绑定关系,实现MVVM架构。
开发者在开发应用时,使用开发设备上的集成开发环境(Integrated Development Environment,IDE)工具开发应用。其中,IDE工具为集成了代码编写功能、分析功能、编译功能、调试功能等一体化的开发软件服务套。例如,典型的Android系统的IDE工具有Android Studio、DevEco Studio等。
一些示例中,本申请实施例提供一种MVVM架构的开发工具(也可称为数据绑定工具),例如可以以Lib库的形式集成到IDE工具中。或者,由开发者通过添加依 赖库的方式,将本申请实施例提供的MVVM架构开发工具导入IDE工具中。
在应用的开发过程中,一项重要任务就是开发应用的UI界面。其中,UI界面的开发主要包括界面描述和界面行为定义。界面描述是指使用界面描述语言描述UI的布局(layout),使用的控件,以及布局和控件的视觉风格等。界面行为定义是指定义界面的动态变化或响应,例如对用户的UI操作的响应。
本申请中,开发者可以使用例如可扩展标记语言(extensible markup language,xml)、领域专用语言(domain specific language,DSL),嵌入式领域专用语言(embedded domain specific language,EDSL)等开发应用的UI界面,形成界面描述文件。并且,开发者可以利用本申请实施例提供的MVVM架构的开发工具提供的接口,自定义一些后台数据的数据对象。开发者在界面描述文件中声明UI界面中某些控件与后台数据的数据对象的绑定关系。而后在对开发者设计的界面描述文件进行解析的过程中,自动识别出声明的绑定关系,并在本申请实施例提供的MVVM架构的开发工具中注册该绑定关系,以及设置相应的监听,以建立刷新通道。这样,在开发者开发UI界面的过程中,当监听到UI界面中某个控件发生改变时,会自动更新该控件绑定的数据对象。当监听到后台数据中某个数据对象发生改变时,会自动更新该数据对象绑定的控件。由此,实现了基于MVVM架构的应用开发,这样有助于开发者专注于UI界面设计与编排,简化UI界面开发过程,降低应用的开发成本。
示例性的,本申请实施例中开发设备例如可以为手机、平板电脑、个人计算机(personal computer,PC)、个人数字助理(personal digital assistant,PDA)、智能手表、上网本、可穿戴电子设备、增强现实技术(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、车载设备、智慧屏等,本申请对该电子设备的具体形式不做特殊限制。
图2示出了开发设备100的结构示意图。开发设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,内部存储器140,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,以及显示屏190等。
可以理解的是,本发明实施例示意的结构并不构成对开发设备100的具体限定。在本申请另一些实施例中,开发设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),图形处理器(graphics processing unit,GPU),控制器,基带处理器等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使 用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对开发设备100的结构限定。在本申请另一些实施例中,开发设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
开发设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。其中,移动通信模块150可以提供应用在开发设备100上的包括2G/3G/4G/5G等无线通信的解决方案。无线通信模块160可以提供应用在开发设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。
开发设备100通过GPU,显示屏190,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏190和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏190用于显示图像,视频等。显示屏190包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,开发设备100可以包括1个或N个显示屏190,N为大于1的正整数。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展开发设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为开发设备100充电,也可以用于开发设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。
内部存储器140可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器140可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储开发设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器140可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器140的指令,和/或存储在设置于处理器中的存储器的指令,执行开发设备100的各种功能应用以及数据处理。
开发设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
如图3所示,为本申请实施例提供的一种应用开发工具的软件结构图。该应用开发工具可以采用分层架构的软件,分别包括UI层、MVVM模块层以及数据层。其中,MVVM模块层,用于建立UI层和数据层之间绑定通道。
一个具体的实施例中,UI层包括界面描述文件、解析引擎和执行引擎。数据层包括ViewModel模块。MVVM模块层包括注册模块、粘合剂(Binder)模块、监听模块以及用户接口。其中,注册模块用于记录并维护UI层和数据层绑定关系,例如UI层某个控件与数据层某个数据对象的双向绑定关系。Binder模块,用于保存UI层中控件的引用和属性、绑定的数据对象的引用和属性等信息、设置监听等。监听模块,用于建立UI层和数据层的刷新通道。用户接口用于对不同类型的数据做通用处理,以便MVVM模块层和数据层之间交互数据。下文将结合具体的流程,对各个模块的具体功能进行详细说明。
为了便于理解下文,这里先对界面描述文件的结构进行简要说明。
以采用DSL语言开发界面描述文件,即界面描述文件采用json格式为例,界面描述文件可以包括如下结构:
Figure PCTCN2021123319-appb-000006
version表示界面描述文件的版本号;示例性的,version格式为x.y.z,x指示产品,y表示产品的子系统,z表示开发次数。界面描述文件的版本需要与自定义UI引擎的版本匹配,比如,自定义UI引擎的版本与界面描述文件的版本一致,或者比界面描述文件的版本更新,才能成功解析界面描述文件。
import用于导入对象类型,model用于声明对象。示例如下:
Figure PCTCN2021123319-appb-000007
Figure PCTCN2021123319-appb-000008
import中导入UserInfo保存的完整路径com.myapp.UserInfo,以及Context保存的完整路径com.myapp.TestActivity;在model中声明UserInfo类型的对象user,以及Context类型的对象context;这样就可以在界面描述文件(layout-data-common和layout-data-uimode)中直接调用user和context。本申请中,UserInfo、TestActivity等文件称为资源文件;资源文件包括生成该应用的UI使用的资源,该资源可以包括开发者定义的数据结构、控件、控件属性等。
layout-data-common用于描述通用UI。各种类型的电子设备都解析layout-data-common中内容,按照layout-data-common中的内容布局通用UI。layout-data-uimode用于描述指定设备的UI。在一种实现方式中,layout-data-uimode中声明指定设备UI与通用UI的区别。在另一种实现方式中,layout-data-uimode中声明适用于指定设备的UI的全部条件。指定设备可以为手机、手表、车机、智能家居设备(比如,智能电视、智慧屏、智能音箱等)、大屏、笔记本电脑、台式电脑等。比如,layout-data-uimode的具体形式可以包括layout-data-phone(用于手机),layout-data-watch(用于手表),layout-data-television(用于电视)等。
styles用于定义自定义参数,可支持自定义风格样式编排。例如,开发者在style中定义myTextStyle,并可以在layout-data-common中以$style.myTextStyle的方式调用该自定义参数。
如图4所示,为本申请提供的一种基于MVVM架构的应用的开发方法的流程示意图,下面结合附图进行详细的说明。
S501、开发者自定义ViewModel对象。
开发者在开发应用时,使用开发者设备上的IDE工具(例如Android Studio、DevEco Studio或其他工具)开发应用的界面描述文件。其中,IDE工具中本身集成了本申请实施例提供的MVVM架构的lib库(即图3中的MVVM模块),或者,开发者也可以手动添加本申请实施例提供的MVVM架构的lib库(即图3中的MVVM模块)为开发应用依赖的库。
其中,应用的界面开发包括界面描述和界面行为定义。界面描述是指使用界面描述语言描述UI的布局,使用的控件,以及布局和控件的视觉风格等。在本申请实施例中,开发者可以采用任意的界面描述语言,例如xml语言、DSL语言等,本申请实施例对界面描述语言不做限定。界面行为定义是指定义界面的动态变化或响应,例如对用户的UI操作的响应。在本申请实施例中,界面行为定义可以使用Java编程语言进行开发。
在一种实现方式中,开发者可以利用MVVM模块提供的用户接口,在ViewModel模块中自定义应用需使用的ViewModel类,并Java代码中导入自定义的ViewModel类型的文件路径。进一步在界面描述文件(例如json文件)自定义需要使用的ViewModel类型的数据对象,简称为ViewModel对象。
以用DSL语言开发一个天气应用的界面为例,对本申请实施例提供的开发方法进行举例说明。
例如,开发者可以在Java代码中通过import导入保存用户自定义的ViewModel类的文件路径,如下:
import com.huawei.uikit.dsl.allnewdsl.viewmodel.WeatherViewModel;
进一步的,开发者在界面描述文件(例如json文件)的model区块中声明需用到的ViewModel对象,例如:
Figure PCTCN2021123319-appb-000009
可见,开发者定义了一种WeatherViewModel类的ViewModel对象——“weather”,并且WeatherViewModel类保存的完整路径为“com.huawei.uikit.dsl.allnewdsl.viewmodel.WeatherViewModel”。
S502、开发者在界面描述文件中声明UI界面中控件与自定义的ViewModel对象的绑定关系。
仍然以json文件为例,开发者可以使用ComponentName():{}方式描述一个控件时,在一种实现方式中,可以在{}中传入控件的属性及属性值,格式为“属性1:属性值1,属性2:属性值2”。以下给出声明UI界面中天气控件的一个示例,如下:
Figure PCTCN2021123319-appb-000010
可见,用户在界面描述文件中,声明了WeatherHomeView的控件与ViewModel对象-weather的绑定关系,包括WeatherHomeView的控件中每个元素与ViewModel对象中各个成员的绑定关系。例如,"city":"$weather.city":声明了WeatherHomeView中city元素直接访问weather中city的变量值,换言之,WeatherHomeView中city元素与ViewModel对象-weather中的city成员建立绑定关系。又例如,"currentTemperature":"$weather.currentTemperature":声明了WeatherHomeView中currentTemperature元素直接访问weather中currentTemperature的变量值,换言之,WeatherHomeView中currentTemperature元素与ViewModel对象-weather中的currentTemperature成员建立绑定关系。
由此,开发者完成应用的UI界面的开发,得到完整的界面描述文件。
S503、解析开发者设计的界面描述文件,识别出界面描述文件中声明的UI界面中控件与ViewModel的绑定关系。
示例性的,解析引擎将界面描述文件中的内容转换成与执行引擎匹配的数据格式,以便执行引擎绘制出相应的UI界面。在一些示例中,解析引擎还可以对界面描述文件 中内容进行语法校验。如果对界面描述文件语法校验成功,则对界面描述文件进行解析;如果对界面描述文件语法校验不成功,则不执行解析界面描述文件。
一个具体的实施例中,解析引擎解析界面描述文件中声明(model)、风格(style)、布局(layout-data-common、layout-data-uimode)等字段内数据,预处理后保存至数据库中。电子设备具体使用解析引擎中的控件解析器解析布局(layout)字段内的数据,根据布局描述的逻辑结构递归调用执行引擎实例化控件,形成UI的控件树。再使用解析引擎中的属性解析器解析各个控件的属性字段,调用执行引擎为各个控件设置属性,完成UI绘制。其中,执行引擎用于根据解析引擎解析的数据构建UI的控件(实例化控件和属性设置),对控件进行布局编排,生成界面描述文件中声明的界面;还可以实现器件事件与用户行为之间的映射,响应于用户行为执行界面描述文件中定义的用户行为对应的动作等。
在本申请中,解析引擎还需要解析出控件与ViewModel对象的绑定关系。可以注意到,由于本申请中可以采用任意的界面描述语言生成界面描述文件,因此,需要针对不同的界面描述语言的解析引擎,对控件与ViewModel对象的绑定关系进行简单的语法逻辑定义和适配,以便解析引擎解析出界面描述文件中声明的控件与ViewModel对象的绑定关系。如图5所示,在Java代码中使用DSLBindingTool来解析界面描述文件中控件与ViewModel对象的绑定关系。其中,代码501标记出了解析引擎中定义的解析格式DslParserNewFormat。
S504、注册UI界面中控件与ViewModel对象的绑定关系。
在解析引擎识别出UI界面中控件与ViewModel对象的绑定关系后,MVVM模块中的注册模块对识别出的绑定关系进行注册。示例性的,注册模块可以设置绑定关系的View的引用、以及设置View的属性为绑定属性,以便于后续对识别出的绑定关系设置监听,即实现绑定。如图6所示,代码601标记出了对识别出的控件与ViewModel对象的绑定关系进行注册。
S505、设置UI界面中控件的引用,以及为控件设置监听。
一些实施例中,粘合剂模块记录具有绑定关系的控件的引用,并采用对该控件设置监听。以下给出为单选按钮(RadioButton)设置监听的一个示例,如下:
Figure PCTCN2021123319-appb-000011
Figure PCTCN2021123319-appb-000012
可见,单选按钮(RadioButton)支持对点击事件的监听setOnClickListener,则可以在界面描述文件中对单选按钮(RadioButton)绑定onClick(点击)事件。那么监听模块将开始监听单选按钮(RadioButton)是否被点击。
S506、开发者设置ViewModel实例。
示例性的,开发者在Java代码中创建自定义的ViewModel对象的实例,即在ViewModel模块中运行ViewModel对象的实例。如图7所示,在Java代码中创建WeatherViewModel的实例,并对WeatherViewModel实例中各个成员进行赋值。例如,成员“city”已赋值为“上海”,"currentTemperature"已赋值为“20”,"highTemperature"已赋值为“26”等。
然后,在Java代码中用bindViewModel将ViewModel对象的实例与UI界面中的控件进行绑定。如图8所示,代码801实现了ViewModel对象的实例与UI界面中控件的绑定。
S507、设置ViewModel对象的引用,以及为ViewModel设置监听。
在ViewModel对象实例化的过程中,生成该ViewModel对象的引用,粘合剂模块记录ViewModel对象的引用,并对该ViewModel对象设置监听。以下给出为ViewModel对象设置监听的一个示例,如下:
Figure PCTCN2021123319-appb-000013
Figure PCTCN2021123319-appb-000014
由此,对具有绑定关系的UI界面中的控件以及ViewModel对象分别设置了监听,建立了UI界面中的控件以及ViewModel对象的绑定通道,实现UI界面中的控件以及ViewModel对象的双向绑定。
S508、刷新UI界面。
在完成UI界面中的控件以及ViewModel对象的双向绑定后,执行引擎刷新UI界面。
S509、开发者更改ViewModel中的数据。
S510、监听到ViewModel中的数据发生更改。
S511、刷新UI界面。
示例性的,在步骤S509-步骤S511中,当开发者在Java代码中修改应用中的业务逻辑,并造成ViewModel对象中的数据发生变化时,监听模块向粘合剂模块发送监听事件,粘合剂模块通过建立的双向绑定通道,通知执行引擎刷新UI界面,相应地修改该ViewModel对象绑定的控件的内容。
S512、监听到UI界面发生变化。
S513、刷新相应的ViewModel对象中的数据。
示例性的,当开发者在UI界面中修改了某些控件的内容时,监听模块向粘合剂模块发送监听事件,粘合剂模块通过建立的双向绑定通道,通知ViewModel模块修改该控件绑定的ViewModel对象中的数据。
由此,实现了开发基于MVVM架构的应用。可以注意的是,本申请实施例提供的MVVM架构的应用开发方法,可以支持开发者采用各种界面描述语言开发具有MVVM架构的应用开发。换言之,开发者无论采用何种界面描述语言开发应用时,均可以采用本申请实施例提供的方法,以快速简便地实现开发基于MVVM架构的应用。
另外,本申请实施例提供的MVVM架构的开发方法,不再依赖
Figure PCTCN2021123319-appb-000015
的Android APT预编译机制,而在解析界面描述文件的过程中,动态地设置UI界面与后台数据的绑定关系,适用范围广。
以下给出一个实例,以开发者使用DSL语言开发天气应用的一个界面为例,界面描述文件可以如下:
Figure PCTCN2021123319-appb-000016
Figure PCTCN2021123319-appb-000017
根据上述界面描述文件,可以绘制出如图9中(1)所示的界面。此时,后台数据中"$weather.city"的值为“上海”,"$weather.currentTemperature"为“20℃”。若开发者进行如下修改,后台数据中"$weather.city"的值修改为“北京”,"$weather.currentTemperature"的值修改为“15℃”,则图9中(1)所示的界面将自动变化为图9中(2)所示的界面。由此可见,采用本申请实施例提供的方法,可以实现 基于MVVM架构的应用开发。
本申请实施例还提供一种芯片系统,如图10所示,该芯片系统包括至少一个处理器1101和至少一个接口电路1102。处理器1101和接口电路1102可通过线路互联。例如,接口电路1102可用于从其它装置(例如开发设备100的存储器)接收信号。又例如,接口电路1102可用于向其它装置(例如处理器1101)发送信号。示例性的,接口电路1102可读取存储器中存储的指令,并将该指令发送给处理器1101。当所述指令被处理器1101执行时,可使得电子设备执行上述实施例中的开发设备100(比如,手机)执行的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。
本申请实施例还提供一种装置,该装置包含在开发设备中,该装置具有实现上述实施例中任一方法中开发设备行为的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括至少一个与上述功能相对应的模块或单元。例如,检测模块或单元、显示模块或单元、确定模块或单元、以及计算模块或单元等。
本申请实施例还提供一种计算机存储介质,包括计算机指令,当计算机指令在开发设备上运行时,使得开发设备执行如上述实施例中任一方法。
本申请实施例还提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如上述实施例中任一方法。
可以理解的是,上述终端等为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明实施例的范围。
本申请实施例可以根据上述方法示例对上述终端等进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件 产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (14)

  1. 一种MVVM架构的应用的开发方法,其特征在于,应用于应用的开发设备,所述方法包括:
    接收用户定义的第一应用中后台数据中的ViewModel对象,以及所述用户定义的所述第一应用的UI界面描述文件;
    解析所述UI界面描述文件,并识别出所述UI界面描述文件中第一UI控件与所述ViewModel对象的绑定关系;
    为所述第一UI控件设置监听,用于更新所述ViewModel对象;
    设置所述ViewModel对象的实例,并为所述实例设置监听,用于更新所述第一UI控件;
    当监听到所述第一UI控件发生变化,或者监听到所述实例发生变化,更新所述第一应用的第一UI界面。
  2. 根据权利要求1所述的方法,其特征在于,所述第一应用的UI界面描述文件支持至少两种界面描述语言,所述至少两种界面描述语言包括可扩展标记语言xml、领域专用语言DSL或嵌入式领域专用语言EDSL中任两项。
  3. 根据权利要求1或2所述的方法,其特征在于,所述ViewModel对象包括一个或多个成员,所述第一UI控件包括一个或多个元素;
    所述第一UI控件与所述ViewModel对象的绑定关系,包括:
    所述第一UI控件中第一元素与ViewModel对象中第一成员具有对应关系。
  4. 根据权利要求3所述的方法,其特征在于,所述当监听到所述第一UI控件发生变化,或者监听到所述实例发生变化,更新所述第一应用的第一UI界面,具体为:
    当监听到所述用户修改所述ViewModel对象中所述第一成员的内容时,自动更新所述第一UI界面中所述第一元素的内容;
    当监听到所述用户修改所述第一UI界面中所述第一元素的内容时,自动更新所述ViewModel对象中所述第一成员的内容。
  5. 根据权利要求3或4所述的方法,其特征在于,所述开发设备存储有注册表,所述注册表记录所述第一UI控件的所述第一元素的标识,与所述ViewModel对象中所述第一成员的标识的对应关系。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述开发设备包括用于解析所述UI界面描述文件的解析引擎,所述解析引擎包含所述第一UI控件与所述
    ViewModel对象的绑定关系的语法逻辑定义。
  7. 一种基于MVVM架构的应用的开发设备,其特征在于,所述开发设备包括处理器、显示屏,以及存储器,所述显示屏,所述存储器与所述处理器耦合,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述处理器从所述存储器中读取所述计算机指令,以使得所述开发设备执行如下操作:
    接收用户定义的第一应用中后台数据中的ViewModel对象,以及所述用户定义的所述第一应用的UI界面描述文件;
    解析所述UI界面描述文件,并识别出所述UI界面描述文件中第一UI控件与所述ViewModel对象的绑定关系;
    为所述第一UI控件设置监听,用于更新所述ViewModel对象;
    设置所述ViewModel对象的实例,并为所述实例设置监听,用于更新所述第一UI控件;
    当监听到所述第一UI控件发生变化,或者监听到所述实例发生变化,更新所述第一应用的第一UI界面。
  8. 根据权利要求7所述的开发设备,其特征在于,所述第一应用的UI界面描述文件支持至少两种界面描述语言,所述至少两种界面描述语言包括可扩展标记语言xml、领域专用语言DSL或嵌入式领域专用语言EDSL中任两项。
  9. 根据权利要求7或8所述的开发设备,其特征在于,所述ViewModel对象包括一个或多个成员,所述第一UI控件包括一个或多个元素;
    所述第一UI控件与所述ViewModel对象的绑定关系,包括:
    所述第一UI控件中第一元素与ViewModel对象中第一成员具有对应关系。
  10. 根据权利要求9所述的开发设备,其特征在于,所述当监听到所述第一UI控件发生变化,或者监听到所述实例发生变化,更新所述第一应用的第一UI界面,具体为:
    当监听到所述用户修改所述ViewModel对象中所述第一成员的内容时,自动更新所述第一UI界面中所述第一元素的内容;
    当监听到所述用户修改所述第一UI界面中所述第一元素的内容时,自动更新所述ViewModel对象中所述第一成员的内容。
  11. 根据权利要求9或10所述的开发设备,其特征在于,所述开发设备存储有注册表,所述注册表记录所述第一UI控件的所述第一元素的标识,与所述ViewModel对象中所述第一成员的标识的对应关系。
  12. 根据权利要求7-11任一项所述的开发设备,其特征在于,所述开发设备包括用于解析所述UI界面描述文件的解析引擎,所述解析引擎包含所述第一UI控件与所述ViewModel对象的绑定关系的语法逻辑定义。
  13. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在开发设备上运行时,使得所述开发设备执行如权利要求1-6中任一项所述的方法。
  14. 一种计算机程序产品,其特征在于,当计算机程序产品在计算机上运行时,使得计算机执行如权利要求1-6中任一项所述的方法。
PCT/CN2021/123319 2020-10-22 2021-10-12 一种mvvm架构的应用的开发方法及终端 WO2022083477A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21881895.3A EP4216052A4 (en) 2020-10-22 2021-10-12 METHOD FOR DEVELOPING AN APPLICATION BASED ON MVVM ARCHITECTURE, AND TERMINAL
US18/250,055 US20230393820A1 (en) 2020-10-22 2021-10-12 MVVM Architecture-Based Application Development Method and Terminal

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202011141087.6 2020-10-22
CN202011141087 2020-10-22
CN202110163963.3 2021-02-05
CN202110163963.3A CN114385163A (zh) 2020-10-22 2021-02-05 一种mvvm架构的应用的开发方法及终端

Publications (1)

Publication Number Publication Date
WO2022083477A1 true WO2022083477A1 (zh) 2022-04-28

Family

ID=81195022

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/123319 WO2022083477A1 (zh) 2020-10-22 2021-10-12 一种mvvm架构的应用的开发方法及终端

Country Status (4)

Country Link
US (1) US20230393820A1 (zh)
EP (1) EP4216052A4 (zh)
CN (1) CN114385163A (zh)
WO (1) WO2022083477A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107885497A (zh) * 2017-11-08 2018-04-06 北京锐安科技有限公司 一种基于表格框架的网页前端数据展示方法及装置
CN108845856A (zh) * 2018-06-11 2018-11-20 腾讯科技(深圳)有限公司 数据绑定方法、装置、存储介质及设备
CN109753273A (zh) * 2017-11-06 2019-05-14 芜湖美的厨卫电器制造有限公司 基于mvvm框架的物联网应用开发方法、装置及其设备
CN110321183A (zh) * 2018-03-29 2019-10-11 优酷网络技术(北京)有限公司 一种公共组件ui界面的配置系统及方法
US20200204442A1 (en) * 2014-03-11 2020-06-25 International Communications Corp. User Exchange Interface (UXI) System, Apparatus, and Method Thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200204442A1 (en) * 2014-03-11 2020-06-25 International Communications Corp. User Exchange Interface (UXI) System, Apparatus, and Method Thereof
CN109753273A (zh) * 2017-11-06 2019-05-14 芜湖美的厨卫电器制造有限公司 基于mvvm框架的物联网应用开发方法、装置及其设备
CN107885497A (zh) * 2017-11-08 2018-04-06 北京锐安科技有限公司 一种基于表格框架的网页前端数据展示方法及装置
CN110321183A (zh) * 2018-03-29 2019-10-11 优酷网络技术(北京)有限公司 一种公共组件ui界面的配置系统及方法
CN108845856A (zh) * 2018-06-11 2018-11-20 腾讯科技(深圳)有限公司 数据绑定方法、装置、存储介质及设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4216052A4

Also Published As

Publication number Publication date
EP4216052A4 (en) 2024-03-13
EP4216052A1 (en) 2023-07-26
CN114385163A (zh) 2022-04-22
US20230393820A1 (en) 2023-12-07

Similar Documents

Publication Publication Date Title
WO2022199111A1 (zh) 应用程序中功能的实现方法、装置、电子设备和存储介质
WO2021018005A1 (zh) 一种跨进程通信方法、装置及设备
WO2021027630A1 (zh) 补丁方法、相关装置及系统
WO2021052167A1 (zh) 一种实现应用插件化的方法及电子设备
CN114968384B (zh) 一种功能调用方法和装置
WO2021027772A1 (zh) 一种应用切换运行的方法及设备
CN115309431B (zh) 一种参数更新方法、可读介质和电子设备
KR20140142116A (ko) 텍스트 변환 서비스를 제공하는 전자장치 및 방법
WO2021057390A1 (zh) 一种启动快应用的方法及相关装置
WO2022083477A1 (zh) 一种mvvm架构的应用的开发方法及终端
CN115576623B (zh) 一种应用程序启动方法及装置
WO2022252804A1 (zh) 显示视图控件的方法及装置
US11875035B2 (en) Electronic device and method for managing memory using the same
WO2022111664A1 (zh) 打补丁的方法、相关设备及系统
CN110399040B (zh) 多模态交互方法、用户端设备、服务器及系统
WO2024067205A9 (zh) 应用接续方法和终端设备
WO2022206685A1 (zh) 一种应用界面开发方法及装置
WO2023169212A1 (zh) 一种识别应用程序中sdk的方法、终端及服务器
WO2024114451A1 (zh) 一种跨系统内容显示方法及设备
WO2022188766A1 (zh) 一种应用程序的显示方法及电子设备
WO2023245375A1 (zh) wasm快应用框架数据绑定方法和装置、电子设备、存储介质
WO2024131458A1 (zh) 应用下载方法、服务器、电子设备及系统
WO2022166553A1 (zh) 一种实现批量系统调用的方法及装置
WO2023169157A1 (zh) 子应用程序的运行方法、装置、电子设备、程序产品及存储介质
WO2024083114A1 (zh) 一种软件分发方法、电子设备及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21881895

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021881895

Country of ref document: EP

Effective date: 20230419

NENP Non-entry into the national phase

Ref country code: DE