CN114327396A - Method for developing Andriod system application by deviating from source code compiling environment - Google Patents

Method for developing Andriod system application by deviating from source code compiling environment Download PDF

Info

Publication number
CN114327396A
CN114327396A CN202210111592.9A CN202210111592A CN114327396A CN 114327396 A CN114327396 A CN 114327396A CN 202210111592 A CN202210111592 A CN 202210111592A CN 114327396 A CN114327396 A CN 114327396A
Authority
CN
China
Prior art keywords
source code
system application
compiling
developing
dependency
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
CN202210111592.9A
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.)
Chongqing Changan Automobile Co Ltd
Original Assignee
Chongqing Changan Automobile 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 Chongqing Changan Automobile Co Ltd filed Critical Chongqing Changan Automobile Co Ltd
Priority to CN202210111592.9A priority Critical patent/CN114327396A/en
Publication of CN114327396A publication Critical patent/CN114327396A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a method for developing Andriod system application by separating from a source code compiling environment, which is used for knowing the item dependence condition by determining a system application module needing to be stripped from a system source code catalog; establishing an Android Studio project according to the project dependence condition, establishing a main project and each module according to the original mk file, and copying source codes to a project main directory; the method comprises the following steps of quoting related dependence and source codes, configuring an operating environment, adjusting a compiling quoting sequence, and setting related source codes and a resource quoting catalog; and after the trial compilation eliminating module reports errors, the whole compilation is completed. The invention is a new system application development process, which uses the modern IDE to make the system application as the common application can be compiled and debugged quickly, and can facilitate the developer to compile and debug the system application without affecting the original system source code structure and content, thereby installing the system application into the vehicle system without upgrading the system, and being applicable to some scenes of quick repair without considering the risk and time consumption of the whole system upgrading.

Description

