Android Studio:新项目与新模块 [英] Android studio: new project vs new module
问题描述
Android Studio 使用 modules
的概念,而 Eclipse 等其他 IDE 使用 projects
.然而,AS File
菜单可以选择创建一个 New Module
以及一个 new Project
.
Android Studio uses the concept of modules
, whereas other IDEs like Eclipse use projects
.
However AS File
menu has the option to create a New Module
as well as a new Project
.
如果有的话,这两者之间有什么区别?
What are the differences between these two if any?
推荐使用哪个?
推荐答案
来自 文档(Android Studio 基于 Intellij IDEA):
From the documentation (Android Studio is based on Intellij IDEA) :
无论你在 IntelliJ IDEA 中做什么,你都是在一个项目.项目是一个组织单位,代表一个完整的软件解决方案.
Whatever you do in IntelliJ IDEA, you do that in the context of a project. A project is an organizational unit that represents a complete software solution.
您的成品可能会分解成一系列离散的、独立的模块,但它是一个项目定义,带来它们将它们结合成一个更大的整体.
Your finished product may be decomposed into a series of discrete, isolated modules, but it's a project definition that brings them together and ties them into a greater whole.
对于 Android,这意味着每个应用一个项目,每个库和每个测试应用一个模块.
For Android, it means one project per app, and one module per library and per test app.
如果您尝试在同一个项目中构建多个应用,则会出现多个问题.这是可能的,但是如果您尝试(就像我所做的那样),您会发现几乎所有内容都旨在为每个项目使用一个应用程序.
There are multiple issues if you try to build multiple apps within the same project. It's possible, but if you try (like I did), you will see that almost everything is designed to work with a single app per project.
例如,有一个重建项目"的选项,这对于多个应用程序没有意义,许多其他项目设置将无用,并且当您有多个存储库时,内置的VCS系统不是很好.
For example, there is an option to "rebuild the project", which makes no sense with multiple apps, many other project settings would be useless, and the built-in VCS system isn't great when you have multiple repositories.
这篇关于Android Studio:新项目与新模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!