如何将图书馆计划添加到Android项目? [英] How to add a Library Project to a android project?

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

问题描述

我已经创建了一个新的android项目。我想在顶部设置一个操作栏,所以我下载了 Android图库的操作栏 ,因为我想支持Android 2.1中的设备。



描述说


操作栏组件是一个库项目。这意味着不需要
将资源复制到您自己的项目中,只需
将操作栏组件添加到任何项目的引用。


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



将库导入到eclipse工作区中:




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


  • 选择根目录:/ path / /项目


  • 项目 - >全选




在这一点上,它失败了,因为没有什么可以选择,下一个按钮被停用。



任何想法?

解决方案


  1. File-> New-> Other

  2. 选择Android Project

  3. 选择从现有的来源创建项目

  4. 点击浏览...按钮,导航到johannilsson-android-actionbar\actionbar

  5. 完成(现在您的工作区中的动作栏项目)

  6. 右键单击您的项目 - >属性

  7. 在Android-> Library部分中,单击添加

  8. 选择最近添加的项目 - > Ok

  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天全站免登陆