如何将库项目添加到Android项目? [英] How to add a Library Project to a android project?

查看:174
本文介绍了如何将库项目添加到Android项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个新的Andr​​oid项目。我想有在顶部有一个操作栏,所以我下载了 操作栏的Andr​​oid库 因为我想从Android 2.1系统支持设备。

描述说:

  

操作栏组件是一个图书馆项目。这意味着,没有必要对   复制粘贴的资源投入到自己的项目,只需   添加操作栏组件作为参考的任何项目。

我是新到Android所以这是什么意思?我如何可以将库添加到现有的项目?

导入库到Eclipse工作区:

  • 文件 - >导入 - >常规 - >现有项目到工作区,下一步

  • 选择根目录:/​​路径/到/工程

  • 项目 - >选

在这一点上失败,因为没有什么选择和停用下一步按钮。

任何想法?

解决方案
  1. 文件 - >新建 - >其他
  2. 选择Android项目
  3. 选择从现有源创建项目
  4. 单击浏览按钮并导航到johannilsson,Android的动作条\动作条
  5. 完成(在您的工作空间现在操作栏项目)
  6. 在您的项目右击 - >属性
  7. 在Android->库部分中单击添加
  8. 选择最近添加的项目 - >确定
  9. 这就是它!

现在你可以使用它

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 description says

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.

I am new to android so what does this mean? How can I add the library to my existing project?

Import the library into your eclipse workspace:

  • File->Import->General->Existing Projects into Workspace, Next

  • Select root directory: /path/to/project

  • Projects->Select All

At this point it fails because there is nothing to select and the next button is deactivated.

Any ideas?

解决方案

  1. File->New->Other
  2. Select Android Project
  3. Select "Create Project from existing source"
  4. Click "Browse..." button and navigate to johannilsson-android-actionbar\actionbar
  5. Finish (Now action bar project in your workspace)
  6. Right-click on your project -> Properties
  7. In Android->Library section click Add
  8. select recently added project -> Ok
  9. that's it!

Now you can use it

这篇关于如何将库项目添加到Android项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