CN112685040A - Method, device, equipment and storage medium for generating interface file in android system - Google Patents

Method, device, equipment and storage medium for generating interface file in android system Download PDF

Info

Publication number
CN112685040A
CN112685040A CN202110089074.7A CN202110089074A CN112685040A CN 112685040 A CN112685040 A CN 112685040A CN 202110089074 A CN202110089074 A CN 202110089074A CN 112685040 A CN112685040 A CN 112685040A
Authority
CN
China
Prior art keywords
interface
file
target
template file
mode
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
CN202110089074.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.)
Aiways Automobile Co Ltd
Aiways Automobile Shanghai Co Ltd
Original Assignee
Aiways Automobile Shanghai 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 Aiways Automobile Shanghai Co Ltd filed Critical Aiways Automobile Shanghai Co Ltd
Priority to CN202110089074.7A priority Critical patent/CN112685040A/en
Publication of CN112685040A publication Critical patent/CN112685040A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The application provides a method, a device, equipment and a storage medium for generating an interface file in an android system, wherein the method comprises the following steps: according to the selection operation aiming at the target architecture mode, the corresponding relation between the preset architecture mode and the interface attribute is adopted to determine the target interface attribute corresponding to the target architecture mode, according to the target interface attribute, the target template file corresponding to the target interface attribute is loaded from the pre-configured interface template file, and the configuration interface of the target template file is displayed, wherein the interface template file comprises template files corresponding to various interface attributes, and according to the parameter configuration operation aiming at the configuration interface, the interface file of the target architecture mode is generated. According to the method and the device, the target template file is loaded according to the selected target architecture mode, and then the target template file is configured, so that the interface file of the target architecture mode can be generated.

Description

