simplification and clarification to the Studio Overview

am: e9b3ada

* commit 'e9b3ada90129b2801047c69001e9eeb4a03861e2':
  simplification and clarification to the Studio Overview

Change-Id: I8418194ba23f39c8022c59f5fd1f6b930dd89f45
This commit is contained in:
smain@google.com
2016-03-29 19:09:05 +00:00
committed by android-build-merger
2 changed files with 75 additions and 125 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

View File

@@ -9,9 +9,9 @@ page.tags=studio,sdk,tools,firstapp
<h2>In this document</h2> <h2>In this document</h2>
<ol> <ol>
<li><a href="#project-structure">Project and File Structure</a></li> <li><a href="#project-structure">Project Structure</a></li>
<li><a href="#build-system">Android Build System</a></li> <li><a href="#build-system">Gradle Build System</a></li>
<li><a href="#debug-perf">Debug and Performance</a></li> <li><a href="#debug-perf">Debug and Profile Tools</a></li>
</ol> </ol>
@@ -23,121 +23,91 @@ page.tags=studio,sdk,tools,firstapp
</div> </div>
<p>Android Studio is the official IDE for Android app development, <p>Android Studio is the official IDE for Android app development, based on
based on <a class="external-link" href="https://www.jetbrains.com/idea/" target="_blank">IntelliJ IDEA</a>. <a class="external-link" href="https://www.jetbrains.com/idea/" target=
On top of the capabilities you expect from IntelliJ, "_blank">IntelliJ IDEA</a>. On top of IntelliJ's powerful code editor and
Android Studio offers:</p> developer tools, Android Studio offers even more features that enhance your
productivity when building Android apps, such as:</p>
<ul> <ul>
<li>Flexible Gradle-based build system</li> <li>A flexible Gradle-based build system</li>
<li>Build variants and multiple APK file generation</li> <li>Build variants and multiple APK file generation</li>
<li>Code templates to help you build common app features</li> <li>Code templates to help you build common app features</li>
<li>Rich layout editor with support for drag and drop theme editing</li> <li>A rich layout editor with support for drag and drop theme editing</li>
<li>Lint tools to catch performance, usability, version compatibility, and other problems</li> <li>Lint tools to catch performance, usability, version compatibility, and other problems</li>
<li>Code shrinking with ProGuard</li> <li>Code shrinking with ProGuard and resource shrinking with Gradle</li>
<li>Built-in support for <li>Built-in support for
<a href="http://developers.google.com/cloud/devtools/android_studio_templates/">Google Cloud Platform</a>, <a href="http://developers.google.com/cloud/devtools/android_studio_templates/">Google Cloud Platform</a>,
making it easy to integrate Google Cloud Messaging and App Engine</li> making it easy to integrate Google Cloud Messaging and App Engine</li>
<li>And much more</li>
</ul> </ul>
<p>This page provides an introduction to some key Android Studio features. For <p>This page provides an introduction to basic Android Studio features. For
specific Android Studio how-to documentation, see the pages in the <a href= more detailed guides to using Android Studio, start by browsing pages in the
"{@docRoot}tools/workflow/index.html">Workflow</a> section, such as <a href= <a href="{@docRoot}tools/workflow/index.html">Workflow</a> section.</p>
"{@docRoot}sdk/installing/create-project.html">Managing Projects from Android
Studio</a> and <a href="{@docRoot}tools/building/building-studio.html">Building <p>For a summary of the latest changes, see the <a href=
and Running from Android Studio</a>. For a summary of the latest changes to "{@docRoot}tools/revisions/studio.html">Android Studio Release Notes</a>.</p>
Android Studio, see the <a href="{@docRoot}tools/revisions/studio.html">Android
Studio Release Notes</a>.</p>
<h2 id="project-structure">Project Structure</h2>
<div class="figure" style="width:230px">
<img src="{@docRoot}images/tools/studio/studio-project-files.png" width="230" />
<p class="img-caption"><strong>Figure 1.</strong> The project files in Android
view.</p>
</div>
<h2 id="project-structure">Project and File Structure</h2> <p>Each project in Android Studio contains one or more modules with source code
files and resource files. Different types of modules include:</p>
<h3 id="project-view"><em>Android</em> project view</h3>
<p>By default, Android Studio displays your project files in the <em>Android</em> project view. This
view 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
<a href="{@docRoot}sdk/installing/studio-build.html">Gradle-based build system</a>.
The <em>Android</em> project view:</p>
<ul> <ul>
<li>Shows the most important source directories at the top level of the module hierarchy.</li> <li>Android app modules</li>
<li>Groups the build files for all modules in a common folder.</li> <li>Test modules</li>
<li>Groups all the manifest files for each module in a common folder.</li> <li>Library modules</li>
<li>Shows resource files from all Gradle source sets.</li> <li>App Engine modules</li>
<li>Groups resource files for different locales, orientations, and screen types in a single
group per resource type.</li>
</ul> </ul>
<img src="{@docRoot}images/tools/projectview01.png" /> <p>By default, Android Studio displays your project files in the
<p class="img-caption"><strong>Figure 1.</strong> Show the Android project view.</p> <em>Android</em> project view, as shown in figure 1.
<img src="{@docRoot}images/tools/studio-projectview_scripts.png" /> This view is organized by modules to
<p class="img-caption"><strong>Figure 2.</strong> Show project build files.</p> provide quick access to the key source files of your
project.</p>
<p>The <em>Android</em> project view shows all the build files at the top level of the project
hierarchy under <strong>Gradle Scripts</strong>. Each project module appears as a folder at the
top level of the project hierarchy and contains these four elements at the top level:</p>
<p>All the build files are visible at the top level
under <strong>Gradle Scripts</strong> and each app module
contains the following three elements:</p></p>
<ul> <ul>
<li><code>java/</code> - Source files for the module.</li> <li><b>manifests</b>: Manifest files.</li>
<li><code>manifests/</code> - Manifest files for the module.</li> <li><b>java</b>: Source code files.</li>
<li><code>res/</code> - Resource files for the module.</li> <li><b>res</b>: Resource files.</li>
<li><code>Gradle Scripts/</code> - Gradle build and property files.</li>
</ul> </ul>
<p>For example, <em>Android</em> project view groups all the instances of the <p>The Android project structure on disk differs
<code>ic_launcher.png</code> resource for different screen densities under the same element.</p> from this flattened representation. To see the actual file structure of the
project, select <strong>Project</strong> from the <strong>Project</strong>
drop-down (in figure 1, it's showing as <strong>Android</strong>).</p>
<p class="note"><strong>Note:</strong> The project structure on disk differs from this flattened <p>You can also customize the view of the project files to focus on specific
representation. To switch to back to the segregated project view, select <strong>Project</strong> aspects of your app development. For example, selecting the
from the <strong>Project</strong> drop-down. </p> <strong>Problems</strong> view of your project displays links to the source
files containing any recognized coding and syntax errors, such as missing an
XML element closing tag in a layout file.</p>
<h3 id="other-views">Other Android Studio views</h3>
<p>When you use the <em>Project</em> view in Android Studio, you
should notice that the project structure appears different than you may be used to in Eclipse. Each
instance of Android Studio contains a project with one or more app modules. Each
app module folder contains the complete source sets for that module, including
{@code src/main/} and {@code src/androidTest/} directories, resources, build
file and the Android manifest. For the most part, you will need to modify the files under each
module's {@code src/main/} directory for source code updates, the gradle.build file for build
specification and the files under {@code src/androidTest/} directory for test case creation.
<p> <img src="{@docRoot}images/tools/studio-project-layout.png" alt="" /></p>
<p> <class="img-caption"><strong>Figure 3.</strong> View Android Studio <em>Project</em>
structure.</p>
<p>You can also customize the view of the project files to focus on specific aspects of your app
development: </p>
<ul>
<li><em>Packages</em> </li>
<li><em>Project Files</em> </li>
<li><em>Scratches</em> </li>
<li><em>Problems</em> </li>
<li><em>Production</em> </li>
<li><em>Tests</em> </li>
</ul>
<p>For example, selecting the <strong>Problems</strong> view of your project displays links to the
source files containing any recognized coding and syntax errors, such as missing an XML element
closing tag in a layout file.<p>
<p>For more information, see <p>For more information, see
<a class="external-link" href="http://confluence.jetbrains.com/display/IntelliJIDEA/Project+Organization">IntelliJ project organization</a> <a class="external-link" href="http://confluence.jetbrains.com/display/IntelliJIDEA/Project+Organization">IntelliJ project organization</a>
and <a href="{@docRoot}tools/projects/index.html">Managing Projects</a>.</p> and <a href="{@docRoot}tools/projects/index.html">Managing Projects</a>.</p>
<h2 id="build-system">Gradle Build System</h2>
<h2 id="build-system">Android Build System</h2> <p>Android Studio uses Gradle as the foundation of the build system, with
<p>The Android build system is the toolkit you use to build, test, run and package more Android-specific capabilities provided by the <a
your apps. This build system replaces the Ant system used with Eclipse ADT. It can run as an href="{@docRoot}tools/revisions/gradle-plugin.html">Android Plugin for
integrated tool from the Android Studio menu and independently from the command line. You can use Gradle</a>. This build system
the features of the build system to:</p> runs as an integrated tool from the Android Studio menu and independently from
the command line. You can use the features of the build system to:</p>
<ul> <ul>
<li>Customize, configure, and extend the build process.</li> <li>Customize, configure, and extend the build process.</li>
@@ -146,39 +116,30 @@ the features of the build system to:</p>
<li>Reuse code and resources across source sets.</li> <li>Reuse code and resources across source sets.</li>
</ul> </ul>
<p>The flexibility of the Android build system enables you to achieve all of this without <p>The flexibility of Gradle enables you to achieve all of this without
modifying your app's core source files. To build an Android Studio project, see modifying your app's core source files. To build an Android Studio project, see
<a href="{@docRoot}tools/building/building-studio.html">Building and Running from Android Studio</a>. <a href="{@docRoot}tools/building/building-studio.html">Building and Running
To configure custom build settings in an Android Studio project, see from Android Studio</a>. To configure custom build settings in an Android
<a href="{@docRoot}tools/building/configuring-gradle.html">Configuring Gradle Builds</a>.</p> Studio project, see <a href=
"{@docRoot}tools/building/configuring-gradle.html">Configuring Gradle
Builds</a>.</p>
<h2 id="debug-perf">Debug and Performance</h2>
<p>Android Studio provides a number of improvements to assist you in debugging and improving the <h2 id="debug-perf">Debug and Profile Tools</h2>
performance of your code, including an improved virtual device management, inline debugging, and
<p>Android Studio assists you in debugging and improving the
performance of your code, including inline debugging and
performance analysis tools.</p> performance analysis tools.</p>
<h3>Android Virtual Device (AVD) Manager</h3>
<p>AVD Manager has updated screens with links to help you select the most popular device
configurations, screen sizes and resolutions for your app previews.</p>
Click the <strong>Android Virtual Device Manager</strong>
<img src="{@docRoot}images/tools/avd-manager-studio.png"
style="vertical-align:bottom;margin:0;height:19px" /> in the toolbar to open it and create
new virtual devices for running your app in the emulator.</p>
<p>The AVD Manager comes with emulators for Nexus 6 and Nexus 9 devices and also supports
creating custom Android device skins based on specific emulator properties and assigning those
skins to hardware profiles. Android Studio installs the Intel&#174; x86 Hardware Accelerated Execution
Manager (HAXM) emulator accelerator and creates a default emulator for quick app prototyping.</p>
<p>For more information, see <a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs</a>.</p>
<h3 id="inline-debug">Inline debugging</h3> <h3 id="inline-debug">Inline debugging</h3>
<p>Use inline debugging to enhance your code walk-throughs in the debugger view <p>Use inline debugging to enhance your code walk-throughs in the debugger view
with inline verification of references, expressions, and variable values. Inline debug information with inline verification of references, expressions, and variable values.
includes: </p> Inline debug information includes:</p>
<ul> <ul>
<li>Inline variable values</li> <li>Inline variable values</li>
<li>Referring objects that reference a selected object </li> <li>Referring objects that reference a selected object </li>
@@ -201,7 +162,7 @@ runtime window to launch the Android runtime window. Click the <strong>Memory</s
<img src="{@docRoot}images/tools/studio-memory-monitor.png" <img src="{@docRoot}images/tools/studio-memory-monitor.png"
srcset="{@docRoot}images/tools/studio-memory-monitor2x.png 2x" width"635" height="171" alt="" /> srcset="{@docRoot}images/tools/studio-memory-monitor2x.png 2x" width"635" height="171" alt="" />
<p class="img-caption"><strong>Figure 4.</strong> Monitor memory and CPU usage.</p> <p class="img-caption"><strong>Figure 2.</strong> Monitor memory and CPU usage.</p>
<h4 id="heap-dump">Heap dump </h4> <h4 id="heap-dump">Heap dump </h4>
<p>When you're monitoring memory usage in Android Studio you can, at the same time, initiate <p>When you're monitoring memory usage in Android Studio you can, at the same time, initiate
@@ -210,7 +171,7 @@ format file. The HPROF viewer displays classes, instances of each class, and a r
help you track memory usage and find memory leaks. </p> help you track memory usage and find memory leaks. </p>
<img src="{@docRoot}images/tools/studio-hprof-viewer.png" alt="" /> <img src="{@docRoot}images/tools/studio-hprof-viewer.png" alt="" />
<p class="img-caption"><strong>Figure 5.</strong> HPROF viewer with heap dump.</p> <p class="img-caption"><strong>Figure 3.</strong> HPROF viewer with heap dump.</p>
<p>To create a snapshot of the Android app heap memory, click the <p>To create a snapshot of the Android app heap memory, click the
Dump Java Heap icon (<img src="{@docRoot}images/tools/studio-dump-heap-icon.png" style="vertical-align:bottom;margin:0;height:17px"/>) Dump Java Heap icon (<img src="{@docRoot}images/tools/studio-dump-heap-icon.png" style="vertical-align:bottom;margin:0;height:17px"/>)
@@ -230,7 +191,7 @@ Knowing these allocations enables you to adjust the method
calls related to those actions to optimize your app's performance and memory use. </p> calls related to those actions to optimize your app's performance and memory use. </p>
<img src="{@docRoot}images/tools/studio-allocation-tracker.png" alt="" /> <img src="{@docRoot}images/tools/studio-allocation-tracker.png" alt="" />
<p class="img-caption"><strong>Figure 6.</strong> Allocation tracker.</p> <p class="img-caption"><strong>Figure 4.</strong> Allocation tracker.</p>
<p>For information about tracking and analyzing allocations, see <p>For information about tracking and analyzing allocations, see
<a href="{@docRoot}/tools/help/am-memory.html#tracking">Memory Monitor</a>. <a href="{@docRoot}/tools/help/am-memory.html#tracking">Memory Monitor</a>.
@@ -311,17 +272,6 @@ to <em>error</em>. </p>
The <em>Inspections Scope</em> dialog appears so you can specify the desired inspection profile and scope.</p> The <em>Inspections Scope</em> dialog appears so you can specify the desired inspection profile and scope.</p>
<h4>Running inspections from the command line</h4>
<p>You can also run {@code lint} inspections from the command line in your SDK directory. </p>
<pre>
sdk$ lint [flags] <project directories>
</pre>
<p class="note"><strong>Note:</strong> The {@code lint} <strong>--show</strong> and <strong>--list</strong>
flags can be used to display the available issues and explanations. </p>
<p>For more information, see <p>For more information, see
<a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with {@code lint}</a> <a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with {@code lint}</a>
and <a href="{@docRoot}tools/help/lint.html">lint tool</a>.</p> and <a href="{@docRoot}tools/help/lint.html">lint tool</a>.</p>