merge two android projects

前端 未结 3 1825
一整个雨季
一整个雨季 2020-12-21 04:04

i want to merge two different android projects to use the functionalty of both in one project. They are using complete different packages for the files.

I copied the

相关标签:
3条回答
  • 2020-12-21 04:41

    you can merge the code if it not having large scope..ie not having Native library and etc... for merging the project you need to refactor package name, layout xml and etc... for example. main.xml are seperate for both of package so need to care of such things

    0 讨论(0)
  • 2020-12-21 04:55

    There is no easy way to merge multiple projects into one. However, you can choose to build one of the projects as a library and import it into the other.

    See working with library projects

    0 讨论(0)
  • 2020-12-21 04:56

    Building a library can solve this problem. This is the way I have proceeded on my side for a similar question:

    • I had a project ProjectA that was finished and working

    • I had a new project ProjectB that had to reuse some functions of ProjectA.

    • These functions were likely to be reused again so I built a library Library1 and I moved the necessary code from ProjectA to it. I set the Library1's isLibrary flag to true under Eclipse (that's in the project properties - let me know whether you would like more details on this and I'll edit that post if needed).

    • Then I modified the ProjectA's properties to use Library1. This also implied some refactoring on ProjectA side but that was OK.

    • And finally, I created my ProjectB as a client of Library1 as well. And this was straightforward.

    0 讨论(0)
提交回复
热议问题