am e3fe9382: docs: studio basics v2 [CP]

* commit 'e3fe9382b93b688384553202db718922c7a957ec':
  docs: studio basics v2 [CP]
This commit is contained in:
Rich Slogar
2014-12-08 03:24:41 +00:00
committed by Android Git Automerger
19 changed files with 594 additions and 130 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -1,56 +1,170 @@
page.title=Android Studio Tips and Tricks
@jd:body
<div id="qv-wrapper">
<div id="qv">
<h2>See also</h2>
<ul>
<li><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Working+in+Eclipse+Compatibility+Mode" class="external-link"
>Eclipse Compatibility Mode</a></li>
<li><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/FAQ+on+Migrating+to+IntelliJ+IDEA" class="external-link"
>FAQ on Migrating</a></li>
<li><a href="http://android-developers.blogspot.com/2013/06/adding-backend-to-your-app-in-android.html"
class="external-link">Adding a Backend to Your App In Android Studio</a></li>
</ul>
<h2>In this document</h2>
<ol>
<li><a href="#productivity-features">Productivity Features</a></li>
<li><a href="#intellij">Working with IntelliJ</a></li>
<li><a href="#key-commands">Key Commands</a></li>
</ol>
<h2>See also</h2>
<ol>
<li><a href="{@docRoot}sdk/index.html">Download Android Studio</a></li>
<li><a href="http://wiki.jetbrains.net/intellij/Android">IntelliJ IDEA Android Tutorials</a></li>
<li><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/FAQ+on+Migrating+to+IntelliJ+IDEA">IntelliJ FAQ on migrating to IntelliJ IDEA</a></li>
</ol>
</div>
</div>
<p>If you're unfamiliar with the IntelliJ IDEA interface, you might be wondering
how to accomplish some common tasks in Android Studio. This page provides some tips
to help you get going.</p>
<p>If you're unfamiliar with using Android Studio and the IntelliJ IDEA interface, this page
provides some tips to help you get started with some of the most common tasks and productivity
enhancements. </p>
<p>For complete user documentation for the IntelliJ IDEA interface
(upon which Android Studio is based), refer to the
<a href="http://www.jetbrains.com/idea/index.html">IntelliJ IDEA documentation</a>.</p>
<div class="figure" style="width:200px">
<img src="{@docRoot}images/tools/project-layout.png" alt="" />
<p class="img-caption"><strong>Figure 1.</strong> Gradle project structure</p>
</div>
<h2 id="productivity-features">Productivity Features</h2>
<h2 id="Project">Project Structure</h2>
<p>Android Studio includes a number of features to help you be more productive in your coding.
This section notes a few of the key features to help you work quickly and efficiently.
</p>
<p>When you create a new project in Android Studio (or
<a href="{@docRoot}sdk/installing/migrate.html">migrate a project from Eclipse</a>),
you'll notice that the project structure appears differently than you may be used to.
As shown in figure 1, almost all your project files are now inside the {@code src/} directory,
including resources and the manifest file.</p>
<p>The new project structure is due to the switch to a Gradle-based build system. This structure
provides more flexibility to the build process and will allow multiple build variants (a feature not
yet fully implemented). Everything still behaves as you expect, but some of the files have moved
around. For the most part, you should need to modify only the files under the {@code src/}
directory. More information about the Gradle project structure is available in the
<a href="http://tools.android.com/tech-docs/new-build-system/user-guide">Gradle
Plugin User Guide</a>.</p>
<h3>Smart Rendering</h3>
<p>With smart rendering, Android Studio displays links for quick fixes to rendering errors.
For example, if you add a button to the layout without specifying the <em>width</em> and
<em>height</em> atttributes, Android Studio displays the rendering message <em>Automatically
add all missing attributs</em>. Clicking the message adds the missing attributes to the layout.</p>
<h3> Bitmap rendering in the debugger</h3>
<p>While debugging, you can now right-click on bitmap variables in your app and invoke
<em>View Bitmap</em>. This fetches the associated data from the debugged process and renders
the bitmap in the debugger. </p>
<p><img src="{@docRoot}images/tools/studio-bitmap-rendering.png" style="width:350px"/></p>
<p class="img-caption"><strong>Figure 2.</strong> Bitmap Rendering</p>
<h3>Output window message filtering</h3>
<p>When checking build results, you can filter messages by <em>message type</em> to quickly
locate messages of interest.</p>
<img src="{@docRoot}images/tools/studio-outputwindowmsgfiltering.png" style="width:200px"style="width:200px" />
<p class="img-caption"><strong>Figure 3.</strong> Filter Build Messages</p>
<h3>Hierarchical parent setting</h3>
<p>The activity parent can now be set in the Activity Wizard when creating a new
activity. Setting a <em>hierarchal parent</em> sets the {@code Up} button to automatically
appear in the app's Action bar when viewing a child activity, so the {@code Up}
button no longer needs to be manually specified in the <em>menu.xml</em> file.</p>
<h3>Creating layouts</h3>
<p>Android Studio offers an advanced layout editor that allows you to drag-and-drop widgets
into your layout and preview your layout while editing the XML.</p>
<p>While editing in the <strong>Text</strong> view, you can preview the layout on devices by
opening the <strong>Preview</strong> pane available on the right side of the window. Within the
Preview pane, you can modify the preview by changing various options at the top of the pane,
including the preview device, layout theme, platform version and more. To preview the layout on
multiple devices simultaneously, select <strong>Preview All Screen Sizes</strong> from the
device drop-down.</p>
<p><img src="{@docRoot}images/tools/studio-previewall.png" style="width:350px"/></p>
<p class="img-caption"><strong>Figure 4.</strong> Preview All Screens</p>
<p>You can switch to the graphical editor by clicking <strong>Design</strong> at the
bottom of the window. While editing in the Design view, you can show and hide the
widgets available to drag-and-drop by clicking <strong>Palette</strong> on the left side of the
window. Clicking <strong>Designer</strong> on the right side of the window reveals a panel
with a layout hierarchy and a list of properties for each view in the layout.</p>
<h2 id="intellij">Working with IntelliJ</h3>
<p>This section list just a few of the code editing
practices you should consider using when creating Android Studio apps. </p>
<p>For complete user documentation for the IntelliJ IDEA interface (upon which Android Studio
is based), refer to the
<a href="http://www.jetbrains.com/idea/documentation/index.jsp">IntelliJ IDEA documentation</a>.</p>
<h2 id="Basics">Basic Operations</h2>
<h3><em>Alt + Enter</em> key binding</h3>
<p>For quick fixes to coding errors, the IntelliJ powered IDE implements the <em>Alt + Enter</em>
key binding to fix errors (missing imports, variable assignments, missing references, etc) when
possible, and if not, suggest the most probably solution. </p>
<p>The following topics describe how to perform
some basic development tasks with Android Studio.</p>
<h3><em>Ctrl + D</em> key binding</h3>
<p>The <em>Ctrl + D</em> key binding is great for quickly duplicating code lines or fragments.
Simply select the desired line or fragment and enter this key binding. </p>
<h3>Navigate menu</h3>
<p>In case you're not familiar with an API class, file or symbol, the <em>Navigate</em> menu lets
you jump directly to the class of a method or field name without having to search through
individual classes. </p>
<h3>Inspection scopes</h3>
<p>Scopes set the color of code segments for easy code identification and location. For example,
you can set a scope to identify all code related to a specific action bar. </p>
<h3>External annotations</h3>
<p>Specify annotations within the code or from an external annotation file. The Android Studio
IDE keeps track of the restrictions and validates compliance, for example setting the data type
of a string as not null.</p>
<h3>Injecting languages</h3>
<p>With language injection, the Android Studio IDE allows you to work with islands of different
languages embedded in the source code. This extends the syntax, error highlighting and coding
assistance to the embedded language. This can be especially useful for checking regular expression
values inline, and validating XML and SQL statments.</p>
<h3>Code folding</h3>
<p>This allows you to selectively hide and display sections of the code for readability. For
example, resource expressions or code for a nested class can be folded or hidden in to one line
to make the outer class structure easier to read. The inner clas can be later expanded for
updates. </p>
<h3>Image and color preview</h3>
<p>When referencing images and icons in your code, a preview of the image or icon appears
(in actual size at different densities) in the code margin to help you verify the image or icon
reference. Pressing {@code F1} with the preview image or icon selected displays resource asset
details, such as the <em>dp</em> settings. </p>
<h3>Quick F1 documentation</h3>
<p>You can now inspect theme attributes using <strong>View > Quick Documentation</strong>
(<strong>F1</strong>),
see the theme inheritance hierarchy, and resolve values for the various attributes.</p>
<p>If you invoke <strong> View > Quick Documentation</strong> (usually bound to F1) on the theme
attribute <em>?android:textAppearanceLarge</em>, you will see the theme inheritance hierarchy and
resolved values for the various attributes that are pulled in.</p>
<h3>New Allocation Tracker integration in the Android/DDMS window</h3>
<p>You can now inspect theme attributes using <strong> View > Quick Documentation
</strong> <code>F1</code>, see the theme inheritance hierarchy, and resolved values for the
various attributes.</p>
<img src="{@docRoot}images/tools/studio-allocationtracker.png" style="width:300px" />
<p class="img-caption"><strong>Figure 1.</strong> Allocation Tracker</p>
<h3 id="key-commands">Keyboard Commands</h3>
<p>The following tables list keyboard shortcuts for common operations.</p>
<p class="note"><strong>Note:</strong> This section lists Android Studio keyboard shortcuts
for the default keymap. To change the default keymap on Windows and Linux, go to
@@ -58,85 +172,10 @@ for the default keymap. To change the default keymap on Windows and Linux, go to
the default keymap on Mac OS X, go to <strong>Android Studio</strong> &gt;
<strong>Preferences</strong> &gt; <strong>Keymap</strong>.</p>
<h3>Creating virtual devices</h3>
<p>All the capabilities of the <a href="{@docRoot}tools/devices/managing-avds.html">Android
Virtual Device Manager</a> are accessible directly from
the Android Studio interface. 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>
<h3>Installing SDK updates</h3>
<p>The <a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a>
is also accessible to download new Android tools, platforms, and libraries
for your app. Click the <strong>SDK Manager</strong>
<img src="{@docRoot}images/tools/sdk-manager-studio.png"
style="vertical-align:bottom;margin:0;height:19px" /> in the toolbar to open it and check
for updates.</p>
<h3>Creating new files</h3>
<p>You can quickly add new code and resource files by clicking the appropriate directory in the
<strong>Project</strong> pane and pressing ALT + INSERT on Windows and Linux or COMMAND + N on Mac.
Based on the type of directory selected, Android Studio offers to create the appropriate file
type.</p>
<p>For example, if you select a layout directory, press ALT + INSERT on Windows, and select
<strong>Layout resource file</strong>, a dialog opens so you can name the file (you can exclude
the {@code .xml} suffix) and choose a root view element. The editor then switches to the layout
design editor so you can begin designing your layout.</p>
<h3>Creating layouts</h3>
<p>Android Studio offers an advanced layout editor that allows you to drag-and-drop widgets
into your layout and preview your layout while editing the XML.</p>
<p>While editing in the <strong>Text</strong> view, you can preview the layout on devices by opening
the <strong>Preview</strong> pane available on the right side of the window. Within the
Preview pane, you can modify the preview by changing various options at the top of the pane, including
the preview device, layout theme, platform version and more. To preview the layout on multiple
devices simultaneously, select <strong>Preview All Screen Sizes</strong> from the device drop-down.
</p>
<p>You can switch to the graphical editor by clicking <strong>Design</strong> at the
bottom of the window. While editing in the Design view, you can show and hide the
widgets available to drag-and-drop by clicking <strong>Palette</strong> on the
left side of the window. Clicking <strong>Designer</strong> on the right side of the window reveals
a panel with a layout hierarchy and a list of properties for each view in the layout.</p>
<h3>Debugging</h3>
<p>When you build and run your app with Android Studio, you can view adb and device log messages
(logcat) in the DDMS pane by clicking <strong>Android</strong> at the bottom of the window.</p>
<p>If you want to debug your app with the <a
href="{@docRoot}tools/help/monitor.html">Android Debug Monitor</a>, you can launch it by
clicking <strong>Monitor</strong> <img src="{@docRoot}images/tools/monitor-studio.png"
style="vertical-align:bottom;margin:0;height:19px" /> in the toolbar. The Debug Monitor is where
you can find the complete set of <a href="{@docRoot}tools/debugging/ddms.html">DDMS</a>
tools for profiling your app, controlling device
behaviors, and more. It also includes the Hierarchy Viewer tools to help
<a href="{@docRoot}tools/debugging/debugging-ui.html">optimize your layouts</a>.</p>
<h2 id="KeyCommands">Keyboard Commands</h2>
<p>The following tables list keyboard shortcuts for common operations.</p>
<p class="note"><strong>Note:</strong> If you're using Mac OS X, update your keymap to use
the Mac OS X 10.5+ version keymaps under <strong>Android Studio > Preferences > Keymap</strong>.</p>
<p class="table-caption"><strong>Table 1.</strong> Programming key commands</p>
<table>
<tr><th>Action</th><th>Android Studio Key Command</th></tr>
@@ -227,7 +266,6 @@ the Mac OS X 10.5+ version keymaps under <strong>Android Studio > Preferences >
</table>
<p>For a complete keymap reference guide, see the <a
href="http://www.jetbrains.com/idea/documentation/index.jsp">IntelliJ IDEA</a>
<p>For a complete keymap reference guide, see the
<a href="http://www.jetbrains.com/idea/documentation/index.jsp">IntelliJ IDEA</a>
documentation.</p>