Method for developing Andriod system application by deviating from source code compiling environment
Technical Field
The invention belongs to the technical field of Android software development, and particularly relates to a method for developing an Android system application by separating from a source code compiling environment.
Background
Most of application development of the existing android system depends on a source code compiling environment, compiling and debugging are very inconvenient in the application process of the development system, the module needs to be compiled when part of codes are changed, a generated installation package is pushed to corresponding equipment for testing, changes of application running states after the codes are changed cannot be observed due to the fact that no debugging tool exists, changes need to be detected by depending on a log system, development efficiency is affected, a large amount of complex work is increased, and log contents in the codes need to be cleared in the later period. Aiming at the system software customization development in the field of the current automobile cockpit, generally speaking, the application of the vehicle-mounted computer system needs to be upgraded and replaced along with the system version, the system application is often upgraded or replaced, the risk, the cost and the time consumption of the whole system upgrade are high, and the use is inconvenient.
National patent CN201510666061.6 discloses a data file generation and calling method and device for an android system application program, wherein the android system application program is provided with a corresponding database interface file and a reference path of a compiled file, and the data file generation method comprises the following steps: creating an interface folder in the android system application program; moving a database interface file of the android system application program to the interface folder; guiding a reference path of a compiled file of the android system application program to the interface folder; and generating the data file in the android system application program, so that the data file of the system application program can be generated in the application program, and the control of a mobile phone process on the data file is separated.
In addition, a chinese patent CN201510512780.2 discloses a method, a server and a system for compiling an android package development file, which includes: receiving android package development files to be compiled uploaded by each client; compiling the received android package development file to be compiled on a cloud server to obtain a compiled android package development file; and returning the compiled android package development file to the corresponding client. According to the technical scheme, the compiling work is separated from the client side, the server with higher working performance is adopted for the compiling work, and the performance of the server is generally far better than that of the client side, so that the time for compiling the android package file is greatly shortened. Developers can directly obtain the compiled android package development files from the server if the compiled android package development files need to be processed again, and therefore the utilization of storage resources needed by the local client side for storing the android packages is reduced.
In the prior art, application development is carried out in a source code environment of a system, and system application development without a source code compiling environment is not realized, so that a developer is inconvenient to compile and debug system application.
Disclosure of Invention
In order to solve the problems, the invention provides a method for developing an Android system application by separating from a source code compiling environment, which has a great efficiency improvement effect on system software customization development in the field of the current automobile cockpit, a compiling system level application is quickly constructed in an Android official IDE, and a developer can conveniently compile and debug the system application under the condition of not influencing the original system source code structure and content, so that the system application can be installed in an automobile machine system under the condition of not upgrading the system, and the method is suitable for some quick repairing scenes without considering the risk and time consumption of the whole system upgrading.
In order to solve the technical problem, the technical scheme adopted by the invention is as follows: a method for developing Andriod system application by deviating from a source code compiling environment comprises the following steps,
s1, determining the position of a system application project needing to be separated from a source code compiling environment in a system source code directory, and analyzing the dependency relationship;
s2, creating an empty engineering main directory, and copying the source code of the system application project into the engineering main directory;
s3, quoting related dependent source codes and resources developed by a system application project, configuring an operating environment, adjusting a compiling quoting sequence, and setting a quoting catalog of the related dependent source codes and the resources;
and S4, the whole compiling is completed by trial compiling and processing after error reporting.
As an optimization, the method further includes the step of completely compiling the system source code once before executing step S1 to obtain the library file used in the compilation process of the system application project.
And as optimization, configuring the running environment comprises taking the frame work. jar file in the system source code compiling environment as a base sdk on which the system application item depends, and setting the priority of the frame work. jar file in the system application item compiling process.
As optimization, the setting of the reference directories of the related dependent source codes and the resources comprises configuring corresponding source codes and resource directories, and managing through a gradle script.
As optimization, the configuring the corresponding source code and resource directory includes placing the engineering main directory in a root directory of the system source code, and specifying the source code and resource reference directory by configuring a relative path.
As optimization, the configuration relative path is configured through script attribute sourceSets.
As an optimization, the step S3 further includes adding code and resource dependency modules according to the dependency relationship of the system application, separately introducing as a dependency, placing in the reference directory, and managing with a gradle script.
And as optimization, configuring modules depended by the system application items into dependence in the script, determining a dependence form according to the original dependence relationship, and adjusting the dependence sequence according to the dependence form.
As optimization, the dependency forms include compile-time dependencies, run-time dependencies, and full-state dependencies.
Compared with the prior art, the invention has the following advantages:
according to the method, the android.mk of the system application module needing to be stripped from the system source code directory is determined, and the item dependence condition is known; establishing an Android Studio project according to the project dependence condition, removing irrelevant contents, establishing a main project and each module according to the original mk file, and copying source codes to a project main directory; the method comprises the following steps of quoting related dependence and source codes, configuring an operating environment, adjusting a compiling quoting sequence, and setting related source codes and a resource quoting catalog; and (4) trial compilation is carried out to eliminate module error report, and the whole compilation is completed after specific error report contents are processed. The invention is a new system application development process, which uses the modern IDE to make the system application as the common application can be compiled and debugged quickly, and is convenient for the developer to compile and debug the system application without affecting the original system source code structure and content. The system software customization development in the field of the current automobile cockpit has a great efficiency improvement effect, the system can be applied and installed in the vehicle machine system under the condition that the system is not upgraded, and the system is suitable for some fast repairing scenes without considering the risk and time consumption of the whole system upgrading.
Drawings
FIG. 1 is a flowchart illustrating Android system compilation;
FIG. 2 is a block diagram of the migration process of the present invention.
Detailed Description
The invention will be further explained with reference to the drawings and the embodiments.
Example (b): with reference to figures 1-2 of the drawings,
a method for developing Andriod system application by deviating from a source code compiling environment comprises the following steps,
and S1, determining the position of the system application item needing to be separated from the source code compiling environment in the system source code directory, and analyzing the dependency relationship. The system source code is completely compiled once before step S1 is executed to obtain the library file used in the compilation process of the system application project.
And S2, creating an empty engineering main directory, and copying the source code of the system application project into the engineering main directory.
And S3, quoting the related dependent source codes and resources developed by the system application project, configuring the running environment, adjusting the compiling quoting sequence, and setting the quoting catalog of the related dependent source codes and resources.
And the configuration operation environment comprises that the frame.jar files in the system source code compiling environment are used as a base sdk on which the system application items depend, and the priority of the frame.jar files in the system source code compiling environment is set in the system application item compiling process. The setting of the related dependent source code and the reference catalog of the resource comprises configuring the corresponding source code and the corresponding resource catalog and managing through a gradle script. And configuring the corresponding source code and the resource directory comprises placing the engineering main directory in a root directory of the system source code, and specifying the source code and the resource reference directory by configuring a relative path. The relative path is configured through script attribute sourceSets. And adding a code and a resource dependence module according to the dependence relationship of the system application item, introducing the code and the resource dependence module independently as dependence, placing the dependence in a reference directory, and managing by using a gradle script. And configuring modules depended by the system application items into dependence in the script, determining a dependence form according to the original dependence relationship, and adjusting the dependence sequence according to the dependence form. The dependency forms include compile-time dependencies, run-time dependencies, and full-state dependencies.
And S4, the whole compiling is completed by trial compiling and processing after error reporting.
Specifically, the system application is different from the common application in that the required permission is higher, the code is coupled with a system source code part more, and the system level interface which depends on the code is more, but as long as an independent item can clearly determine the dependency relationship according to the mk file under the directory, the independent item can be independently extracted and compiled as an independent application, and the independent application is not dependent on the source code environment any more.
The first preparation is to compile the whole source code once, i.e. to ensure the source code is accurate and has no errors and omissions, and simultaneously generate a library file to be used in the system application compilation process by using full compilation, as shown in fig. 1. The method includes that a required library file is found in a directory corresponding to a source code, generally, the library file dependent on system application is compiled and then stored in out/target/common/obj/JAVA _ LIBRARIES, a corresponding class. Meanwhile, a large amount of system hidden APIs are often introduced into system applications, sdk used in common Android engineering often cannot ensure that compilation is passed, so that a frame.jar file compiled by a current system needs to be found in an out/target/common/obj/JAVA _ LIBRARIES/frame _ interfaces directory to serve as a basis sdk on which the system applications depend, the priority of the frame.jar file in the compiling process is specified, and relevant data references exist for a specific setting method for Android Studio script item dependency reference, and are not repeated herein.
Secondly, corresponding resources and code (source code) directories need to be configured, so that the gradle script can manage corresponding file contents. In order to synchronize source codes and benefit from the flexibility of the Android Studio compiling script, a source code directory can be placed in a root directory of an Android project, and a source code and a resource directory are specified by configuring a relative path, as shown in fig. 1, so that an original project structure is not changed, and the Android Studio can be compiled and passed, that is, a complete directory of a system applied to the source codes is provided under the root directory of the project, and each module and main project only refer to file contents under the directory through a configuration file to participate in compiling. This section is configured by the script attribute sourceSets, and the related content can be referred to official documents.
And because the related resource files referenced by the system application are complicated, other project or resource files with different package names can be referenced, and at this time, a project module is needed to be added and is independently used as a dependence introduction to place the resource files therein, and the resource file references of other package names are compiled by using the gradle.
And finally, configuring a module dependent on the main project into a dependency in a script, determining a dependency form according to mk of an original project, determining whether the dependency is dependent in compiling, dependent in running or dependent in a full state, adjusting a dependency sequence according to the criterion, ensuring that running is not mistaken after compiling, possibly causing resource file identification errors, code or source code reference errors and the like in the project, and solving the problems according to prompts.
According to the method, the android.mk of the system application module needing to be stripped from the system source code directory is determined, and the item dependence condition is known; establishing an Android Studio project according to the project dependence condition, removing irrelevant contents, establishing a main project and each module according to the original mk file, and copying source codes to a project main directory; the method comprises the following steps of quoting related dependence and source codes, configuring an operating environment, adjusting a compiling quoting sequence, and setting related source codes and a resource quoting catalog; and (4) trial compilation is carried out to eliminate module error report, and the whole compilation is completed after specific error report contents are processed. The invention is a new system application development process, which uses the modern IDE to make the system application as the common application can be compiled and debugged quickly, and is convenient for the developer to compile and debug the system application without affecting the original system source code structure and content. The system software customization development in the field of the current automobile cockpit has a great efficiency improvement effect, the system can be applied and installed in the vehicle machine system under the condition that the system is not upgraded, and the system is suitable for some fast repairing scenes without considering the risk and time consumption of the whole system upgrading.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present invention and not for limiting the technical solutions, and those skilled in the art should understand that modifications or equivalent substitutions can be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions, and all that should be covered by the claims of the present invention.

