开发者

merge two android projects

开发者 https://www.devze.com 2023-03-31 11:55 出处:网络
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 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 files with the different packages in one project, but there is a problem with the manifest file.

Is it possibly to have different packages in the android manifest file? Or how can i solve this? Maybe specify the activities with the whole package and not use ".shortcut" ?

I hope there is someone t开发者_StackOverflow中文版o help me.

Thanks!


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.


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


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

精彩评论

暂无评论...
验证码 换一张
取 消