View File

@@ -0,0 +1,432 @@
page.title=Android Studio
@jd:body
<div id="qv-wrapper">
<div id="qv">
<h2>In this document</h2>
<ol>
<li><a href="#project-structure">Project and File Structure</a></li>
<li><a href="#build-system">Android Build System</a></li>
<li><a href="#debug-perf">Debug and Performance</a></li>
<li><a href="#install-updates">Installation, Setup, and Update Management</a></li>
<li><a href="#other">Other Highlights</a></li>
</ol>
<h2>See also</h2>
<ol>
<li><a href="{@docRoot}tools/sdk/index.html">Download Android Studio</a></li>
<li><a href="{@docRoot}tools/basics/index.html">Android Studio</a></li>
<li><a href="http://wiki.jetbrains.net/intellij/Android">IntelliJ IDEA Android Tutorials</a></li>
<li><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/FAQ+on+Migrating+to+IntelliJ+IDEA">IntelliJ FAQ on migrating to IntelliJ IDEA</a></li>
<li><a href="{@docRoot}tools/buildsystem/index.html">Build System</a></li>
</ol>
</div>
</div>
<a class="notice-developers-video"
href="http://developers.google.com/events/io/sessions/324603352">
<div>
<h3>Video</h3>
<p>What's New in Android Developer Tools</p>
</div>
</a
<div style="position:relative;height:0">
<div style="position:absolute;width:420px">
</div>
</div>
<p>Android Studio is a new Android development environment based on IntelliJ IDEA. It is the official
Android IDE. On top of the capabilities you expect from IntelliJ, Android Studio offers:</p>
<ul>
<li>Flexible Gradle-based build system</li>
<li>Build variants and multiple <code>apk</code> file generation</li>
<li>Updated AVD Manager with support for custom device skins</li>
<li>Expanded template support for Google Services and new device types</li>
<li>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>ProGuard and app-signing capabilities</li>
<li>Built-in support for <a
href="http://developers.google.com/cloud/devtools/android_studio_templates/"
class="external-link">Google Cloud Platform</a>, making it easy to integrate Google Cloud
Messaging and App Engine</li>
<li>And much more ...</li>
</ul>
<p>If you're ready, go here to get started with
<a href="{@docRoot}training/basics/firstapp/index.html">Building Your First App</a>. </p>
<p>If you're unfamiliar with the Android Studio or the IntelliJ IDEA interface, or just wondering
about what's new, you might be interested in exploring some common tasks before building your app.
</p>
<p>For starters, Android Studio installs with a basic <em>hello world</em> app to introduce you to
the basic Android Studio project structure and navigation. This section highlights the Android
Studio features. </p>
<h2 id="project-structure">Project and File Structure</h2>
<h3 id="project-view"><em>Android</em> Project View</h3>
<p>By default, Android Studio displays your profile 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 new
<a href="{@docRoot}sdk/installing/studio-build.html">Gradle-based build system</a>.
The Android project view:</p>
<ul>
<li>Groups the build files for all modules at the top level of the project hierarchy.</li>
<li>Shows the most important source directories at the top level of the module hierarchy.</li>
<li>Groups all the manifest files for each module.</li>
<li>Shows resource files from all Gradle source sets.</li>
<li>Groups resource files for different locales, orientations, and screen types in a single
group per resource type.</li>
</ul>
<img src="{@docRoot}images/tools/projectview01.png" />
<p class="img-caption"><strong>Figure 1:</strong> Show the Android project view.</p>
<img src="{@docRoot}images/tools/studio-projectview_scripts.png" />
<p class="img-caption"><strong>Figure 2:</strong> Project Build Files.</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 three elements at the top level:</p>
<ul>
<li><code>java/</code> - Source files for the module.</li>
<li><code>manifests/</code> - Manifest files for the module.</li>
<li><code>res/</code> - Resource files for the module.</li>
</ul>
<p>For example, <em>Android</em> project view groups all the instances of the
<code>ic_launcher.png</code> resource for different screen densities under the same element.</p>
<p class="note"><strong>Note:</strong> The project structure on disk differs from this flattened
representation. To switch to back the segregated project view, select <strong>Project</strong> from
the <strong>Project</strong drop-down. </p>
<h3>New Project and Directory Structure</h3>
<p>When you use the <em>Project</em> view of a new project in Android Studio or
(<a href="{@docRoot}tools/eclipse/migrate-adt.html"> a project migrated from Eclipse</a>), you
should notice that the project structure appears different than you may be used to. Each
instance of Android Studio contains a project with one or more application modules. Each
application 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> Android Studio project structure</p>
<p>For more information, see <a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Project +Organization"class="external-link">IntelliJ project organization</a> and
<a href="{@docRoot}tools/workflow/project/index.html">Managing Projects</a>.</p>
<h3>Creating new files</h3>
<p>You can quickly add new code and resource files by clicking the appropriate directory in the
<strong>Project</strong> pane and pressing <code>ALT + INSERT</code> on Windows and Linux or
<code>COMMAND + N</code> on Mac. Based on the type of directory selected, Android Studio
offers to create the appropriate file type.</p>
<p>For example, if you select a layout directory, press <code>ALT + INSERT</code> on Windows,
and select <strong>Layout resource file</strong>, a dialog opens so you can name the file
(you can exclude the {@code .xml} suffix) and choose a root view element. The editor then
switches to the layout design editor so you can begin designing your layout.</p>
<h2 id="build-system">Android Build System</h2>
<h3>Android Build System</h3>
<p>The Android build system is the toolkit you use to build, test, run and package
your apps. This build system replaces the Ant system used with Eclipse ADT. It can run 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>
<li>Customize, configure, and extend the build process.</li>
<li>Create multiple APKs for your app with different features using the same project and
modules.</li>
<li>Reuse code and resources across source sets.</li>
</ul>
<p>The flexibility of the Android build system enables you to achieve all of this without
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>.
To configure custom build settings in an Android Studio project, see
<a href="{@docRoot}tools/gradle/configuring-studio-builds.html">Configure Android Studio Builds</a>.</p>
<h3>Application ID for Package Identification </h3>
<p>With the Android build system, the <em>applicationId</em> attribute is used to
uniquely identify application packages for publishing. The application ID is set in the
<em>android</em> section of the <code>build.gradle</code> file.
</p>
<pre>
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "19.1"
defaultConfig {
<strong>applicationId "com.example.my.app"</strong>
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
...
</pre>
<p class="note"><strong>Note:</strong> The <em>applicationId</em> is specified only in your
build.gradle file, and not in the AndroidManifest.xml file.</p>
<p>When using build variants, the build system enables you to to uniquely identify different
packages for each product flavors and build types. The application ID in the build type is added as
a suffix to those specified for the product flavors. </p>
<pre>
productFlavors {
pro {
applicationId = "com.example.my.pkg.pro"
}
free {
applicationId = "com.example.my.pkg.free"
}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
}
}
....
</pre>
<p>The package name must still be specified in the manifest file. It is used in your source code
to refer to your R class and to resolve any relative activity/service registrations. </p>
<pre>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<strong>package="com.example.app"</strong>>
</pre>
<p class="note"><strong>Note:</strong> If you have multiple manifests (for exmample, a product
flavor specific manifest and a build type manifest), the package name is optional in those manifests.
If it is specified in those manifests, the package name must be identical to the package name
specified in the manifest in the <code>src/main/</code> folder. </p>
<p>For more information about the build files and process, see
<a href="{@docRoot}sdk/installing/studio-build.html">Build System Overview</a>.</p>
<h2 id="debug-perf">Debug and Performance</h2>
<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 the Intel x86 Emulator Accelerator (HAXM)
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> Memory Monitor</h3>
<p>Android Studio provides a memory monitor view so you can more easily monitor your
app's memory usage to find deallocated objects, locate memory leaks and track the amount of
memory the connected device is using. With your app running on a device or emulator, click the
<strong>Memory Monitor</strong> tab in the lower right corner to launch the memory monitor. </p>
<img src="{@docRoot}images/tools/studio-memory-monitor.png" />
<p class="img-caption"><strong>Figure 5.</strong> Memory Monitor</p>
<h3> New Lint inspections</h3>
<p>Lint has several new checks to ensure:
<ul>
<li><code> Cipher.getInstance()</code> is used with safe values</li>
<li>In custom Views, the associated declare-styleable for the custom view uses the same
base name as the class name.</li>
<li>Security check for fragment injection.</li>
<li>Where ever property assignment no longer works as expected.</li>
<li>Gradle plugin version is compatible with the SDK.</li>
<li>Right to left validation </li>
<li>Required API version</li>
<li>many others</li>
</ul>
<p>Hovering over a Lint error displays the full issue explanation inline for easy error
resolution. There is also a helpful hyperlink at the end of the error message for additional
error information.</p>
<p>With Android Studio, you can run Lint for a specific build variant, or for all build variants.
You can configure Lint by adding a <em>lintOptions</em> property to the Android settings in the
build.gradle file. </p>
<pre>
android {
lintOptions {
// set to true to turn off analysis progress reporting by lint
quiet true
// if true, stop the gradle build if errors are found
abortOnError false
// if true, only report errors
ignoreWarnings true
</pre>
<p>For more information, see
<a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with Lint</a>.</p>
<h3>Dynamic layout preview</h3>
<p>Android Studio allows you to work with layouts in both a <em>Design View</em> </p>
<p><img src="{@docRoot}images/tools/studio-helloworld-design.png" alt="" />
</p>
<p class="img-caption"><strong>Figure 6.</strong> Hello World App with Design View</p>
<p>and a <em>Text View</em>. </p>
<p><img src="{@docRoot}images/tools/studio-helloworld-text.png" alt="" />
<pclass="img-caption"><strong>Figure 7.</strong> Hello World App with Text View</p>
<p>Easily select and preview layout changes for different device images, display
densities, UI modes, locales, and Android versions (multi-API version rendering).
<p><img src="{@docRoot}images/tools/studio-api-version-rendering.png" /></p>
<p class="img-caption"><strong>Figure 11.</strong> API Version Rendering</p>
<p>From the Design View, you can drag and drop elements from the Palette to the Preview or
Component Tree. The Text View allows you to directly edit the XML settings, while previewing
the device display. </p>
<h3>Log messages</h3>
<p>When you build and run your app with Android Studio, you can view adb and device log messages
(logcat) in the DDMS pane by clicking <strong>Android</strong> at the bottom of the window.</p>
<p>If you want to debug your app with the
<ahref="{@docRoot}tools/help/monitor.html">Android Debug Monitor</a>, you can launch it by
clicking <strong>Monitor</strong>
<img src="{@docRoot}images/tools/monitor-studio.png" style="vertical-align:bottom;margin:0;height:19px"/>
in the toolbar. The Debug Monitor is where you can find the complete set of
<a href="{@docRoot}tools/debugging/ddms.html">DDMS</a> tools for profiling your app,
controlling device behaviors, and more. It also includes the Hierarchy Viewer tools to help
<a href="{@docRoot}tools/debugging/debugging-ui.html"> optimize your layouts</a>.</p>
<h2 id="install-updates">Installation, Setup, and Update Management</h2>
<h3>Android Studio installation and setup wizards</h3>
<p>An updated installation and setup wizards walk you through a step-by-step installation
and setup process as the wizard checks for system requirements, such as the Java Development
Kit (JDK) and available RAM, and then prompts for optional installation options, such as the
Intel &#174; HAXM accelerator.</p>
<p>An updated setup wizard walks you through the setup processes as
the wizard updates your system image and emulation requirements, such GPU, and then creates
an optimized default Android Virtual Device (AVD) based on Android 5 (Lollipop) for speedie and
reliable emulation. </p>
<p><img src="{@docRoot}images/tools/studio-setup-wizard.png" /></p>
<p class="img-caption"><strong>Figure 10.</strong> Setup Wizard</p>
<h3>Expanded template and form factor support</h3>
<p>Android Studio supports new templates for Google Services and expands the availabe device
types. </p>
<h4> Android Wear and TV support</h4>
<p>For easy cross-platform development, the Project Wizard provides new templates for
creating your apps for Android Wear and TV. </p>
<p><img src="{@docRoot}images/tools/studio-tvwearsupport.png" />
<p class="img-caption"><strong>Figure 8.</strong> New Form Factors</p>
<p>During app creation, the Project Wizard also displays an API Level dialog to help you choose
the best <em>minSdkVersion</em> for your project.</p>
<h4> Google App Engine integration (Google Cloud Platform/Messaging)</h4>
<p>Quick cloud integration. Using Google App Engine to connect to the Google cloud
and create a cloud end-point is as easy as selecting <em>File > New Module > App Engine Java
Servlet Module</em> and specifying the module, package, and client names. </p>
<p><img src="{@docRoot}images/tools/studio-cloudmodule.png" /></p>
<p class="img-caption"><strong>Figure 9.</strong> Setup Wizard</p>
<h3>Update channels</h3>
<p>Android Studio provides four update channels to keep Android Studio up-to-date based on your
code-level preference:
<ul>
<li><strong>Canary channel</strong>: Canary builds provide bleeding edge releases, updated
about weekly. While these builds do get tested, they are still subject to bugs, as we want
people to see what's new as soon as possible. This is not recommended for production.</li>
<li><strong>Dev channel</strong>: Dev builds are hand-picked older canary builds that survived
the test of time. They are updated roughly bi-weekly or monthly.</li>
<li><strong>Beta channel</strong>: Beta builds are used for beta-quality releases before a
production release.</li>
<li><strong>Stable channel</strong>: Used for stable, production-read versions.</li>
</ul>
</p>
<p>By default, Android Studio uses the <em>Stable</em> channel. Use
<strong>File > Settings > Updates</strong> to change your channel setting. </p>
<h2 id="other">Other Highlights/h2>
<h3> Translation Editor</h3>
<p>Multi-language support is enhanced with the Translation Editor plugin so you can easily add
locales to the app's translation file. Color codes indicate whether a locale is complete or
still missing string translations. Also, you can use the plugin to export your strings to the
Google Play Developer Console for translation, then download and import your translations back
into your project. </p>
<p>To access the Translation Editor, open a <code>strings.xml</code> file and click the
<strong>Open Editor</strong> link. </p>
<img src="{@docRoot}images/tools/studio-translationeditoropen.png" />
<p class="img-caption"><strong>Figure 4.</strong> Translation Editor</p>
<h3> Editor support for the latest Android APIs</h3>
<p>Android Studio supports the new
<a href="{@docRoot}design/material/index.html">Material Design</a></li> themes, widgets, and
graphics, such as shadow layers and API version rendering (showing the layout across different
UI versions). Also, the new drawable XML tags and attributes, such as &lt;ripple&gt;
and &lt;animated-selector&gt;, are supported.</p>
<h3> Easy access to Android code samples on GitHub</h3>
<p>Clicking <strong>Import Samples</strong> from the <strong>File</strong> menu or Welcome page
provides seamless access to Google code samples on GitHub.</p>
<p><img src="{@docRoot}images/tools/studio-samples-githubaccess.png" /></p>
<p class="img-caption"><strong>Figure 12.</strong> Code Sample Access/p>

View File

@@ -13,27 +13,21 @@
</li>
<li class="nav-section">
<!-- Android Studio menu-->
<li class="nav-section">
<div class="nav-section-header">
<a href="<?cs var:toroot ?>sdk/installing/studio.html">Android Studio</a>
<a href="<?cs var:toroot?>tools/studio/index.html">Android Studio</a>
</div>
<ul>
<li><a href="<?cs var:toroot ?>sdk/installing/migrate.html">
Migrating from Eclipse</a></li>
<li><a href="<?cs var:toroot ?>sdk/installing/create-project.html">
Creating a Project</a></li>
<li><a href="<?cs var:toroot ?>sdk/installing/studio-tips.html">
Tips and Tricks</a></li>
<li><a href="<?cs var:toroot ?>sdk/installing/studio-androidview.html">
Using the Android Project View</a></li>
<li><a href="<?cs var:toroot ?>sdk/installing/studio-layout.html">
Using the Layout Editor</a></li>
<li><a href="<?cs var:toroot ?>sdk/installing/studio-build.html">
Building Your Project with Gradle</a></li>
<li><a href="<?cs var:toroot ?>sdk/installing/studio-debug.html">
Debugging with Android Studio</a></li>
</ul>
</li>
</ul>
</li><!-- End of Android Studio menu -->
<!-- Workflow menu-->
<li class="nav-section">
<div class="nav-section-header">