Claims (9)

1. A method for developing Andriod system application by deviating from source code compiling environment is characterized by comprising the following steps,
s1, determining the position of a system application project needing to be separated from a source code compiling environment in a system source code directory, and analyzing the dependency relationship;
s2, creating an empty engineering main directory, and copying the source code of the system application project into the engineering main directory;
s3, quoting related dependent source codes and resources developed by a system application project, configuring an operating environment, adjusting a compiling quoting sequence, and setting a quoting catalog of the related dependent source codes and the resources;
and S4, the whole compiling is completed by trial compiling and processing after error reporting.
2. The method for developing Andriod system application deviating from source code compiling environment according to claim 1, further comprising the step of compiling the system source code completely once to obtain the library file used in the system application project compiling process before executing step S1.
3. The method for developing android system applications from a source code compilation environment as recited in claim 1, wherein the configuring the runtime environment comprises taking a frame work. jar file in the system source code compilation environment as a basis sdk on which a system application item depends and setting a priority of the frame work. jar file in the system source code compilation environment in a system application item compilation process.
4. The method for developing an Andriod system application from a source code compiling environment according to claim 1, wherein the setting of the reference directories of the relevant dependent source codes and resources comprises configuring the corresponding source codes and resource directories and managing the source codes and the resource directories through a gradle script.
5. The method for developing an Andriod system application from a source code compilation environment according to claim 4, wherein configuring the corresponding source code and resource directory comprises placing an engineering master directory in a root directory of the system source code and specifying the source code and the resource reference directory by configuring a relative path.
6. The method for developing an Andriod system application from a source code compilation environment according to claim 5, wherein the relative path is configured by script attribute sourceSets.
7. The method for developing Andriod system application from source code compiling environment according to claim 1, wherein the step S3 further includes adding code and resource dependency modules according to the dependency relationship of the system application item, separately introducing as dependency, placing in a reference directory, and managing with a gradle script.
8. The method for developing Andriod system application according to claim 7, wherein the modules on which the system application items depend are configured as dependencies in the script, the dependency form is determined according to the original dependency relationship, and the dependency order is adjusted according to the dependency form.
9. The method for developing an Andriod system application from a source code compilation environment according to claim 8, wherein the dependency forms include a compile-time dependency, a run-time dependency and a full-state dependency.
CN202210111592.9A 2022-01-29 2022-01-29 Method for developing Andriod system application by deviating from source code compiling environment Pending CN114327396A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210111592.9A CN114327396A (en) 2022-01-29 2022-01-29 Method for developing Andriod system application by deviating from source code compiling environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210111592.9A CN114327396A (en) 2022-01-29 2022-01-29 Method for developing Andriod system application by deviating from source code compiling environment