Method, device, equipment and storage medium for generating interface file in android system
Technical Field
The application relates to the technical field of software development, in particular to a method, a device, equipment and a storage medium for generating an interface file in an android system.
Background
With the rapid development of android technologies, developers can develop Application (APP) interfaces based on an android platform. Currently, common interface development tools include Eclipse, IntelliJ IDEA, and Android Studio, and corresponding interface templates can be developed by using each interface development tool, so that developers can develop interfaces based on the interface templates by combining actual service requirements.
At present, in some practical projects, interface architectures provided by each interface development tool are basically a (Model-View-Presenter, MVP) mode or a (Model-View Model, MVVM) mode, in each interface architecture, a plurality of template files need to be created when an APP interface is created, and then corresponding parameters are input in the template files according to actual service requirements.
However, since many similar files exist in the template file created each time, the development efficiency is low by adopting the above-mentioned method.
Disclosure of Invention
An object of the present application is to provide a method, an apparatus, a device, and a storage medium for generating an interface file in an android system, so as to solve the problem of low development efficiency caused by a large number of similar files in template files created each time in the prior art.
In order to achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
in a first aspect, an embodiment of the present application provides a method for generating an interface file in an android system, where the method includes:
according to the selection operation aiming at the target architecture mode, adopting a preset corresponding relation between the architecture mode and the interface attribute to determine the target interface attribute corresponding to the target architecture mode;
loading a target template file corresponding to the target interface attribute from a pre-configured interface template file according to the target interface attribute, and displaying a configuration interface of the target template file, wherein the interface template file comprises template files corresponding to various interface attributes;
and generating an interface file of the target architecture mode according to the parameter configuration operation aiming at the configuration interface.
In an optional embodiment, the method further comprises:
determining an interface mode according to an input interface creating operation, wherein the interface mode is a global interface mode or a local interface mode;
the loading a target template file corresponding to the target interface attribute from a pre-configured interface template file according to the target interface attribute comprises:
determining a first template file corresponding to the target interface attribute from the interface template files according to the target interface attribute;
and loading a second template file corresponding to the interface mode from the first template file, wherein the second template file is the target template file.
In an optional embodiment, the method further comprises:
loading the interface template file and a description file corresponding to the interface template file through a preset storage directory, wherein the description file comprises description information of parameters in the interface template file;
the configuration interface displays: the description information.
In an optional embodiment, before loading, according to the target interface attribute, a target template file corresponding to the target interface attribute from a pre-configured interface template file, the method further includes:
creating initial interface template files corresponding to a plurality of architecture modes;
and generating the interface template file according to the configuration operation aiming at the initial interface template file.
In an optional embodiment, the method further comprises:
creating and configuring a description file corresponding to the interface template file;
and storing the interface template file and the description file in a storage path corresponding to the preset storage directory.
In an optional embodiment, the description file further includes: and the interface template file corresponds to a directory structure of a plurality of category files.
In an optional embodiment, if the target architecture mode is a preset architecture mode and the interface mode is a global interface mode, the target template file includes: the method comprises the steps that a data acquisition file, a service logic file, a layout file and a list file are included, wherein the list file comprises a plurality of interface files, and each interface file is used for defining content information contained in a corresponding area in a global interface;
if the target architecture mode is the preset architecture mode and the interface mode is a local interface mode, the target template file comprises: and the target interface file comprises content information contained in a local interface.
In a second aspect, another embodiment of the present application provides an apparatus for generating an interface file in an android system, where the apparatus includes:
the determining module is used for determining a target interface attribute corresponding to a target architecture mode by adopting a preset corresponding relation between the architecture mode and the interface attribute according to the selection operation aiming at the target architecture mode;
the loading module is used for loading a target template file corresponding to the target interface attribute from a pre-configured interface template file according to the target interface attribute and displaying a configuration interface of the target template file, wherein the interface template file comprises template files corresponding to various interface attributes;
and the generating module is used for generating the interface file of the target architecture mode according to the parameter configuration operation aiming at the configuration interface.
In an optional embodiment, the determining module is further configured to:
determining an interface mode according to an input interface creating operation, wherein the interface mode is a global interface mode or a local interface mode;
the loading module is specifically configured to:
determining a first template file corresponding to the target interface attribute from the interface template files according to the target interface attribute;
and loading a second template file corresponding to the interface mode from the first template file, wherein the second template file is the target template file.
In an optional implementation manner, the loading module is further configured to:
loading the interface template file and a description file corresponding to the interface template file through a preset storage directory, wherein the description file comprises description information of parameters in the interface template file;
the configuration interface displays: the description information.
In an optional embodiment, the apparatus further comprises:
the creating module is used for creating and configuring a description file corresponding to the interface template file;
and the storage module is used for storing the interface template file and the description file in a storage path corresponding to the preset storage directory.
In an optional embodiment, the description file further includes: and the interface template file corresponds to a directory structure of a plurality of category files.
In an optional embodiment, if the target architecture mode is a preset architecture mode and the interface mode is a global interface mode, the target template file includes: the method comprises the steps that a data acquisition file, a service logic file, a layout file and a list file are included, wherein the list file comprises a plurality of interface files, and each interface file is used for defining content information contained in a corresponding area in a global interface;
if the target architecture mode is the preset architecture mode and the interface mode is a local interface mode, the target template file comprises: and the target interface file comprises content information contained in a local interface.
In a third aspect, another embodiment of the present application provides an electronic device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the method according to any one of the first aspect.
In a fourth aspect, another embodiment of the present application provides a storage medium having a computer program stored thereon, where the computer program is executed by a processor to perform the method according to any one of the above first aspects.
The application provides a method, a device, equipment and a storage medium for generating an interface file in an android system, wherein the method comprises the following steps: according to the selection operation aiming at the target architecture mode, the corresponding relation between the preset architecture mode and the interface attribute is adopted to determine the target interface attribute corresponding to the target architecture mode, according to the target interface attribute, the target template file corresponding to the target interface attribute is loaded from the pre-configured interface template file, and the configuration interface of the target template file is displayed, wherein the interface template file comprises template files corresponding to various interface attributes, and according to the parameter configuration operation aiming at the configuration interface, the interface file of the target architecture mode is generated. According to the method and the device, the target template file is loaded according to the selected target architecture mode, and then the target template file is configured, so that the interface file of the target architecture mode can be generated.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 shows a first flowchart of a method for generating an interface file in an android system, which is provided by the embodiment of the present application;
fig. 2 shows a flow diagram ii of a method for generating an interface file in an android system provided in the embodiment of the present application;
fig. 3 shows a third flowchart of a method for generating an interface file in an android system, provided by the embodiment of the present application;
fig. 4 shows a schematic structural diagram of a device for generating an interface file in an android system provided in the embodiment of the present application;
fig. 5 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
Aiming at the problems that a plurality of template files are required to be created when an Application program (APP) interface is created every time in the prior art, and because a plurality of similar files exist in the created template files every time, the development efficiency is low, the Application provides a method for generating the interface file in the android system.
The following specifically describes, with reference to several specific embodiments, a method for generating an interface file in an android system provided by the present application.
Fig. 1 shows a schematic flow diagram of a method for generating an interface file in an android system, which is provided in an embodiment of the present application. As shown in fig. 1, the method may include:
s101, according to the selection operation aiming at the target architecture mode, the target interface attribute corresponding to the target architecture mode is determined by adopting the preset corresponding relation between the architecture mode and the interface attribute.
Common interface development tools comprise Eclipse, IntelliJ IDEA and Android Studio, wherein the Eclipse is a cross-platform open source integrated development environment; the Android Studio is an Android integrated development tool derived from google, and provides an integrated Android development tool for development and debugging based on IntelliJ IDEA, similar to Eclipse ADT. Each interface development tool provides a plurality of architectural modes, which may include, for example, an MVP mode and an MVVM mode.
In practical application, the target architecture mode may be an MVP mode or an MVVM mode, and is to solve the problem that in the prior art, when an APP interface is created based on an interface development tool, many similar template files need to be created each time, which results in low development efficiency. In this embodiment, a developer may open any interface development tool installed on an electronic device, and input a selection operation for a target architecture mode in a development interface provided by the interface development tool, that is, select the target architecture mode, and accordingly, the electronic device may determine a target interface attribute corresponding to the target architecture mode by using a preset corresponding relationship between the architecture mode and the interface attribute according to the input selection operation for the target architecture mode.
The interface attribute may include at least one of an interface content attribute, an interface layout attribute, a data acquisition attribute, and a service logic attribute.
The interface content attribute may be attribute information of content presented in the interface, the interface layout attribute may be layout information of the interface, including length and width of the interface, the data acquisition attribute may be a data acquisition mode in the interface, and the service logic attribute may be logic information of service data in the interface.
The corresponding relationship between the architecture mode and the interface attribute may be a corresponding relationship between a pre-established architecture mode and an interface attribute, that is, the interface attributes corresponding to different architecture modes may be different, taking the architecture mode as an MVVM mode as an example, the target interface attribute corresponding to the MVVM mode may include an interface content attribute, an interface layout attribute, an interface data acquisition attribute, and an interface service logic attribute.
S102, loading a target template file corresponding to the target interface attribute from the pre-configured interface template file according to the target interface attribute, and displaying a configuration interface of the target template file.
S103, generating an interface file of the target architecture mode according to the parameter configuration operation aiming at the configuration interface.
After the target interface attribute corresponding to the target architecture mode is determined, a target template file corresponding to the target interface attribute can be loaded from pre-configured interface template files according to the target interface attribute, wherein the interface template files comprise template files corresponding to various interface attributes. That is, the interface attribute and the template file have a corresponding relationship, and after the target interface attribute is determined, the target template file corresponding to the target interface attribute can be determined from the pre-configured interface template files.
Similarly, taking the MVVM mode as an example, the target interface attribute corresponding to the MVVM mode includes an interface content attribute, an interface layout attribute, a data acquisition attribute, and an attribute of service logic, and then the target template file corresponding to the target interface attribute may include a manifest file, a layout file, a data acquisition file, and a service logic file.
The manifest file comprises a plurality of interface files, each interface file is used for defining content information contained in a corresponding area in an interface to be created, the layout file is used for defining layout information of the interface to be created, the data acquisition file is used for defining a data acquisition method of the interface to be created, and the service logic information is used for defining service logic information of the interface to be created.
When the target template file corresponding to the target interface attribute is loaded, the configuration interface of the target template file can be displayed, so that a developer can input parameter configuration operation aiming at the configuration interface, correspondingly, the electronic equipment performs parameter configuration on the target template file according to the input parameter configuration operation aiming at the configuration interface, and further generates an interface file of a target architecture mode, and thus, an interface can be created based on the interface file.
It should be noted that the configuration interface of the target template file may be an interface to be subjected to parameter configuration, that is, a developer may perform parameter configuration based on the configuration interface of the target template file according to an actual development requirement, taking the example that the target template file includes a layout file, where the layout file includes an interface length to be configured and an interface width to be configured, and then the developer may input a parameter configuration operation for the configuration interface of the layout file, perform parameter configuration of the interface length and the interface width on the layout file, and generate an interface file of the target architecture mode.
According to the method for generating the interface file in the android system, the target interface attribute corresponding to the target architecture mode is determined by adopting the preset corresponding relation between the architecture mode and the interface attribute according to the selection operation aiming at the target architecture mode, the target template file corresponding to the target interface attribute is loaded from the pre-configured interface template file according to the target interface attribute, the configuration interface of the target template file is displayed, wherein the interface template file comprises template files corresponding to various interface attributes, and the interface file of the target architecture mode is generated according to the parameter configuration operation aiming at the configuration interface. In this embodiment, the target template file is loaded according to the selected target architecture mode, and then the target template file is configured, so that the interface file of the target architecture mode can be generated.
In an optional embodiment, before step S102, the method may further include:
and loading the interface template file and the description file corresponding to the interface template file through a preset storage directory.
When the interface template file is configured in advance, a description file corresponding to the interface template file can be configured, the description file comprises description information of parameters in the interface template file, and the configuration interface displays: the description information, that is, the description file is used to describe a preconfigured interface template file, and the preconfigured interface template file and the description file may be stored in a storage path corresponding to a preset storage target, then before step S102, the interface template file and the description file corresponding to the interface template file may also be loaded through a preset storage directory, where the description file includes description information of parameters in the interface template file, and the configuration interface displays: information is described. Therefore, the description file can be determined to assist the developer in knowing the meaning of the parameters in the interface template file, and the developer can more accurately perform parameter configuration operation based on the configuration interface based on the description information displayed on the configuration interface.
In an alternative implementation, the steps shown in the embodiment of fig. 2 may also be performed. Fig. 2 shows a flow diagram ii of a method for generating an interface file in an android system provided in the embodiment of the present application, and as shown in fig. 2, the method may further include:
s201, determining an interface mode according to the input interface creating operation.
The interface mode is a global interface mode or a local interface mode, the global interface mode may be called an Activity mode, and the local interface mode may be called a fragment mode.
The developer can input an interface creating operation in a development interface provided by the interface development tool, and accordingly, the electronic device determines an interface mode according to the input interface creating operation, wherein the interface development tool can provide an interface creating option, and after the developer selects the interface creating option, the interface mode can be selected from an interface creating window provided by the interface creating option, that is, the electronic device determines the interface mode according to the input interface creating operation.
S101, according to the selection operation aiming at the target architecture mode, the target interface attribute corresponding to the target architecture mode is determined by adopting the preset corresponding relation between the architecture mode and the interface attribute.
Then, step S101, that is, selecting the target architecture mode, and determining the target interface attribute corresponding to the target architecture mode may be executed, and of course, step S201 may also be executed after step S101, which may specifically be based on an actual interface development tool, and this embodiment does not need to be particularly limited.
Step S102 may be executed, that is, the target template file corresponding to the target interface attribute is loaded from the pre-configured interface template file, and the configuration interface of the target template file is displayed.
Wherein step S102 may comprise S202-S203.
S202, according to the target interface attribute, determining a first template file corresponding to the target interface attribute from the interface template files.
And S203, loading a second template file corresponding to the interface mode from the first template file.
According to the target interface attribute corresponding to the determined target architecture mode, a first template file corresponding to the target interface attribute can be determined from a pre-configured interface template file, and then a second template file corresponding to the interface mode is loaded from the first template file, wherein the second template file is the target template file. That is, the target template file may be determined from the pre-configured interface template file by considering both the target interface attribute and the interface mode.
In an optional embodiment, if the target architecture mode is a preset architecture mode and the interface mode is a global interface mode, the target template file includes: the system comprises a data acquisition file, a service logic file, a layout file and a list file, wherein the list file comprises a plurality of interface files, and each interface file is used for defining content information contained in a corresponding area in a global interface.
If the target architecture mode is a preset architecture mode and the interface mode is a local interface mode, the target template file comprises: and the data acquisition file, the service logic file, the layout file and the target interface file in the list file.
If the preset architecture mode can be an MVVM mode, and if the target architecture mode is the MVVM mode and the interface mode is an Activity mode, the target template file includes: a data acquisition file, a business logic file, a layout file, and a manifest file.
It should be noted that the interface mode is an Activity mode, which indicates that the interface to be created is a global interface to be created, the manifest file includes a plurality of interface files, each interface file is used to define content information included in a corresponding area in the global interface, that is, the manifest file is used to define content information included in each area in the global interface.
If the preset architecture mode can be an MVVM mode, and if the target architecture mode is the MVVM mode and the interface mode is a fragment mode, the target template file comprises a target interface file in a data acquisition file, a service logic file, a layout file and a list file.
It should be noted that, if the interface mode is an Activity mode, and it is indicated that the interface to be created is a local interface to be created, only the target interface file in the list file needs to be cleared, where the target interface file includes content information included in the local interface, that is, the interface file in the list file for defining other areas is not needed, and the interface file may include an identifier of the corresponding local interface, so that it is convenient to load the target interface file corresponding to the corresponding area from the list file.
In practical application, taking the target architecture mode as the MVVM mode as an example, when a fragment interface is newly created, a developer can select the MVVM mode, and the name of the interface file is customized, a file package can be automatically generated according to the name of the created customized interface file, the file package includes four target template files, which are an interface file, a layout file, a data acquisition file and a service logic file, and certainly, if an Activity interface is newly created, the four target template files may include a manifest file, a layout file, a data acquisition file and a business logic file, and then parameter configuration can be carried out on the target template file to generate an interface file, the interface file is compiled and run to carry out interface creation, if the file report is red, the compiling is wrong, and the interface file can be recompiled or restarted until the interface creation is completed. Wherein, the system can automatically add without adding Activity or fragment during naming.
The interface template file and the description file corresponding to the interface template file can be loaded through a preset storage directory, wherein the description file comprises the description information of parameters in the interface template file, and the configuration interface displays: the information is described, so that parameter configuration can be performed more accurately based on the description file.
In addition, the description file may further include: the interface template file is corresponding to a directory structure of a plurality of types of files, that is, different types of files in the interface template file correspond to a directory structure. Taking the above example as an example, according to the name of the created custom interface file, a file package is automatically generated, where the file package may include 2 directory structures and 4 files, and the 2 directory structures may include, for example, a viewmodel directory and a model directory, the viewmodel directory includes a service logic file (denoted as infoview model.
It should be noted that, when an interface development tool such as android studio is opened, a globals.xml.ftl file in the MVVM directory may also be modified, a mailbox behind a < global id ═ author "value ═ xxx @ xxx.com"/> value is changed into a developer mailbox, and then a target template file corresponding to the MVVM mode is copied to a corresponding path, as shown below:
windows AS installation directory/plugins/android/lib/templates/gradle-projects
Mac:/Applications/AndroidStudio.app/Contents/plugins/android/lib/
templates/gradle-projects, and restart the MVVM mode to enable the above operations.
According to the method for generating the interface file in the android system, an interface mode is determined according to input interface creating operation, the interface mode is a global interface mode or a local interface mode, a target interface attribute corresponding to a target architecture mode is determined according to selection operation aiming at the target architecture mode by adopting a preset corresponding relation between the architecture mode and the interface attribute, a first template file corresponding to the target interface attribute is determined from an interface template file according to the target interface attribute, a second template file corresponding to the interface mode is loaded from the first template file, and the second template file is a target template file. In the embodiment, the interface mode and the target interface attribute are taken as consideration factors, so that the acquisition accuracy of the target template file is improved.
In an alternative embodiment, before step S102, the steps shown in the embodiment of fig. 3 may also be performed. Fig. 3 shows a third flowchart of the method for generating an interface file in an android system provided in the embodiment of the present application, as shown in fig. 3, before step S102, the method may further include:
s301, establishing initial interface template files corresponding to a plurality of architecture modes.
And S302, generating an interface template file according to the configuration operation aiming at the initial interface template file.
The interface development tool can create initial interface template files corresponding to a plurality of architecture modes, namely the architecture modes correspond to one initial interface template file. The plurality of architecture modes can comprise an MVP mode and an MVVM mode, the interface template file can comprise an interface file, a data processing file, a data acquisition file and a service logic file, in practical application, an interface development tool is taken as an example of Android Studio, the Android Studio provides a development interface, a creation option of an initial interface template file is provided in the development interface, the initial interface template file can be sequentially created by clicking the creation option of the initial interface template file, and the interface template file is generated according to configuration operation aiming at the initial interface template file.
It should be noted that the initial interface template file may be a default template provided by the system, and then the configuration operation for the initial interface template file may be input according to the actual development requirement, that is, the parameter names required in the initial interface template file, such as the interface length and the interface width, are customized, and the interface template file is generated, that is, the Android Studio file group template is based on the Freemarker template language, and therefore, the interface template file required may be customized.
In an optional embodiment, the method further comprises:
and creating and configuring a description file corresponding to the interface template file.
And storing the interface template file and the description file in a storage path corresponding to a preset storage directory.
And if the description file comprises the description information of the parameters in the interface template file, creating and configuring the description file corresponding to the interface template file, and storing the interface template file and the description file in a storage path corresponding to a preset storage directory.
In an optional embodiment, the description file further includes: and the interface template file corresponds to a directory structure of a plurality of category files.
In an actual application process, for example, the Android Studio develops the MVVM, and other interface development tools are similar. Because the Android Studio file group template is based on the Freemarker template language, a desired interface template playing file, namely an MVVM template, can be customized. The method specifically comprises the following steps:
first, a project is created.
And secondly, creating and configuring to obtain an interface template file, wherein the interface template file comprises an interface file, a data processing file, a data acquisition file and a service logic file which are respectively recorded as: infoactivity. java. ftl, infofragment. java. ftl, infomodel. java. ftl, infoviewmodel. java. ftl.
And thirdly, creating a layout file, and recording as: res/layout/simple. xml.
And fourthly, creating a manifest file, namely combining the created interface files into the interface file android manifest.
And step five, creating a description file which is respectively recorded as: the description file is a configuration file required by Android Studio, and is used for generating description of the interface template file, directory structures of a plurality of category files corresponding to the interface template file, and the like.
According to the method for generating the interface file in the android system, the initial interface template files corresponding to the plurality of architecture modes are created, and the interface template file is generated according to configuration operation aiming at the initial interface template files. By the method, the interface template file can be generated in advance, and the target template file can be determined from the interface template file conveniently in the follow-up process.
Fig. 4 shows a schematic structural diagram of a device for generating an interface file in an android system provided in the embodiment of the present application, where the device for generating an interface file in an android system may be integrated in an electronic device. As shown in fig. 4, the generating device 40 for an interface file in the android system may include:
a determining module 401, configured to determine, according to a selection operation for a target architecture mode, a target interface attribute corresponding to the target architecture mode by using a preset corresponding relationship between an architecture mode and an interface attribute;
a loading module 402, configured to load a target template file corresponding to the target interface attribute from a pre-configured interface template file according to the target interface attribute, and display a configuration interface of the target template file, where the interface template file includes template files corresponding to multiple interface attributes;
a generating module 403, configured to generate an interface file of the target architecture mode according to a parameter configuration operation for the configuration interface.
In an optional implementation manner, the determining module 401 is further configured to:
determining an interface mode according to an input interface creating operation, wherein the interface mode is a global interface mode or a local interface mode;
the loading module 402 is specifically configured to:
determining a first template file corresponding to the target interface attribute from the interface template files according to the target interface attribute;
and loading a second template file corresponding to the interface mode from the first template file, wherein the second template file is the target template file.
In an optional implementation manner, the loading module 402 is further configured to:
loading the interface template file and a description file corresponding to the interface template file through a preset storage directory, wherein the description file comprises description information of parameters in the interface template file;
the configuration interface displays: the description information.
In an optional embodiment, the apparatus further comprises:
a creating module 404, configured to create and configure a description file corresponding to the interface template file;
a storage module 405, configured to store the interface template file and the description file in a storage path corresponding to the preset storage directory.
In an optional embodiment, the description file further includes: and the interface template file corresponds to a directory structure of a plurality of category files.
In an optional embodiment, if the target architecture mode is a preset architecture mode and the interface mode is a global interface mode, the target template file includes: the method comprises the steps that a data acquisition file, a service logic file, a layout file and a list file are included, wherein the list file comprises a plurality of interface files, and each interface file is used for defining content information contained in a corresponding area in a global interface;
if the target architecture mode is the preset architecture mode and the interface mode is a local interface mode, the target template file comprises: and the target interface file comprises content information contained in a local interface.
For the implementation process and the implementation principle of the generation device of the interface file in the android system in this embodiment, reference may be made to the generation method of the interface file in the android system in the above method embodiment, which is not described herein again.
Fig. 5 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application, and as shown in fig. 5, an electronic device 50 includes: a processor 501, a memory 502 and a bus 503, wherein the memory 502 stores machine-readable instructions executable by the processor 501, when the electronic device 50 runs, the processor 501 and the memory 502 communicate with each other through the bus 503, and the processor 501 executes the machine-readable instructions to perform the above-mentioned method embodiments.
The embodiment of the present application further provides a storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the above method embodiments.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to corresponding processes in the method embodiments, and are not described in detail in this application. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and there may be other divisions in actual implementation, and for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application.

Claims (10)

1. A generation method of an interface file in an android system is characterized by comprising the following steps:
according to the selection operation aiming at the target architecture mode, adopting a preset corresponding relation between the architecture mode and the interface attribute to determine the target interface attribute corresponding to the target architecture mode;
loading a target template file corresponding to the target interface attribute from a pre-configured interface template file according to the target interface attribute, and displaying a configuration interface of the target template file, wherein the interface template file comprises template files corresponding to various interface attributes;
and generating an interface file of the target architecture mode according to the parameter configuration operation aiming at the configuration interface.
2. The method of claim 1, further comprising:
determining an interface mode according to an input interface creating operation, wherein the interface mode is a global interface mode or a local interface mode;
the loading a target template file corresponding to the target interface attribute from a pre-configured interface template file according to the target interface attribute comprises:
determining a first template file corresponding to the target interface attribute from the interface template files according to the target interface attribute;
and loading a second template file corresponding to the interface mode from the first template file, wherein the second template file is the target template file.
3. The method of claim 1, further comprising:
loading the interface template file and a description file corresponding to the interface template file through a preset storage directory, wherein the description file comprises description information of parameters in the interface template file;
the configuration interface displays: the description information.
4. The method according to claim 3, wherein before loading the target template file corresponding to the target interface attribute from the pre-configured interface template file according to the target interface attribute, the method further comprises:
creating initial interface template files corresponding to a plurality of architecture modes;
and generating the interface template file according to the configuration operation aiming at the initial interface template file.
5. The method of claim 4, further comprising:
creating and configuring a description file corresponding to the interface template file;
and storing the interface template file and the description file in a storage path corresponding to the preset storage directory.
6. The method according to claim 3 or 5, wherein the description file further comprises: and the interface template file corresponds to a directory structure of a plurality of category files.
7. The method of claim 2, wherein if the target architecture mode is a default architecture mode and the interface mode is a global interface mode, the target template file comprises: the method comprises the steps that a data acquisition file, a service logic file, a layout file and a list file are included, wherein the list file comprises a plurality of interface files, and each interface file is used for defining content information contained in a corresponding area in a global interface;
if the target architecture mode is the preset architecture mode and the interface mode is a local interface mode, the target template file comprises: and the target interface file comprises content information contained in a local interface.
8. An interface file generation device in an android system is characterized by comprising:
the determining module is used for determining a target interface attribute corresponding to a target architecture mode by adopting a preset corresponding relation between the architecture mode and the interface attribute according to the selection operation aiming at the target architecture mode;
the loading module is used for loading a target template file corresponding to the target interface attribute from a pre-configured interface template file according to the target interface attribute and displaying a configuration interface of the target template file, wherein the interface template file comprises template files corresponding to various interface attributes;
and the generating module is used for generating the interface file of the target architecture mode according to the parameter configuration operation aiming at the configuration interface.
9. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the method of any of claims 1 to 7.
10. A storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, performs the method of any one of claims 1 to 7.
CN202110089074.7A 2021-01-22 2021-01-22 Method, device, equipment and storage medium for generating interface file in android system Pending CN112685040A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110089074.7A CN112685040A (en) 2021-01-22 2021-01-22 Method, device, equipment and storage medium for generating interface file in android system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110089074.7A CN112685040A (en) 2021-01-22 2021-01-22 Method, device, equipment and storage medium for generating interface file in android system

Publications (1)

Publication Number Publication Date
CN112685040A true CN112685040A (en) 2021-04-20

Family

ID=75459005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110089074.7A Pending CN112685040A (en) 2021-01-22 2021-01-22 Method, device, equipment and storage medium for generating interface file in android system

Country Status (1)

Country Link
CN (1) CN112685040A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535165A (en) * 2021-06-11 2021-10-22 中电金信软件有限公司 Interface generation method and device, electronic equipment and computer readable storage medium
CN115586896A (en) * 2022-09-29 2023-01-10 通号智慧城市研究设计院有限公司 Page project development method, equipment and storage medium based on template engine

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120317504A1 (en) * 2011-06-13 2012-12-13 Microsoft Corporation Automated user interface object transformation and code generation
CN105912710A (en) * 2016-04-28 2016-08-31 深圳市金立通信设备有限公司 File management method and terminal
WO2017007466A1 (en) * 2015-07-08 2017-01-12 Hewlett Packard Enterprise Development Lp Orchestration template generation
CN110286896A (en) * 2019-06-28 2019-09-27 百度在线网络技术(北京)有限公司 Visualizing editing method, device, equipment and storage medium
CN110532029A (en) * 2019-09-04 2019-12-03 深圳前海微众银行股份有限公司 Small routine generation method, device, equipment and computer readable storage medium
CN111475163A (en) * 2020-06-22 2020-07-31 腾讯科技(深圳)有限公司 Method, device and equipment for generating code file of view template and storage medium
CN111767026A (en) * 2020-06-22 2020-10-13 北京百度网讯科技有限公司 Method, device, equipment and medium for generating business object template

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120317504A1 (en) * 2011-06-13 2012-12-13 Microsoft Corporation Automated user interface object transformation and code generation
WO2017007466A1 (en) * 2015-07-08 2017-01-12 Hewlett Packard Enterprise Development Lp Orchestration template generation
CN105912710A (en) * 2016-04-28 2016-08-31 深圳市金立通信设备有限公司 File management method and terminal
CN110286896A (en) * 2019-06-28 2019-09-27 百度在线网络技术(北京)有限公司 Visualizing editing method, device, equipment and storage medium
CN110532029A (en) * 2019-09-04 2019-12-03 深圳前海微众银行股份有限公司 Small routine generation method, device, equipment and computer readable storage medium
CN111475163A (en) * 2020-06-22 2020-07-31 腾讯科技(深圳)有限公司 Method, device and equipment for generating code file of view template and storage medium
CN111767026A (en) * 2020-06-22 2020-10-13 北京百度网讯科技有限公司 Method, device, equipment and medium for generating business object template

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535165A (en) * 2021-06-11 2021-10-22 中电金信软件有限公司 Interface generation method and device, electronic equipment and computer readable storage medium
CN115586896A (en) * 2022-09-29 2023-01-10 通号智慧城市研究设计院有限公司 Page project development method, equipment and storage medium based on template engine
CN115586896B (en) * 2022-09-29 2023-08-04 通号智慧城市研究设计院有限公司 Page project development method, equipment and storage medium based on template engine

Similar Documents

Publication Publication Date Title
TWI581188B (en) The way to load the driver and the embedded device
US9983892B2 (en) Deep linking to mobile application states through programmatic replay of user interface events
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
CN109324799A (en) A kind of code compiling method, computer installation and computer readable storage medium
CN110673923A (en) XWIKI system configuration method, system and computer equipment
CN105100127A (en) Device and method for verifying application deployment topology of cloud computing environment
CN113805882A (en) Method and device for developing application program, electronic equipment and storage medium
CN112685040A (en) Method, device, equipment and storage medium for generating interface file in android system
KR20220092615A (en) Just-In-Time Containers
CN112769706B (en) Componentized routing method and system
CN112148278A (en) Visual block chain intelligent contract framework and intelligent contract development and deployment method
CN114217787A (en) Development method and device of modular application program and storage medium
CN108694049B (en) Method and equipment for updating software
US20170286064A1 (en) Projection of build and design-time inputs and outputs between different build environments
CN111414168B (en) Web application development method and device based on mind map and electronic equipment
CN112631600A (en) Software construction method and system based on Flutter
CN110806891B (en) Method and device for generating software version of embedded device
CN110764864A (en) Terraform-based visual resource arrangement method
CN113495723B (en) Method, device and storage medium for calling functional component
CN114297088A (en) Method, device, equipment and medium for testing front end vue frame assembly
CN111158645B (en) System and method for providing an integrated development environment
CN114090172A (en) Cross-system widget multiplexing method and device
US10768911B2 (en) Managing software components for software application development
JP2008003841A (en) Build processing method, device and program
US20240086157A1 (en) Visual generation of software deployment pipelines using recommendations of development and operations blueprints

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