Android Studio - 如何在单个窗口中打开多个项目? [英] Android Studio - How to open multiple project in single window?

查看:102
本文介绍了Android Studio - 如何在单个窗口中打开多个项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了 Android Studio 并开始将它用于我的 Android 开发.

I have downloaded Android Studio and started using it for my Android development.

我需要知道,如何在像 Eclipse 这样的单个窗口中打开多个项目.期待一些帮助,谢谢.

I need to know, how to open multiple number of projects in a single window like Eclipse. Expecting some help, thanks.

推荐答案

在 Android Studio/IntelliJ IDEA 中无法在单个窗口中打开两个项目.因此,当您打开第二个项目时,您必须做出决定:

Open two projects in a single window is not possible in Android Studio / IntelliJ IDEA. So, when you open a second project, you'll have to decide:

新项目可以在新窗口中打开或替换现有窗口中的项目.您希望如何打开项目?

New projects can either be opened in a new window or replace the project in the existing window. How would you like to open the project?

此限制很有用,因为您的窗口提供了特定于项目的功能,例如 VCS 信息的更改"选项卡等.

This limitation is useful because your window offers project specific features, like the Changes tab for VCS information, etc.

现在,您可以将库项目复制到您的项目文件夹中,并将其声明为模块依赖项.如果您在不同的项目中使用相同的库,您最终将拥有多次代码.

For now, you can copy the library project into your project folder and declare it as a module dependency. If you use the same libraries in different projects, you will end up having the code multiple times.

ProjectA                   ProjectB
 facebook-sdk/              actionbarsherlock/
 actionbarsherlock/         bin/
 bin/                       src/
 src/                       ...
 AndroidManifest.xml

虽然这感觉有点不方便,但它有助于在 VCS 中拥有所有必需的源.很快,Gradle,新的构建系统,将愉快地管理这些依赖项.以下是 Gradle 构建如何包含 ActionBarSherlock 或类似库的示例:

While this feels kind of inconvenient, it helps having all the required sources in VCS. Soon, Gradle, the new build system, will manage these dependencies pleasantly. Here's an example of how the Gradle build could look like to include ActionBarSherlock or similar libs:

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.actionbarsherlock:library:4.2.0'
}

此答案中,您会找到此解决方案尚未奏效的一些原因.

In this answer you'll find some reasons why this solution does not work yet.

这篇关于Android Studio - 如何在单个窗口中打开多个项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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