Publications (1)

Publication Number Publication Date
CN114327396A true CN114327396A (en) 2022-04-12

Family

ID=81031549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210111592.9A Pending CN114327396A (en) 2022-01-29 2022-01-29 Method for developing Andriod system application by deviating from source code compiling environment

Country Status (1)

Country Link
CN (1) CN114327396A (en)

Similar Documents

Publication Publication Date Title
CN110377290B (en) Method, device and equipment for compiling target engineering
CN106020873B (en) Patch package loading method and device
CN110096425B (en) QT development mode-based automatic testing method and device and storage medium
KR100952251B1 (en) Servicing a component base software product
CN102402427B (en) A kind of update method of java application and device
US10331425B2 (en) Automated source code adaption to inject features between platform versions
CN109032631B (en) Application program patch package obtaining method and device, computer equipment and storage medium
US20110126179A1 (en) Method and System for Dynamic Patching Software Using Source Code
CN107678748B (en) Source code file compiling method and device
US20070220496A1 (en) Multiple operating device version software generating device and multiple operating device version software generation support program and method
CN112882718B (en) Compiling processing method, device, equipment and storage medium
US8001518B2 (en) Configuring a shared library to accommodate relocatable data in a pervasive device
CN112083930A (en) Optimization method for android project compiling process
CN111061486B (en) Android application program increment method
CN115756424A (en) Method, device and equipment for generating MVP (multifunction vehicle platform) code
EP3432149A1 (en) A computer-implemented method and system of compiling a modified source code at a plurality of target machines
CN117707499A (en) Multi-source model algorithm analyzer plug-in and compiling algorithm based on virtualization technology
CN113360156B (en) IOS compiling method and related equipment
CN111352631A (en) Interface compatibility detection method and device
US20240036887A1 (en) Intercepting calls to a dynamic library
CN115456628A (en) Intelligent contract viewing method and device based on block chain, storage medium and equipment
CN114327396A (en) Method for developing Andriod system application by deviating from source code compiling environment
CN115809076A (en) ECU software automation integration method and system
CN115168175A (en) Program error solving method, device, electronic equipment and storage medium
CN112328503A (en) Task acceptance method for software development working platform

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