Android studio两种工程目录视图对比--Using the Android Project View

来源:互联网 发布:辽宁大石药业淘宝 编辑:程序博客网 时间:2024/06/06 03:39

原文来自http://wear.techbrood.com/sdk/installing/studio-androidview.html


在移植eclipse项目到studio后,翻看了一些文档,翻译水平有限,我大致写下我理解的意思。


Using the Android Project View

The Android project view in Android Studio shows a flattened version of your project's structure that provides quick access to the key source files of Android projects and helps you work with the new Gradle-based build system. The Android project view:

(使用Android视图展现的是工程更加直观的结构,使你能够快速定位到所需要的常用文件处,并且使用最新的Gradle-based build system哦)

  • Groups the build files for all modules at the top level of the project hierarchy.
  • (有序的组织每个modules,也就是对应于eclipse里面的project了,Android的project就是eclipse的workspace这个意思)
  • Shows the most important source directories at the top level of the module hierarchy.
  • (将最重要的资源显示在目录的最上层结构更当中)
  • Groups all the manifest files for each module.
  • (将每个module的清单文件都分别罗列出来吧~~)
  • Shows resource files from all Gradle source sets.
  • (将Gradle 资源配置文件展示出来吧)
  • Groups resource files for different locales, orientations, and screen types in a single group per resource type.
  • (将不同类型的资源文件都分组展示~~~似乎是这样子)

Figure 1: Show the Android project view.

Enable the Android Project View


The Android project view is not yet enabled by default. To show the Android project view, click Project and select Android, as shown in Figure 1.

(Android目录视图不是默认显示的,选择project选项就看到啦!左上角哦)

Use the Android Project View


The Android project view shows all the build files at the top level of the project hierarchy under Gradle Scripts. Each project module appears as a folder at the top level of the project hierarchy and contains these three elements at the top level:

  • java/ - Source files for the module.
  • manifests/ - Manifest files for the module.
  • res/ - Resource files for the module.
  • (每个模块里面都包含三个重要部分:1、Java;2、manifest、;3、res。我的目录打开明显是2-1-3的顺序结构呢,包含的东西就不用说了,eclipse和里面一样,或者直接看名称就知道里面是些什么鬼东西了)

Figure 2 shows how the Android project view groups all the instances of the ic_launcher.png resource for different screen densities under the same element.(project视图和Android视图的对比)

Note: The Android project view shows a hierarchy that helps you work with Android projects by providing a flattened structure that highlights the most commonly used files while developing Android applications. However, the project structure on disk differs from this representation.(就是之前说的啦,将最重要和常用的文件展示给你,方便开发,但最后一句也说了,however!工程目录视图和实际放在你电脑里面的工程结构是有差异的呢)

Figure 2: The traditional project view (left) and the Android project view (right).


0 0
原创粉丝点击