How to import an existing android Project into another android project

谁说我不能喝 提交于 2019-12-11 03:23:36

问题


i want to import an existing Android Project(a small App that should be added to another Android Project soon) into another Android Project in order to test.
I tried several things for example:

  • export the first project als jar and add the external jar to build path of the second
  • added the first project to the second in the build path of the second project

but nothing worked and i did not forget to mark the checkbox at "order and Export" i'll be very happy, if anyone could help me ;)

hannes


回答1:


Right click on your project Build Path>Configure Build Path> "Select prject tab" then add the project :D

Hope it helps Have fun




回答2:


there are a couple of different solutions imo.

If applicable - you could mark the first small project as a library and just add it to the newer project (properties -> android -> checkbox/add lib)

OR

You access the app if its already installed on the device

OR

You copy the source code/package to the new project

OR

You compile the old project to a dex file and load the classes/methods via the DexClassLoader

OR

export as JAR file, as you already tried - but you cant export any resources (although there are workarounds if there arent many resources)

Thats all I can think of right now, if you have more specific question to one of the solutions, just ask =)



来源:https://stackoverflow.com/questions/7346448/how-to-import-an-existing-android-project-into-another-android-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!