merge two android projects
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 workingI had a new project
ProjectB
that had to reuse some functions ofProjectA
.These functions were likely to be reused again so I built a library
Library1
and I moved the necessary code fromProjectA
to it. I set theLibrary1
'sisLibrary
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 useLibrary1
. This also implied some refactoring onProjectA
side but that was OK.And finally, I created my
ProjectB
as a client ofLibrary1
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
精彩评论