Java Eclipse Android 初学者问题 - 如何添加库或链接文件夹。初学者参考资料
我刚刚开始使用 Eclipe 进行 Android 开发,并且已经遇到了一些基本问题。我有一些入门书籍,例如“繁忙的 Android 程序员指南...”和“24 小时内自学 Android 应用程序开发”,但是,我没有看到涵盖一些基本内容。
有人可以告诉我如何设置库然后在项目中使用它吗?我有一些示例代码,其中 Ecliple 中出现一个名为“DataGatherLib”的文件夹,右键单击并点击属性显示它的类型为“链接文件夹”。我怀疑这就是我想要的。所以我的具体问题是: 1. 如何在 Eclipse 中设置您自己的库项目(链接文件夹,如果合适的话)。
- 那么,如何在 Ecliple Android 项目中使用新创建的库呢?
更一般地说,有人可以向我指出一些涵盖这一点的优秀初学者参考资料(书籍或在线教程)。我认为在库中组织代码而不是在一个大型应用程序中组织代码是相当基本的,但我似乎找不到讨论。
谢谢, 戴夫
I'm just starting with Android developmenent using Eclipe and have already run into some basic questions. I have some beginning books such as "busy coders guide to Android..." and "Teach Yourself Android Application Dev't in 24 Hours", however, I'm not seeing some basic things covered.
Can someone tell me how to set up a library and then use it in a project? I have some example code where they have a folder appearing in Ecliple called, "DataGatherLib" Right clicking and hitting properties reveals it is of type "Linked Folder". I suspect this is what I want. So my specific questions are:
1. How do you set up your own library project (Linked Folder if that's appropriate) in Eclipse.
- How then, do you use your newly created library in a Ecliple Android Project?
More generally, can someone point me to some good beginner references (books or online tutorials) that cover this. I would think that organizing your code in libaries as opposed to one big application is fairly basic, but I can't seem to find the discussion.
Thanks,
Dave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Eclipse 中右键单击您的项目,选择“属性”,然后选择“Android”,您会看到一个用于添加库项目的页面。
顺便说一句,您应该对库项目执行相同的操作,并先将其标记为库,然后才能添加。
或者,您可以将 jar 拖放到项目中并将它们添加到类路径中,但在这种情况下,您只能访问类文件,而不能访问 jar 中的资源文件。
In Eclipse right-click on your project, select "Properties", then "Android" and you see a page to add a library project.
BTW, you should do the same on the library project and mark it as a library first before you can add.
Alternatively you can drag and drop jars to your project and add them to your classpath, but in this case you can only access class files and not the resource files in the jar.