Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
713 views
in Technique[技术] by (71.8m points)

eclipse - 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 to help me.

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...