CN111679820A - Android modular development and rapid module integration method - Google Patents
Android modular development and rapid module integration method Download PDFInfo
- Publication number
- CN111679820A CN111679820A CN202010425425.2A CN202010425425A CN111679820A CN 111679820 A CN111679820 A CN 111679820A CN 202010425425 A CN202010425425 A CN 202010425425A CN 111679820 A CN111679820 A CN 111679820A
- Authority
- CN
- China
- Prior art keywords
- project
- module
- development
- dynamically
- modular
- 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.)
- Withdrawn
Links
- 238000011161 development Methods 0.000 title claims abstract description 40
- 230000010354 integration Effects 0.000 title claims abstract description 22
- 238000000034 method Methods 0.000 title claims abstract description 20
- 230000001419 dependent effect Effects 0.000 claims abstract description 20
- 238000010276 construction Methods 0.000 claims abstract description 6
- 230000008878 coupling Effects 0.000 description 4
- 238000010168 coupling process Methods 0.000 description 4
- 238000005859 coupling reaction Methods 0.000 description 4
- 238000012360 testing method Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000002955 isolation Methods 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000004806 packaging method and process Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/35—Creation or generation of source code model driven
- G06F8/355—Round-trip engineering
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a method for Android modular development and rapid module integration, which is characterized by comprising the following steps of: the method comprises the following steps that 1, through the use of a construction tool Gradle, when the whole project is constructed, the modular project is dynamically constructed into a modular project or a main project dependent library according to configuration switches in the configuration, and whether modules are independently operated or integrated into the switches of the project is configured; step 2, dynamically modifying a first row header identifier in the build. Step 3, dynamically modifying whether an application Id field is needed or not according to the configuration switch; step 4, dynamically loading different list configuration files according to the configuration switch; step 5, switching whether to integrate the module library in the main engineering dependence according to the dynamic state of the configuration switch; the method and the system realize Android modular development and rapid module integration, facilitate multi-team collaborative development and improve the overall development efficiency of teams.
Description
Technical Field
The invention relates to a method for Android modular development and rapid module integration, and belongs to the technical field of software opening.
Background
According to the latest data display of a market research organization IDC2019, in the global smart phone market, the market share of each version of an Android system is up to 87%, the Android system stably releases a new version every year, each version brings brand-new experience and is deeply favored by global mobile developers, and mobile end APP (application) penetrates into various fields, such as smart city construction, mobile payment, electronic competition, AI face recognition and the like; the technical field of mobile terminals has emerged endlessly in recent years, and has various autumn, such as ReactNative, Flutter, applet, etc.; how to develop a high-quality application is particularly important, at present, the Android system platform application development is mostly developed according to an MVC or MVP architecture idea, is dominant, and is very suitable for the development of conventional applications, but with the popularization of a 5G network and the improvement of a mobile end hardware module, the above architecture idea has some limitations, and it is believed that in the future, with the increasing function of mobile application, more and more fields and new technologies will appear.
The traditional Android project development process can be divided into three stages,
the first stage is that the APP application function and the structure are simple, during project development, one project finishes the function in the application from beginning to end, no framework and encapsulation exist, only the coding is carried out for realizing the function, and the method is suitable for small projects with simple functions.
The second stage is that the APP application function and structure are complex, one application comprises dozens of interfaces, so that an MVC architecture appears, and then the MVP and MVVM architectures and the general library are encapsulated, the structures reduce the coupling of the project and are convenient for code reading and later maintenance, and the method is suitable for projects with complex APP application functions and structures.
The third stage is that the APP application function and structure are super-complex, an interface with more and deeper nesting in one function is needed, sometimes one function needs to be cooperatively developed by one team, the project function is more and more, the structure is more and more complex, and version iteration and updating are frequent.
The framework is mainly used for the projects with general APP functions and business complexity, namely in one APP project, all codes and functions are directly compiled, the coupling of the codes is reduced to a certain degree and the maintenance is convenient, but when the projects with super-complex APP functions and business functions are developed and multi-team cooperation is needed to be jointly completed, the development efficiency of the technical scheme is slow, and the involved isolation and coupling are also kept at the isolation and low coupling of the code level; if the code amount in the project is extremely large, the project needs to be packaged and tested again when a little code is changed in time, long time is needed, and parallel processing cannot be performed, so that the development module is not suitable for the project with large multi-team cooperation and Android application project and super-complex service.
Disclosure of Invention
In view of the above technical problems, the present invention aims to: a method for Android modular development and rapid module integration is provided.
The technical solution of the invention is realized as follows: a method for Android modular development and rapid module integration comprises the following steps,
step 1, dynamically constructing a module project into a module project or a main project dependent library according to a configuration switch in configuration by using a construction tool Gradle when constructing the whole project, and configuring whether a module is operated independently or integrated into a switch in the project;
step 2, dynamically modifying a first row header identifier in the build.
Step 3, dynamically modifying whether an application Id field is needed or not according to the configuration switch;
If(loginRunAlone.toBoolean()){
applicationId”com.onexzgj.module.login”
}
and 4, step 4: dynamically loading different list configuration files according to a configuration switch;
sourceSets{
main{
If(loginRunAlone.toBoolean()){
manifest.srcFile‘src/main/AndroidManifest.xml’
}else{
manifest.srcFile‘src/main/Manifest/AndroidManifest.xml’
}
}
}
and 5: switching whether to integrate the module library in the main engineering dependence according to the dynamic state of the configuration switch;
implementationproject(‘:onexlibrary’)
If(!liveRunAlone.toBoolean()){
apiproject{‘:live’)
}
If(!liveRunAlone.toBoolean()){
apiproject{‘:login’)
}。
preferably, the module engineering is dynamically constructed as a dependent library or dynamically constructed as a separate engineering so as to realize modular independent development and rapid module integration.
Preferably, when all the module projects depend on the main project, all the function module projects are changed into a dependent library of the main project, so that the module projects are quickly integrated.
Preferably, when the module project needs to be changed into an independent module project to run, the main project depends on the module project, and each module project depends on the public dependency library to run and develop independently, so that modular development is realized.
Due to the application of the technical scheme, compared with the prior art, the invention has the following advantages:
according to the method for modular development of Android and rapid module integration, a plurality of independent module projects are separated from a traditional Android project according to application functions, each module is an independent project and is developed by independent teams in parallel, the teams do not influence each other, qualitative leap is obtained to a certain extent through packaging, testing and code iteration, and the separated independent module projects are rapidly integrated into a main project through simple modification of a configuration switch in a release stage and can be packaged and released integrally; in the development stage and the self-testing stage, a small and independent project is changed by modifying a configuration switch, and the project is independently operated, debugged and developed; therefore, Android modular development and rapid module integration are realized, multi-team collaborative development is facilitated, and the overall development efficiency of teams is improved.
Drawings
The technical scheme of the invention is further explained by combining the accompanying drawings as follows:
fig. 1 is a schematic diagram of a method for Android modular development and rapid module integration according to the present invention.
Detailed Description
The invention is described below with reference to the accompanying drawings.
As shown in fig. 1, the method for Android modular development and fast module integration according to the present invention includes the following steps,
step 1, dynamically constructing a module project into a module project or a main project dependent library according to a configuration switch in configuration by using a construction tool Gradle when constructing the whole project, and configuring whether a module is operated independently or integrated into a switch in the project;
step 2, dynamically modifying a first row header identifier in the build.
Step 3, dynamically modifying whether an application Id field is needed or not according to the configuration switch;
If(loginRunAlone.toBoolean()){
applicationId”com.onexzgj.module.login”
}
and 4, step 4: dynamically loading different list configuration files according to a configuration switch;
sourceSets{
main{
If(loginRunAlone.toBoolean()){
manifest.srcFile‘src/main/AndroidManifest.xml’
}else{
manifest.srcFile‘src/main/Manifest/AndroidManifest.xml’
}
}
}
and 5: switching whether to integrate the module library in the main engineering dependence according to the dynamic state of the configuration switch;
implementationproject(‘:onexlibrary’)
If(!liveRunAlone.toBoolean()){
apiproject{‘:live’)
}
If(!liveRunAlone.toBoolean()){
apiproject{‘:login’)
}。
preferably, the module engineering is dynamically constructed as a dependent library or dynamically constructed as a separate engineering so as to realize modular independent development and rapid module integration.
Preferably, when all the module projects depend on the main project, all the function module projects are changed into a dependent library of the main project, so that the module projects are quickly integrated.
Preferably, when the module project needs to be changed into an independent module project to run, the main project depends on the module project, and each module project depends on the public dependency library to run and develop independently, so that modular development is realized.
The basic principle of the method is that through a construction tool Gradle, when the whole project is constructed, according to configuration switches in configuration, the module project is dynamically constructed into a module project or a main project dependent library, one APP project cannot depend on the other APP project, but the APP project can depend on a plurality of libraries, so that the module project is dynamically constructed into a dependent library or dynamically constructed into a single project, and modular independent development and rapid module integration are achieved.
Modular engineering (when modules are totally dependent), when the modules are totally dependent, all functional module engineering is changed into a dependent library of a main engineering, and therefore rapid integration of the modular engineering is achieved.
Modular engineering (modules run independently), when the modules need to be changed into the operation of the independent module engineering, the modules are changed into the structure, the main engineering depends on the modular engineering, each modular engineering depends on the public dependency library, and therefore the independent modules are realized to be independent engineering, namely, representatives can run and develop independently, and therefore the modular development is realized.
Therefore, the core for realizing modular development is how to dynamically switch a project into a library and how to program a dependent library into a project, firstly, the difference between the Android project and the Android dependent library is found, and the project is dynamically converted into the dependent library or the dependent library is converted into the project according to the configuration file.
The implementation of the engineering to the dependent library, or the library to the engineering, is specifically as follows:
differences in build.gradle files in android studio:
library dependent first behavior applyplugin: 'com. android. library',
the first behavior of the modular project applyplugin: 'com. android. application',
application ID field in build (ID of application):
the dependency library has no applicationId identification,
the module engineering is identified by the applicationId,
the distinction between the manifest files is that,
the dependency library only needs to configure the information of the four components in the Android in the component in the manifest file,
module engineering needs to configure information such as a complete Application node, authority, style, a start icon, an Application name, four major components and the like.
According to the method for modular development of Android and rapid module integration, a plurality of independent module projects are separated from a traditional Android project according to application functions, each module is an independent project and is developed by independent teams in parallel, the teams do not influence each other, qualitative leap is obtained to a certain extent through packaging, testing and code iteration, and the separated independent module projects are rapidly integrated into a main project through simple modification of a configuration switch in a release stage and can be packaged and released integrally; in the development stage and the self-testing stage, a small and independent project is changed by modifying a configuration switch, and the project is independently operated, debugged and developed; therefore, Android modular development and rapid module integration are realized, multi-team collaborative development is facilitated, and the overall development efficiency of teams is improved.
The above-mentioned embodiments are merely illustrative of the technical idea and features of the present invention, and the purpose thereof is to enable those skilled in the art to understand the contents of the present invention and implement the present invention, and not to limit the scope of the present invention, and all equivalent changes or modifications made according to the spirit of the present invention should be covered in the scope of the present invention.
Claims (4)
1. A method for Android modular development and rapid module integration is characterized by comprising the following steps: comprises the following steps of (a) carrying out,
step 1, dynamically constructing a module project into a module project or a main project dependent library according to a configuration switch in configuration by using a construction tool Gradle when constructing the whole project, and configuring whether a module is operated independently or integrated into a switch in the project;
step 2, dynamically modifying a first row header identifier in the build.
Step 3, dynamically modifying whether an application Id field is needed or not according to the configuration switch;
If(loginRunAlone.toBoolean()){
applicationId”com.onexzgj.module.login”
}
step 4, dynamically loading different list configuration files according to the configuration switch;
step 5, switching whether to integrate the module library in the main engineering dependence according to the dynamic state of the configuration switch;
implementation project(‘:onexlibrary’)
If(!liveRunAlone.toBoolean()){
api project{‘:live’)
}
If(!liveRunAlone.toBoolean()){
api project{‘:login’)
}。
2. the method for Android modular development and rapid module integration of claim 1, comprising: the module engineering is dynamically constructed into a dependency library or is dynamically constructed into a single engineering, so that modular independent development and rapid module integration are realized.
3. The method for Android modular development and rapid module integration according to claim 2, characterized by: when all the module projects depend on each other, all the function module projects are changed into a dependent library of a main project, and therefore the module projects are integrated quickly.
4. The method for Android modular development and rapid module integration according to claim 2, characterized by: when the module project needs to be changed into an independent module project to run, the main project depends on the module project, and each module project depends on the public dependency library to run and develop independently, so that modular development is realized.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010425425.2A CN111679820A (en) | 2020-05-19 | 2020-05-19 | Android modular development and rapid module integration method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010425425.2A CN111679820A (en) | 2020-05-19 | 2020-05-19 | Android modular development and rapid module integration method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111679820A true CN111679820A (en) | 2020-09-18 |
Family
ID=72452162
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010425425.2A Withdrawn CN111679820A (en) | 2020-05-19 | 2020-05-19 | Android modular development and rapid module integration method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111679820A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113032037A (en) * | 2021-02-19 | 2021-06-25 | 视若飞信息科技(上海)有限公司 | Method and device for dynamically configuring chromium functional module and electronic equipment |
-
2020
- 2020-05-19 CN CN202010425425.2A patent/CN111679820A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113032037A (en) * | 2021-02-19 | 2021-06-25 | 视若飞信息科技(上海)有限公司 | Method and device for dynamically configuring chromium functional module and electronic equipment |
CN113032037B (en) * | 2021-02-19 | 2023-03-10 | 视若飞信息科技(上海)有限公司 | Method and device for dynamically configuring chromium functional module and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102520972B (en) | Video game development system and method thereof | |
CN102819492B (en) | Keyword driven automatic testing frame on basis of Android | |
US7337436B2 (en) | System and method for cross platform and configuration build system | |
CN106775744B (en) | Method and device for generating static library | |
CN110457045B (en) | Component combining and compiling method, device, equipment and storage medium | |
US8713514B2 (en) | Heterogeneous language data typing without executable regeneration | |
US10354031B2 (en) | Information processing by interpenetrating signal transmission channel in design for testability of chip | |
CN102270128B (en) | Storehouse consistency checker | |
CN112256321A (en) | Static library packaging method and device, computer equipment and storage medium | |
CN111274142B (en) | Software communication system architecture conformance test modeling method based on extended finite state machine | |
CN111159040A (en) | Test data generation method, device, equipment and storage medium | |
CN111679820A (en) | Android modular development and rapid module integration method | |
CN109284222B (en) | Software unit, project testing method, device and equipment in data processing system | |
CN105335203B (en) | The binary translation of shared library executes method and apparatus | |
US20090327995A1 (en) | Annotation-aided code generation in library-based replay | |
CN115509913A (en) | Software automation test method, device, machine readable medium and equipment | |
CN106778301A (en) | Reliable cross-platform data storage method and system based on cocos2d x | |
CN114356430A (en) | DAG (demand oriented architecture) dependency configuration tool based on airflow scheduling system | |
CN111488286A (en) | Method and device for independently developing Android module | |
CN113885873B (en) | Lightweight OpenHarmony operating system application development object management system and application method thereof | |
CN110968342B (en) | Version comparison method, device and system | |
CN112968930B (en) | Intelligent contract of block chain key value pair and design method thereof | |
CN112631620B (en) | Method, system, equipment and medium for manufacturing operating system | |
CN110175116B (en) | Test date switching method, device and system | |
CN105335289A (en) | Rapid customization method of configuration driven testing platform software system |
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 | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20200918 |