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
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
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
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.