[英]Using other projects in Android project
I'm messing around with this book and can't figure out the proper way to set up the projects. 我在弄乱这本书 ,无法弄清楚设置项目的正确方法。
They tell you to make 3 projects which I've named: 他们告诉您进行3个我命名的项目:
To get the snake game to work I've just copied the packages from the other two projects and pasted them into the snakeGame2 project. 为了使蛇游戏正常工作,我只复制了其他两个项目中的软件包并将其粘贴到snakeGame2项目中。 What's the proper way to include these into snakeGame2 so that I don't have multiple copies all over the place and can reuse the projects for a different game?
将这些内容包含到snakeGame2中的正确方法是什么,这样我就不会在各处放置多个副本,并且可以将项目重用于其他游戏?
The pic below shows the tree after trying to export the java source files and resources and then adding the jar to the build path of snakeGame2. 下图显示了尝试导出Java源文件和资源,然后将jar添加到snakeGame2的构建路径后的树。 For the exports, I only selected the source folder.
对于导出,我只选择了源文件夹。
edit: using dumpstate's answer I get this in the logcat: 编辑:使用dumpstate的答案我在logcat中得到此:
another edit: dumpstate's answer worked but it's incredibly slow compared to when I just copied the packages into the project. 另一个编辑:dumpstate的答案有效,但是与我刚将软件包复制到项目中时相比,它的速度令人难以置信。 Is this a byproduct of including them in this manner?
这是以这种方式包括他们的副产品吗?
If AndroidFramework2D and AndroidFramework2DImplementation are ordinary Java projects: 如果AndroidFramework2D和AndroidFramework2DImplementation是普通的Java项目:
Right click on the project > Build Path > Configure Build Path > Java Build Path > 'Projects' tab > Add.. > Choose the project you'd like to depend on. 右键单击项目>构建路径>配置构建路径> Java构建路径>'项目'选项卡>添加。>选择您要依赖的项目。
If AndroidFramework2D and AndroidFramework2DImplementation are Android projects, they should be set as library projects (Configure Build Path > Android > check 'Is library') and the snakeGame project should refer to them (Configure Build Path > Android > Library > Add; decribed here: developer.android.com/tools/projects/projects-eclipse.html) 如果AndroidFramework2D和AndroidFramework2DImplementation是Android项目,则应将它们设置为库项目(配置构建路径> Android>检查“ Is库”),snakeGame项目应引用它们(配置构建路径> Android>库>添加;在此处进行描述: developer.android.com/tools/projects/projects-eclipse.html)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.