Combine two Android projects

I want to combine two different Android projects in order to use the functionality of both in one project. They use complete various packages for files.

I copied files with different packages in one project, but there is a problem with the manifest file.

Is it possible to have different packages in an Android manifest file? Or how can I solve this? Maybe specify actions with the whole package, and not use ".shortcut"?

I hope someone helps me.

Thanks!

+4
source share
3 answers

Building a library can solve this problem. That’s how I went to my side on a similar issue:

  • I had a ProjectA project that was completed and worked

  • I got a new ProjectB project that was supposed to reuse some of the ProjectA features.

  • These functions are likely to be reused again, so I built the Library1 library and I moved the code from ProjectA to it. I set the Library1 isLibrary flag to true in Eclipse (which is in the project properties - let me know if you want more information about this, and I will edit this post if necessary).

  • Then I changed the properties of ProjectA to use Library1 . It also implied some refactoring on the ProjectA side, but that was normal.

  • And finally, I created my ProjectB as a client of Library1 . And that was easy.

+3
source

There is no easy way to combine several projects into one. However, you can create one of the projects as a library and import it into another.

See working with library projects.

+1
source

you can combine code if it does not have a large area. I do not have my own library, etc .... to merge the project you need to reorganize the package name, xml layout, etc. .... for example. main.xml are separate for both packages, so take care of these things

+1
source

Source: https://habr.com/ru/post/1369617/


All Articles