如何将库项目添加到 android 项目? [英] How to add a Library Project to a android project?
问题描述
我创建了一个新的 android 项目.我想在顶部有一个操作栏,所以我下载了 Android 库的操作栏 因为我想支持 android 2.1 的设备.
I have created a new android project. I want to have a action bar at the top so I downloaded the Action Bar for Android Library because I want to support devices from android 2.1.
描述说
操作栏组件是一个库项目.这意味着没有必要将资源复制粘贴到您自己的项目中,只需添加操作栏组件作为对任何项目的引用.
The action bar component is an Library Project. This means that there's no need to copy-paste resources into your own project, simply add the action bar component as a reference to any project.
我是 android 新手,这是什么意思?如何将库添加到我现有的项目中?
I am new to android so what does this mean? How can I add the library to my existing project?
将库导入您的 eclipse 工作区:
Import the library into your eclipse workspace:
File->Import->General->Existing Projects into Workspace, Next
File->Import->General->Existing Projects into Workspace, Next
选择根目录:/path/to/project
Select root directory: /path/to/project
项目->全选
此时它失败了,因为没有任何东西可以选择并且下一个按钮被停用.
At this point it fails because there is nothing to select and the next button is deactivated.
有什么想法吗?
推荐答案
- 文件->新建->其他
- 选择安卓项目
- 选择从现有源创建项目"
- 点击浏览..."按钮并导航到 johannilsson-android-actionbaractionbar
- 完成(现在工作区中的操作栏项目)
- 右键单击您的项目 -> 属性
- 在 Android->Library 部分点击添加
- 选择最近添加的项目 -> 确定
- 就是这样!
现在可以使用了
这篇关于如何将库项目添加到 android 项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!