diff options
Diffstat (limited to 'docs/html/tools')
| -rw-r--r-- | docs/html/tools/basics/index.jd | 438 | ||||
| -rw-r--r-- | docs/html/tools/basics/studio-tips.jd | 279 | ||||
| -rw-r--r-- | docs/html/tools/building/building-eclipse.jd | 25 | ||||
| -rw-r--r-- | docs/html/tools/debugging/debugging-projects-cmdline.jd | 10 | ||||
| -rw-r--r-- | docs/html/tools/debugging/debugging-studio.jd | 406 | ||||
| -rw-r--r-- | docs/html/tools/debugging/index.jd | 33 | ||||
| -rw-r--r-- | docs/html/tools/device.jd | 20 | ||||
| -rw-r--r-- | docs/html/tools/eclipse/index.jd | 41 | ||||
| -rw-r--r-- | docs/html/tools/extras/oem-usb.jd | 46 | ||||
| -rw-r--r-- | docs/html/tools/help/index.jd | 174 | ||||
| -rw-r--r-- | docs/html/tools/help/layoutopt.jd | 4 | ||||
| -rw-r--r-- | docs/html/tools/revisions/studio.jd | 224 | ||||
| -rw-r--r-- | docs/html/tools/support-library/features.jd | 31 | ||||
| -rw-r--r-- | docs/html/tools/support-library/setup.jd | 26 | ||||
| -rw-r--r-- | docs/html/tools/tools_toc.cs | 168 | ||||
| -rw-r--r-- | docs/html/tools/workflow/index.jd | 131 |
16 files changed, 1784 insertions, 272 deletions
diff --git a/docs/html/tools/basics/index.jd b/docs/html/tools/basics/index.jd new file mode 100644 index 0000000..25d8f0a --- /dev/null +++ b/docs/html/tools/basics/index.jd @@ -0,0 +1,438 @@ +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 ® 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 <ripple> +and <animated-selector>, 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> + + + + + + + diff --git a/docs/html/tools/basics/studio-tips.jd b/docs/html/tools/basics/studio-tips.jd new file mode 100644 index 0000000..253c944 --- /dev/null +++ b/docs/html/tools/basics/studio-tips.jd @@ -0,0 +1,279 @@ +page.title=Android Studio Tips and Tricks +@jd:body + +<div id="qv-wrapper"> +<div id="qv"> + + <h2>In this document</h2> + <ol> + <li><a href="#whats-new">What's New</a></li> + <li><a href="#tips-tricks">Tips & Tricks</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}tools/sdk/index.html">Download Android Studio</a></li> + <li><a href="{@docRoot}tools/sdk/index.html">Download Standalone SDK tools.</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> + +<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> + + + + <h2>Smart Rendering</h2> + <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> + + + <h2> Bitmap rendering in the debugger</h2> + <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 13.</strong> Bitmap Rendering/p> + + + <h2>Output window message filtering</h2> + <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 14.</strong> Filter Build Messages</p> + + + + <h2>Hierarchical parent setting</h2> + <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> + + + <h2>Creating layouts</h2> + <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 15.</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> + + + + <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> + + + <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 16</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 +<strong>File</strong> > <strong>Settings</strong> > <strong>Keymap</strong>. To change +the default keymap on Mac OS X, go to <strong>Android Studio</strong> > +<strong>Preferences</strong> > <strong>Keymap</strong>.</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> + +<tr> + <td>Command look-up (autocomplete command name)</td> + <td>CTRL + SHIFT + A</td> +</tr> + +<tr> + <td>Project quick fix</td> + <td>ALT + ENTER</td> +</tr> + +<tr> + <td>Reformat code</td> + <td>CTRL + ALT + L (Win)<br> + OPTION + CMD + L (Mac)</td> +</tr> + +<tr> + <td>Show docs for selected API</td> + <td>CTRL + Q (Win)<br> + F1 (Mac)</td> +</tr> + +<tr> + <td>Show parameters for selected method</td> + <td>CTRL + P</td> +</tr> + +<tr> + <td>Generate method</td> + <td>ALT + Insert (Win)<br> + CMD + N (Mac)</td> +</tr> + +<tr> + <td>Jump to source</td> + <td>F4 (Win)<br> + CMD + down-arrow (Mac)</td> +</tr> + +<tr> + <td>Delete line</td> + <td>CTRL + Y (Win)<br> + CMD + Backspace (Mac)</td> +</tr> + +<tr> + <td>Search by symbol name</td> + <td>CTRL + ALT + SHIFT + N (Win)<br> + OPTION + CMD + O (Mac)</td> +</tr> + +</table> + + + + +<p class="table-caption"><strong>Table 2.</strong> Project and editor key commands</p> +<table> +<tr><th>Action</th><th>Android Studio Key Command</th></tr> + +<tr> + <td>Build</td> + <td>CTRL + F9 (Win)<br> + CMD + F9 (Mac)</td> +</tr> + +<tr> + <td>Build and run</td> + <td>SHIFT + F10 (Win)<br> + CTRL + R (Mac)</td> +</tr> + +<tr> + <td>Toggle project visibility</td> + <td>ALT + 1 (Win)<br> + CMD + 1 (Mac)</td> +</tr> + +<tr> + <td>Navigate open tabs</td> + <td>ALT + left-arrow; ALT + right-arrow (Win)<br> + CTRL + left-arrow; CTRL + right-arrow (Mac)</td> +</tr> + +</table> + +<p>For a complete keymap reference guide, see the +<a href="http://www.jetbrains.com/idea/documentation/index.jsp">IntelliJ IDEA</a> documentation.</p> + + +</div> + + +</div> + + + diff --git a/docs/html/tools/building/building-eclipse.jd b/docs/html/tools/building/building-eclipse.jd index 7a4367a..79ef3de 100644 --- a/docs/html/tools/building/building-eclipse.jd +++ b/docs/html/tools/building/building-eclipse.jd @@ -28,18 +28,18 @@ parent.link=index.html following topics show you how to run an application, which will automatically build your application as well.</p> - <p>To distribute your application, however, you must build your application in release mode and sign the - <code>.apk</code> file with your own private key.</p> - - <p>This document shows you how to run your application on an emulator or a real device - from Eclipse—all of which is done using the debug version of your application. + <p>To distribute your application, however, you must build your application in release mode and + sign the <code>.apk</code> file with your own private key.</p> + + <p>This document shows you how to run your application on an emulator or a real device + from Eclipse—all of which is done using the debug version of your application. For more information about how to sign your application with a private key for release, see <a href= - "{@docRoot}tools/publishing/app-signing.html#ExportWizard">Signing Your Applications</a></p> + "{@docRoot}tools/workflow/publishing/app-signing.html#ExportWizard">Signing Your Applications</a></p> <h2 id="RunningOnEmulatorEclipse">Running on the emulator</h2> <p>Before you can run your application on the Android Emulator, you must <a href= - "{@docRoot}tools/devices/managing-avds.html">create an AVD</a>.</p> + "{@docRoot}tools/workflow/devices/managing-avds.html">create an AVD</a>.</p> <p>To run (or debug) your application, select <strong>Run</strong> > <strong>Run</strong> (or <strong>Run</strong> > <strong>Debug</strong>) from the Eclipse menu bar. The ADT plugin will @@ -100,7 +100,7 @@ parent.link=index.html <li>Ensure that your development computer can detect your device when connected via USB</li> </ul> - <p>Read <a href="{@docRoot}tools/device.html">Using Hardware Devices</a> + <p>Read <a href="{@docRoot}tools/workflow/devices/device.html">Using Hardware Devices</a> for more information.</p> <p>Once set up and your device is connected via USB, install your application on the device by @@ -159,9 +159,10 @@ parent.link=index.html of the build target, a "device chooser" is shown to let you select which device to use.</li> <li>If there are no devices or emulators running that meet the requirements of the build - target, ADT looks at the available AVDs. If there is an AVD that matches the build target of the project, - ADT chooses that AVD. If the AVD versions are newer than the build target of the project, ADT chooses - the oldest possible version of an AVD that meets the project's build target requirement.</li> + target, ADT looks at the available AVDs. If there is an AVD that matches the build target of the + project, ADT chooses that AVD. If the AVD versions are newer than the build target of the project, + ADT chooses the oldest possible version of an AVD that meets the project's build target + requirement.</li> <li>If there are no suitable AVDs, the application is not installed a console error warning tells you that there is no existing AVD that meets the build target requirements.</li> @@ -172,4 +173,4 @@ parent.link=index.html launched.</p> <p>If your run configuration uses <strong>manual</strong> mode, then the "device chooser" is - presented every time that your application is run, so that you can select which AVD to use.</p>
\ No newline at end of file + presented every time that your application is run, so that you can select which AVD to use.</p> diff --git a/docs/html/tools/debugging/debugging-projects-cmdline.jd b/docs/html/tools/debugging/debugging-projects-cmdline.jd index 0b79575..032d6ce 100644 --- a/docs/html/tools/debugging/debugging-projects-cmdline.jd +++ b/docs/html/tools/debugging/debugging-projects-cmdline.jd @@ -18,7 +18,7 @@ parent.link=index.html </div> </div> - <p>If you are not using Eclipse to develop, you can still take advantage of all the tools that + <p>If you are not using Android Studio to develop, you can still take advantage of all the tools that the Android SDK provides for debugging. A basic debugging environment consists of:</p> <ul> @@ -36,7 +36,7 @@ parent.link=index.html <h2 id="start-debugging">Starting a debugging environment</h2> <p>A Java Debugger assists you in finding problems with your code by letting you set breakpoints, step through execution of your application, and examine - variable values. Since you are not using Eclipse, you have to manually start up the debugging + variable values. Since you are not using Android Studio, you have to manually start up the debugging environment yourself by running a few tools that are provided in the Android SDK. To begin debugging your application, follow these general steps:</p> @@ -46,8 +46,8 @@ parent.link=index.html <li>Start DDMS from the sdk <code>/tools</code> directory. This also starts ADB if it is not already started. You should see your device appear in DDMS.</li> - <li>Install and run your <code>.apk</code> file on the device or emulator. In DDMS, you should see your - application running under the device that you installed it to.</li> + <li>Install and run your <code>.apk</code> file on the device or emulator. In DDMS, you should + see your application running under the device that you installed it to.</li> <li>Attach your debugger to the debugging port 8700, or to the specific port shown for the application in DDMS.</li> @@ -62,7 +62,7 @@ parent.link=index.html <p>Your IDE should attach to your application running on the emulator, showing you its threads and allowing you to suspend them, inspect their state, and set breakpoints. If you selected "Wait - for debugger" in the Development settings panel the application will run when Eclipse connects, + for debugger" in the Development settings panel the application will run when Android Studio connects, so you will need to set any breakpoints you want before connecting.</p> <p>Changing either the application being debugged or the "Wait for debugger" option causes the diff --git a/docs/html/tools/debugging/debugging-studio.jd b/docs/html/tools/debugging/debugging-studio.jd new file mode 100644 index 0000000..b060457 --- /dev/null +++ b/docs/html/tools/debugging/debugging-studio.jd @@ -0,0 +1,406 @@ +page.title=Debugging with Android Studio + +@jd:body + +<div id="qv-wrapper"> +<div id="qv"> +<h2>In this document</h2> +<ol> + <li><a href="#runDebug">Run your App in Debug Mode</a> + <ol> + <li><a href="#attachDebug">Attach the debugger to a running process</a></li> + </ol> + <li><a href="#systemLog">Use the System Log</a> + <ol> + <li><a href="#systemLogWrite">Write log messages in your code</a></li> + <li><a href="#systemLogView">View the system log</a></li> + </ol> + </li> + <li><a href="#breakPoints">Work with Breakpoints</a> + <ol> + <li><a href="#breakPointsView">View and configure breakpoints</a></li> + <li><a href="#breakPointsDebug">Debug your app with breakpoints</a></li> + </ol> + </li> + <li><a href="#allocTracker">Track Object Allocation</a></li> + <li><a href="#deviceMonitor">Analyze Runtime Metrics to Optimize your App</a></li> + <li><a href="#screenCap">Capture Screenshots and Videos</a></li> +</ol> +<h2>See also</h2> +<ul> +<li><a href="{@docRoot}tools/basics/index.html"> +Android Studio Tips and Tricks</a></li> +<li><a href="{@docRoot}tools/debugging/index.html">Debugging</a></li> +<li><a href="{@docRoot}tools/help/monitor.html">Device Monitor</a></li> +<li><a href="{@docRoot}tools/debugging/ddms.html">Using DDMS</a></li> +</div> +</div> + +<p>Android Studio enables you to debug apps running on the emulator or on an Android device. +With Android Studio, you can:</p> + +<ul> + <li>Select a device to debug your app on.</li> + <li>View the system log.</li> + <li>Set breakpoints in your code.</li> + <li>Examine variables and evaluate expressions at run time.</li> + <li>Run the debugging tools from the Android SDK.</li> + <li>Capture screenshots and videos of your app.</li> +</ul> + +<p>To debug your app, Android Studio builds a debuggable version of your app, connects +to a device or to the emulator, installs the app and runs it. The IDE shows the system log +while your app is running and provides debugging tools to filter log messages, work with +breakpoints, and control the execution flow.</p> + + +<h2 id="runDebug">Run your App in Debug Mode</h2> + +<div class="figure" style="width:419px"> + <img src="{@docRoot}images/tools/as-debugdevices.png" alt=""/> + <p class="img-caption"><strong>Figure 1.</strong> The Choose Device window enables you to + select a physical Android device or a virtual device to debug your app.</p> +</div> + +<p>To run your app in debug mode, you build an APK signed with a debug key and install it on a +physical Android device or on the Android emulator. +To set up an Android device for development, see <a href="{@docRoot}tools/device.html">Using +Hardware Devices</a>. For more information about the emulator provided by the Android SDK, see +<a href="{@docRoot}tools/devices/emulator.html">Using the Emulator.</a></p> + +<p>To debug your app in Android Studio:</p> + +<ol> + <li>Open your project in Android Studio.</li> + <li>Click <strong>Debug</strong> <img src="{@docRoot}images/tools/as-debugbutton.png" + style="vertical-align:bottom;margin:0;height:22px" alt=""/> in the toolbar.</li> + <li>On the <em>Choose Device</em> window, select a hardware device from the list or + choose a virtual device.</li> + <li>Click <strong>OK</strong>. Your app starts on the selected device.</li> +</ol> + +<p>Figure 1 shows the <em>Choose Device</em> window. The list shows all the Android devices +connected to your computer. Select <strong>Launch Emulator</strong> to use an Android virtual device +instead. Click the ellipsis <img src="{@docRoot}images/tools/as-launchavdm.png" +style="vertical-align:bottom;margin:0;height:19px" alt=""/> to open the +<a href="{@docRoot}tools/devices/managing-avds.html">Android Virtual Device Manager</a>.</p> + +<p>Android Studio opens the <em>Debug</em> tool window when you debug your app. To open the +<em>Debug</em> window manually, click <strong>Debug</strong> +<img src="{@docRoot}images/tools/as-debugwindowbutton.png" +alt="" style="vertical-align:bottom;margin:0;height:20px"/>. +This window shows threads and variables in the <em>Debugger</em> tab, the device status in the +<em>Console</em> tab, and the system log in the <em>Logcat</em> tab. The <em>Debug</em> tool +window also provides other debugging tools covered in the following sections.</p> + +<img src="{@docRoot}images/tools/as-debugview.png" alt="" /> +<p class="img-caption"><strong>Figure 2.</strong> The Debug tool window in Android Studio showing +the current thread and the object tree for a variable.</p> + +<h3 id="attachDebug">Attach the debugger to a running process</h3> + +<p>You don't always have to restart your app to debug it. To debug an app that you're already +running:</p> + +<ol> +<li>Click <strong>Attach debugger to Android proccess</strong> +<img src="{@docRoot}images/tools/as-attach.png" alt="" +style="vertical-align:bottom;margin:0;height:20px"/>.</li> +<li>In the <em>Choose Process</em> window, select the device and app you want to attach the +debugger to.</li> +<li>To open the <em>Debug</em> tool window, click <strong>Debug</strong> +<img src="{@docRoot}images/tools/as-debugwindowbutton.png" +alt="" style="vertical-align:bottom;margin:0;height:20px"/>.</li> +</ol> + +<h2 id="systemLog">Use the System Log</h2> + +<p>The system log shows system messages while you debug your app. These messages include +information from apps running on the device. If you want to use the +system log to debug your app, make sure your code writes log messages and prints the stack +trace for exceptions while your app is in the development phase.</p> + +<h3 id="systemLogWrite">Write log messages in your code</h3> + +<p>To write log messages in your code, use the {@link android.util.Log} class. Log messages +help you understand the execution flow by collecting the system debug output while you interact +with your app. Log messages can tell you what part of your application failed. For more +information about logging, see <a href="{@docRoot}tools/debugging/debugging-log.html"> +Reading and Writing Logs</a>.</p> + +<p>The following example shows how you might add log messages to determine if previous state +information is available when your activity starts:</p> + +<pre> +import android.util.Log; +... +public class MyActivity extends Activity { + private static final String TAG = MyActivity.class.getSimpleName(); + ... + @Override + public void onCreate(Bundle savedInstanceState) { + if (savedInstanceState != null) { + Log.d(TAG, "onCreate() Restoring previous state"); + /* restore state */ + } else { + Log.d(TAG, "onCreate() No saved state available"); + /* initialize app */ + } + } +} +</pre> + +<p>During development, your code can also catch exceptions and write the stack trace to the system +log:</p> + +<pre> +void someOtherMethod() { + try { + ... + } catch (SomeException e) { + Log.d(TAG, "someOtherMethod()", e); + } +} +</pre> + +<p class="note"><strong>Note:</strong> Remove debug log messages and stack trace print calls from +your code when you are ready to publish your app. You could do this by setting a <code>DEBUG</code> +flag and placing debug log messages inside conditional statements.</p> + + +<h3 id="systemLogView">View the system log</h3> + +<p>Both the <em>Android DDMS</em> (Dalvik Debug Monitor Server) and the <em>Debug</em> tool windows +show the system log; however, the <em>Android DDMS</em> tool window lets you view only log messages +for a particular process. To view the system log on the <em>Android DDMS</em> tool window:</p> + +<ol> + <li>Start your app as described in <a href="#runDebug">Run your App in Debug Mode</a>.</li> + <li>Click <strong>Android</strong> <img src="{@docRoot}images/tools/as-android.png" alt="" + style="vertical-align:bottom;margin:0;height:20px"/> to open the <em>Android DDMS</em> + tool window.</li> + <li>If the system log is empty in the <em>Logcat view</em>, click <strong>Restart</strong> + <img src="{@docRoot}images/tools/as-restart.png" alt="" + style="vertical-align:bottom;margin:0;height:22px"/>.</li> +</ol> + +<img src="{@docRoot}images/tools/as-ddmslog.png" alt="" /> +<p class="img-caption"><strong>Figure 4.</strong> The system log in the Android DDMS tool +window.</p> + +<p>The <em>Android DDMS</em> tool window gives you access to some DDMS features from Android Studio. +For more information about DDMS, see <a href="{@docRoot}tools/debugging/ddms.html">Using DDMS</a>. +</p> + +<p>The system log shows messages from Android services and other Android apps. To filter the log +messages to view only the ones you are interested in, use the tools in the <em>Android DDMS</em> +window:</p> + +<ul> + <li>To show only log messages for a particular process, select the process in the + <em>Devices</em> view and then click <strong>Only Show Logcat from Selected + Process</strong> <img src="{@docRoot}images/tools/as-currentproc.png" alt="" + style="vertical-align:bottom;margin:0;height:20px"/>. If the <em>Devices</em> view + is not available, click <strong>Restore Devices View</strong> + <img src="{@docRoot}images/tools/as-showdevview.png" alt="" + style="vertical-align:bottom;margin:0;height:20px"/> on the right of the <em>Android + DDMS</em> tool window. This button is only visible when you hide the <em>Devices</em> + window.</li> + <li>To filter log messages by log level, select a level under <em>Log Level</em> on the top + of the <em>Android DDMS</em> window.</li> + <li>To show only log messages that contain a particular string, enter the string in the search + box and press <strong>Enter</strong>.</li> +</ul> + + +<h2 id="breakPoints">Work with Breakpoints</h2> + +<p>Breakpoints enable you to pause the execution of your app at a particular line of code, examine +variables, evaluate expressions, and continue the execution line by line. Use breakpoints to +determine the causes of run-time errors that you can't fix by looking at your code only. To debug +your app using breakpoints:</p> + +<ol> + <li>Open the source file in which you want to set a breakpoint.</li> + <li>Locate the line where you want to set a breakpoint and click on it.</li> + <li>Click on the yellow portion of the side bar to the left of this line, as shown in figure 5.</li> + <li>Start your app as described in <a href="#runDebug">Run your App in Debug Mode</a>.</li> +</ol> + +<p>Android Studio pauses the execution of your app when it reaches the breakpoint. You can then +use the tools in the <em>Debug</em> tool window to identify the cause of the error.</p> + +<img src="{@docRoot}images/tools/as-breakpointline.png" alt="" /> +<p class="img-caption"><strong>Figure 5.</strong> A red dot appears next to the line when you set +a breakpoint.</p> + +<h3 id="breakPointsView">View and configure breakpoints</h3> + +<p>To view all the breakpoints and configure breakpoint settings, click <strong>View +Breakpoints</strong> <img src="{@docRoot}images/tools/as-viewbreakbutton.png" alt="" +style="vertical-align:bottom;margin:0;height:20px"/> on the left side of the <em>Debug</em> tool +window. The <em>Breakpoints</em> window appears, as shown in figure 6.</p> + +<img src="{@docRoot}images/tools/as-breakpointswindow.png" alt="" /> +<p class="img-caption"><strong>Figure 6.</strong> The Breakpoints window lists all the current +breakpoints and includes behavior settings for each.</p> + +<p>The <em>Breakpoints</em> window lets you enable or disable each breakpoint from the +list on the left. If a breakpoint is disabled, Android Studio does not pause your app when +it hits that breakpoint. Select a breakpoint from the list to configure its settings. +You can configure a breakpoint to be disabled at first and have the system enable it after a +different breakpoint is hit. You can also configure whether a breakpoint should be disabled after +it is hit. To set a breakpoint for any exception, select <strong>Exception Breakpoints</strong> +in the list of breakpoints.</p> + +<h3 id="breakPointsDebug">Debug your app with breakpoints</h3> + +<p>After you set breakpoints in your code, click <strong>Rerun</strong> +<img src="{@docRoot}images/tools/as-restart.png" alt="" +style="vertical-align:bottom;margin:0;height:20px"/> to start the app again. When a breakpoint is +hit, Android Studio pauses the app and highlights the breakpoint in the source code. The +<em>Debug</em> tool window lets you examine variables and control the execution step by +step:</p> + +<ul> + <li> + <p>To examine the object tree for a variable, expand it in the <em>Variables</em> view. If + the <em>Variables</em> view is not visible, click <strong>Restore Variables View</strong> + <img src="{@docRoot}images/tools/as-varviewbutton.png" alt="" + style="vertical-align:bottom;margin:0;height:20px"/>.</p> + </li> + <li> + <p>To evaluate an expression at the current execution point, click <strong>Evaluate + Expression</strong> <img src="{@docRoot}images/tools/as-evalexpbutton.png" alt="" + style="vertical-align:bottom;margin:0;height:20px"/>.</p> + </li> + <li> + <p>To advance to the next line in the code (without entering a method), click <strong>Step + Over</strong> <img src="{@docRoot}images/tools/as-stepoverbutton.png" alt="" + style="vertical-align:bottom;margin:0;height:20px"/>.</p> + </li> + <li> + <p>To advance to the first line inside a method call, click <strong>Step + Into</strong> <img src="{@docRoot}images/tools/as-stepintobutton.png" alt="" + style="vertical-align:bottom;margin:0;height:20px"/>.</p> + </li> + <li> + <p>To advance to the next line outside the current method, click <strong>Step + Out</strong> <img src="{@docRoot}images/tools/as-stepoutbutton.png" alt="" + style="vertical-align:bottom;margin:0;height:20px"/>.</p> + </li> + <li> + <p>To continue running the app normally, click <strong>Resume Program</strong> + <img src="{@docRoot}images/tools/as-resumeprogrambutton.png" alt="" + style="vertical-align:bottom;margin:0;height:20px"/>.</p> + </li> +</ul> + +<img src="{@docRoot}images/tools/as-variablesview.png" alt="" /> +<p class="img-caption"><strong>Figure 7.</strong> The Variables view in the Debug tool window.</p> + + +<h2 id="allocTracker">Track Object Allocation</h2> + +<p>Android Studio lets you track objects that are being allocated on the Java heap and see which +classes and threads are allocating these objects. This allows you to see the list of objects +allocated during a period of interest. This information is valuable for assessing memory usage +that can affect application performance.</p> + +<p>To track memory allocation of objects:</p> + +<ol> +<li>Start your app as described in <a href="#runDebug">Run Your App in Debug Mode</a>.</li> +<li>Click <strong>Android</strong> <img src="{@docRoot}images/tools/as-android.png" alt="" +style="vertical-align:bottom;margin:0;height:20px"/> to open the <em>Android DDMS</em> +tool window.</li> +<li>On the <em>Android DDMS</em> tool window, select the <strong>Devices | logcat tab</strong>.</li> +<li>Select your device from the dropdown list.</li> +<li>Select your app by its package name from the list of running apps.</li> +<li>Click <strong>Start Allocation Tracking</strong> +<img src="{@docRoot}images/tools/as-allocstart.png" alt="" +style="vertical-align:bottom;margin:0;height:20px"/></li> +<li>Interact with your app on the device.</li> +<li>Click <strong>Stop Allocation Tracking</strong> +<img src="{@docRoot}images/tools/as-allocstop.png" alt="" +style="vertical-align:bottom;margin:0;height:20px"/></li> +</ol> + +<p>Android Studio shows the objects that the system allocated with the following information:</p> + +<ul> +<li>Allocation order</li> +<li>Allocated class</li> +<li>Allocation size</li> +<li>Thread ID</li> +<li>Allocation method, class, and line number</li> +<li>Stack trace at the point of allocation</li> +</ul> + +<img src="{@docRoot}images/tools/as-alloctrack.png" alt="" width="750" height="252" /> +<p class="img-caption"><strong>Figure 8.</strong> Object allocation tracking in Android Studio.</p> + + +<h2 id="deviceMonitor">Analyze Runtime Metrics to Optimize your App</h2> + +<p>Even if your application does not generate runtime errors, this does not mean it is free of +problems. You should also consider the following issues:</p> + +<ul> + <li>Does your app use memory efficiently?</li> + <li>Does your app generate unnecessary network traffic?</li> + <li>What methods should you focus your attention on to improve the performance of your app?</li> + <li>Does your app behave properly when the user receives a phone call or a message?</li> +</ul> + +<p>The Android Device Monitor is a stand-alone tool with a graphical user interface for serveral +Android application debugging and analysis tools, including the Dalvik Debug Monitor Server (DDMS). +You can use the Android Device Monitor to analyze memory usage, profile methods, +monitor network traffic and simulate incoming calls and messages.</p> + +<p>To open the Android Device Monitor from Android Studio, click +<strong>Monitor</strong> <img src="{@docRoot}images/tools/as-monitorbutton.png" alt="" +style="vertical-align:bottom;margin:0;height:20px"/> on the toolbar. The Android Device Monitor +opens in a new window.</p> + +<p>For more information about the Android Device Monitor and DDMS, see +<a href="{@docRoot}tools/help/monitor.html">Device Monitor</a> and +<a href="{@docRoot}tools/debugging/ddms.html">Using DDMS</a>.</p> + + +<h2 id="screenCap">Capture Screenshots and Videos</h2> + +<p>Android Studio enables you to capture a screenshot or a short video of the device screen +while your app is running. Screenshots and videos are useful as promotional materials for your +app, and you can also attach them to bug reports that you send to your development team.</p> + +<p>To take a screenshot of your app:</p> + +<ol> + <li>Start your app as described in <a href="#runDebug">Run your App in Debug Mode</a>.</li> + <li>Click <strong>Android</strong> <img src="{@docRoot}images/tools/as-android.png" alt="" + style="vertical-align:bottom;margin:0;height:20px"/> to open the <em>Android DDMS</em> + tool window.</li> + <li>Click <strong>Screen Capture</strong> <img src="{@docRoot}images/tools/as-capture.png" + style="vertical-align:bottom;margin:0;height:22px" alt=""/> on the left side of the + <em>Android DDMS</em> tool window.</li> + <li>Optional: To add a device frame around your screenshot, enable the <em>Frame screenshot</em> + option.</li> + <li>Click <strong>Save</strong>.</li> +</ol> + +<p>To take a video recording of your app:</p> + +<ol> + <li>Start your app as described in <a href="#runDebug">Run your App in Debug Mode</a>.</li> + <li>Click <strong>Android</strong> <img src="{@docRoot}images/tools/as-android.png" alt="" + style="vertical-align:bottom;margin:0;height:20px"/> to open the <em>Android DDMS</em> + tool window.</li> + <li>Click <strong>Screen Record</strong> <img src="{@docRoot}images/tools/as-record.png" + style="vertical-align:bottom;margin:0;height:22px" alt=""/> on the left side of the + <em>Android DDMS</em> tool window.</li> + <li>Click <strong>Start Recording</strong>.</li> + <li>Interact with your app.</li> + <li>Click <strong>Stop Recording</strong>.</li> + <li>Enter a file name for the recording and click <strong>OK</strong>.</li> +</ol> diff --git a/docs/html/tools/debugging/index.jd b/docs/html/tools/debugging/index.jd index 45fbc9e..9717916 100644 --- a/docs/html/tools/debugging/index.jd +++ b/docs/html/tools/debugging/index.jd @@ -18,7 +18,7 @@ page.title=Debugging <p>The Android SDK provides most of the tools that you need to debug your applications. You need a JDWP-compliant debugger if you want to be able to do things such as step through code, - view variable values, and pause execution of an application. If you are using Eclipse, a + view variable values, and pause execution of an application. If you are using Android Studio, a JDWP-compliant debugger is already included and there is no setup required. If you are using another IDE, you can use the debugger that comes with it and attach the debugger to a special port so it can communicate with the application VMs on your devices. The main components that @@ -27,7 +27,8 @@ page.title=Debugging <dl> <dt><a href="{@docRoot}tools/help/adb.html"><strong>adb</strong></a></dt> - <dd><code>adb</code> acts as a middleman between a device and your development system. It provides various + <dd><code>adb</code> acts as a middleman between a device and your development system. It + provides various device management capabilities, including moving and syncing files to the emulator, running a UNIX shell on the device or emulator, and providing a general means to communicate with connected emulators and devices.</dd> @@ -42,9 +43,9 @@ page.title=Debugging <dt><strong><a href="{@docRoot}tools/device.html">Device</a> or <a href="{@docRoot}tools/devices/index.html">Android Virtual Device</a></strong></dt> - <dd>Your application must run in a device or in an AVD so that it can be debugged. An <code>adb</code> device - daemon runs on the device or emulator and provides a means for the <code>adb</code> host daemon to - communicate with the device or emulator.</dd> + <dd>Your application must run in a device or in an AVD so that it can be debugged. An + <code>adb</code> device daemon runs on the device or emulator and provides a means for the + <code>adb</code> host daemon to communicate with the device or emulator.</dd> <dt><strong>JDWP debugger</strong></dt> @@ -66,13 +67,13 @@ page.title=Debugging alt="Debugging workflow" /> <p class="img-caption><strong>Figure 1. </strong> Debugging Workflow</p> - <p>On your emulator or device, each application runs in its own instance of a Dalvik VM. The <code>adb</code> - device daemon allows communication with the VMs from an outside party.</p> + <p>On your emulator or device, each application runs in its own instance of a Dalvik VM. The + <code>adb</code> device daemon allows communication with the VMs from an outside party.</p> - <p>On your development machine, the <code>adb</code> host daemon communicates with the <code>adb</code> device daemon and - allows tools such as DDMS to communicate with the device or emulator. The <code>adb</code> host daemon also - allows you to access shell commands on the device as well as providing capabilities such as - application installation and file transferring.</p> + <p>On your development machine, the <code>adb</code> host daemon communicates with the + <code>adb</code> device daemon and allows tools such as DDMS to communicate with the device or emulator. + The <code>adb</code> host daemon also allows you to access shell commands on the device as well as + providing capabilities such as application installation and file transferring.</p> <p>Each application VM on the device or emulator exposes a debugging port that you can attach to via DDMS. DDMS can forward any of these ports to a static debugging port (typically port 8700) by @@ -80,10 +81,10 @@ page.title=Debugging attach to this static debugging port and debug all the applications that are running on the device or emulator without having to attach to multiple ports.</p> - <p>If you are using Eclipse, much of these interconnections are hidden from you. DDMS, <code>adb</code>, and a - JDWP debugger are all setup for you and you can access them through the Debug and DDMS - perspectives in Eclipse. If you are developing in a non-Eclipse environment, you have to invoke - these tools manually.</p> + <p>If you are using Android Studio, much of these interconnections are hidden from you. DDMS, + <code>adb</code>, and a + JDWP debugger are all setup for you and you can access them through the Debug and DDMS view. If + you are developing with another IDE environment, you may have to invoke these tools manually.</p> <h2 id="addltools">Additional Debugging Tools</h2> @@ -135,8 +136,6 @@ Debugging with the Dev Tools App</a>. <a href="{@docRoot}tools/help/adb.html#dumpsys">dumpsys and dumpstate</a> on the adb topic page.</dd> - - <dt><strong>Get wireless connectivity information</strong></dt> <dd>You can get information about wireless connectivity using DDMS. From the <strong>Device</strong> menu, select <strong>Dump diff --git a/docs/html/tools/device.jd b/docs/html/tools/device.jd index 89b3857..5d8d384 100644 --- a/docs/html/tools/device.jd +++ b/docs/html/tools/device.jd @@ -27,7 +27,7 @@ environment and Android-powered device for testing and debugging on the device.< <p>You can use any Android-powered device as an environment for running, debugging, and testing your applications. The tools included in the SDK make it easy to install and run your application on the device each time you compile. You can install your application on the -device directly from Eclipse or from the command line with ADB. If +device directly from Android Studio or from the command line with ADB. If you don't yet have a device, check with the service providers in your area to determine which Android-powered devices are available.</p> @@ -73,13 +73,21 @@ screen to find Developer options at the bottom.</p> would on the emulator. Before you can start, there are just a few things to do:</p> <ol> - <li>Declare your application as "debuggable" in your Android Manifest. - <p>When using Eclipse, you can skip this step, because running your app directly from -the Eclipse IDE automatically enables debugging.</p> + <li>Verify that your application is "debuggable" in your manifest or <em>build.gradle</em> file. + <p>In the build file, make sure the <em>debuggable</em> property in the <em>debug</em> build + type is set to true. The build type property overrides the manifest setting. </p> +<pre> +android { + buildTypes { + debug { + debuggable true + } +</pre> + <p>In the <code>AndroidManifest.xml</code> file, add <code>android:debuggable="true"</code> to the <code><application></code> element.</p> <p class="note"><strong>Note:</strong> If you manually enable debugging in the manifest - file, be sure to disable it before you build for release (your published application + file, be sure to disable it in your release build (your published application should usually <em>not</em> be debuggable).</p></li> <li>Enable <strong>USB debugging</strong> on your device. <ul> @@ -148,7 +156,7 @@ higher.</p> devices</code> from your SDK {@code platform-tools/} directory. If connected, you'll see the device name listed as a "device."</p> -<p>If using Eclipse, run or debug your application as usual. You will be +<p>If using Android Studio, run or debug your application as usual. You will be presented with a <b>Device Chooser</b> dialog that lists the available emulator(s) and connected device(s). Select the device upon which you want to install and run the application.</p> diff --git a/docs/html/tools/eclipse/index.jd b/docs/html/tools/eclipse/index.jd new file mode 100644 index 0000000..cd39b23 --- /dev/null +++ b/docs/html/tools/eclipse/index.jd @@ -0,0 +1,41 @@ +page.title=Eclipse ADT +@jd:body + + +<div id="qv-wrapper"> +<div id="qv"> + <h2>See also</h2> + <ol> + <li><a href="{@docRoot}tools/sdk/index.html">Downloading Android Studio</a></li> + <li><a href="{@docRoot}tools/basics/index.html">Android Studio Basics</a></li> + <li><a href="{@docRoot}tools/eclipse/migrate-adt.html">Migrating to Android Studio</a></li> + </ol> +</div> +</div> + + +<p>The Android Developer Tools (ADT) plugin for Eclipse provides a professional-grade development +environment for building Android apps. It's a full Java IDE with advanced features to help you build, +test, debug, and package your Android apps. </p> + +<p>Android developers are encouraged to <a href="{@docRoot}tools/eclipse/migrate-adt.html">migrate +to Android Studio</a> as the Eclipse ADT is no longer in active development. +</p> + +<p>The Android Studio build system replaces the Apache Ant build software used with Eclipse ADT +with an Android plugin for <em>Gradle</em>. <a href="http://www.gradle.org/">Gradle</a> is an +advanced build toolkit that manages dependencies and allows you to define custom build logic. Android +Studio also adds support for Maven-based build dependencies, build variants, advanced code +completion and refactoring. For more details about Android Studio, see +<a href="{@docRoot}tools/studio/basics.html">Android Studio basics.</a> + +<p>If you still wish to get started with the ADT plugin, +<a href="{@docRoot}tools/eclipse/installing-adt.html">download and install the Eclipse ADT plugin.</a> +</p> + +</div> +</div> + + + + diff --git a/docs/html/tools/extras/oem-usb.jd b/docs/html/tools/extras/oem-usb.jd index e0bbf33..b25b41e 100644 --- a/docs/html/tools/extras/oem-usb.jd +++ b/docs/html/tools/extras/oem-usb.jd @@ -8,7 +8,6 @@ page.title=OEM USB Drivers <li><a href="#InstallingDriver">Installing a USB Driver</a> <ol> <li><a href="#Win7">Windows 7</a></li> - <li><a href="#WinXp">Windows XP</a></li> <li><a href="#WinVista">Windows Vista</a></li> </ol> </li> @@ -58,7 +57,6 @@ development.</p> <ol class="nolist"> <li><a href="#Win7">Windows 7</a></li> - <li><a href="#WinXp">Windows XP</a></li> <li><a href="#WinVista">Windows Vista</a></li> </ol> @@ -116,50 +114,6 @@ Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li> - - -<h3 id="WinXp">Windows XP</h3> - -<p>To install the Android USB driver on Windows XP for the first time:</p> - -<ol> - <li>Connect your Android-powered device to your computer's USB port. Windows - will detect the device and launch the Hardware Update Wizard.</li> - <li>Select <strong>Install from a list or specific location</strong> and click - <strong>Next</strong>.</li> - <li>Select <strong>Search for the best driver in these locations</strong>; un-check -<strong>Search - removable media</strong>; and check <strong>Include -this location in the search</strong>.</li> - <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB -Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li> - <li>Click <strong>Next</strong> to install the driver.</li> -</ol> - -<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows XP with the new -driver:</p> - -<ol> - <li>Connect your Android-powered device to your computer's USB port.</li> - <li>Right-click on <em>My Computer</em> from your desktop or Windows Explorer, - and select <strong>Manage</strong>.</li> - <li>Select <strong>Device Manager</strong> in the left pane.</li> - <li>Locate and expand <em>Android Phone</em> in the right pane.</li> - <li>Right-click <em>Android Composite ADB Interface</em> and select <strong>Update - Driver</strong>. - This will launch the Hardware Update Wizard.</li> - <li>Select <strong>Install from a list or specific location</strong> and click - <strong>Next</strong>.</li> - <li>Select <strong>Search for the best driver in these locations</strong>; un-check <strong>Search - removable media</strong>; and check <strong>Include -this location in the search</strong>.</li> - <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB -Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li> - <li>Click <strong>Next</strong> to upgrade the driver.</li> -</ol> - - - <h3 id="WinVista">Windows Vista</h3> <p>To install the Android USB driver on Windows Vista for the first time:</p> diff --git a/docs/html/tools/help/index.jd b/docs/html/tools/help/index.jd index bed14d1..75324b7 100644 --- a/docs/html/tools/help/index.jd +++ b/docs/html/tools/help/index.jd @@ -8,6 +8,7 @@ and platform tools. SDK tools are platform independent and are required no matte Android platform you are developing on. Platform tools are customized to support the features of the latest Android platform.</p> + <h2 id="tools-sdk">SDK Tools</h2> <p>The SDK tools are installed with the SDK starter package and are periodically updated. The SDK tools are required if you are developing Android applications. The most important SDK tools @@ -15,58 +16,158 @@ include the Android SDK Manager (<code>android sdk</code>), the AVD Manager (<co avd</code>) the emulator (<code>emulator</code>), and the Dalvik Debug Monitor Server (<code>ddms</code>). A short summary of some frequently-used SDK tools is provided below.</p> + + +<h3 id="tools-virtual-device">Virtual Device Tools</h3> +<dl> + + <dt><a href="{@docRoot}tools/help/avd-manager.html">Android Virtual Device Manager</a></dt> + <dd>The AVD Manager provides a graphical user interface in which you can create + and manage Android Virtual Devices (AVDs) that run in the Android Emulator. </dd> + + <dt><a href="{@docRoot}tools/help/emulator.html">Android Emulator (emulator)</a></dt> + <dd>A QEMU-based device-emulation tool that you can use to debug and test + your applications in an actual Android run-time environment.</dd> + + <dt><a href="{@docRoot}tools/help/mksdcard.html">mksdcard</a></dt> + <dd>Helps you create a disk image that you can use with the emulator, to simulate the presence + of an external storage card (such as an SD card).</dd> + +</dl> + + + + +<h3 id="tools-development">Development Tools</h3> <dl> - <dt><a href="android.html">android</a></dt> + <dt><a href="{@docRoot}tools/help/android.html">android</a></dt> <dd>Lets you manage AVDs, projects, and the installed components of the SDK.</dd> + + <dt><a href="{@docRoot}tools/help/hierarchy-viewer.html">Hierarchy Viewer (hierarchyviewer)</a></dt> + <dd>Provides a visual representation of the layout's View hierarchy with performance information + for each node in the layout, and a magnified view of the display to closely examine the + pixels in your layout.</dd> + + <dt><a href="{@docRoot}tools/help/lint.html">lint</a></dt> + <dd>The Android {@code lint} tool is a static code analysis tool that checks your Android + project source files for potential bugs and optimization improvements.</dd> + + <dt><a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a></dt> + <dd>Lets you manage SDK packages, such as installed platforms and system images.</dd> + + <dt><a href="{@docRoot}tools/help/sqlite3.html">sqlite3</a></dt> + <dd>Lets you access the SQLite data files created and used by Android applications.</dd> + +</dl> + + + +<h3 id="tools-debugging">Debugging Tools</h3> +<dl> + + <dt><a href="{@docRoot}tools/help/adb.html">adb</a></dt> + <dd>Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with + an emulator instance or connected Android-powered device. It also provides access to the + device shell for advanced command-line operations.</dd> + + <dt><a href="{@docRoot}tools/help/uiautomator/index.html">uiautomator</a></dt> + <dd>The {@code uiautomator} testing framework lets you test your user interface (UI) efficiently + by creating automated functional UI testcases that can be run against your app on one or + more devices.</dd> + <dt><a href="{@docRoot}tools/debugging/ddms.html">Dalvik Debug Monitor Server (ddms)</a></dt> <dd>Lets you debug Android applications.</dd> - <dt><a href="dmtracedump.html">dmtracedump</a></dt> + + <dt><a href="{@docRoot}tools/help/monitor.html">Device Monitor</a></dt> + <dd>Android Device Monitor is a stand-alone tool that provides a graphical user interface for + several Android application debugging and analysis tools.</dd> + + <dt><a href="{@docRoot}tools/help/dmtracedump.html">dmtracedump</a></dt> <dd>Generates graphical call-stack diagrams from trace log files. The tool uses the Graphviz Dot utility to create the graphical output, so you need to install Graphviz before running <code>dmtracedump</code>. For more information on using <code>dmtracedump</code>, see <a href="{@docRoot}tools/debugging/debugging-tracing.html#dmtracedump">Profiling with Traceview and dmtracedump</a></dd> - <dt><a href="draw9patch.html">Draw 9-patch</a></dt> - <dd>Allows you to easily create a {@link android.graphics.NinePatch} graphic using a -WYSIWYG editor. It also previews stretched versions of the image, and highlights the area in which -content is allowed.</dd> - <dt><a href="emulator.html">Android Emulator (emulator)</a></dt> - <dd>A QEMU-based device-emulation tool that you can use to design, debug, and test -your applications in an actual Android run-time environment.</dd> - <dt><a href="hierarchy-viewer.html">Hierarchy Viewer (hierarchyviewer)</a></dt> - <dd>Lets you debug and optimize an Android application's user interface.</dd> - <dt><a href="hprof-conv.html">hprof-conv</a></dt> + + + <dt><a href="{@docRoot}tools/help/hprof-conv.html">hprof-conv</a></dt> <dd>Converts the HPROF file that is generated by the Android SDK tools to a standard format so you can view the file in a profiling tool of your choice.</dd> - <dt><a href="layoutopt.html">layoutopt</a></dt> - <dd>Lets you quickly analyze your application's layouts in order to optimize them for -efficiency.</dd> - <dt><a href="mksdcard.html">mksdcard</a></dt> - <dd>Helps you create a disk image that you can use with the emulator, to simulate the presence -of an external storage card (such as an SD card).</dd> - <dt><a href="monkey.html">Monkey</a></dt> + + + <dt><a href="{@docRoot}tools/help/monkey.html">Monkey</a></dt> <dd>Runs on your emulator or device and generates pseudo-random streams of user events such as clicks, touches, or gestures, as well as a number of system-level events. You can use the Monkey -to stress-test applications that you are developing, in a random yet repeatable manner.</dd> - <dt><a href="monkeyrunner_concepts.html">monkeyrunner</a></dt> +to stress-test applications that you are developing, in a random yet repeatable manner. + <ul> + <li><a href="{@docRoot}tools/help/MonkeyDevice.html"><span +class="en">MonkeyDevice</span></a></li> + <li><a href="{@docRoot}tools/help/MonkeyImage.html"><span +class="en">MonkeyImage</span></a></li> + <li><a href="{@docRoot}tools/help/MonkeyRunner.html"><span +class="en">MonkeyRunner</span></a></li> + </ul> + </dd> + + <dt><a href="{@docRoot}tools/help/monkeyrunner_concepts.html">monkeyrunner</a></dt> <dd>Provides an API for writing programs that control an Android device or emulator from outside of Android code.</dd> - <dt><a href="proguard.html">ProGuard</a></dt> - <dd>Shrinks, optimizes, and obfuscates your code by removing unused code and renaming -classes, fields, and methods with semantically obscure names.</dd> - <dt><a href="systrace.html">Systrace</a></dt> + + <dt><a href="{@docRoot}tools/help/systrace.html">Systrace</a></dt> <dd>Lets you analyze the execution of your application in the context of system processes, to help diagnose display and performance issues.</dd> - <dt><a href="sqlite3.html">sqlite3</a></dt> - <dd>Lets you access the SQLite data files created and used by Android applications.</dd> - <dt><a href="traceview.html">traceview</a></dt> + + <dt><a href="{@docRoot}tools/help/traceview.html">traceview</a></dt> <dd>Provides a graphical viewer for execution logs saved by your application.</dd> - <dt><a href="zipalign.html">zipalign</a></dt> + + <dt><a href="{@docRoot}tools/help/systrace.html">Systrace</a></dt> + <dd>Lets you analyze the execution of your application in the context of system processes, + to help diagnose display and performance issues.</dd> + +</dl> + + +<h3 id="tools-build">Build Tools</h3> +<dl> + + <dt><a href="{@docRoot}tools/help/jobb.html">JOBB</a></dt> + <dd>Allows you to build encrypted and unencrypted + <a href="{@docRoot}{@docRoot}google/play/expansion-files.html">APK expansion files</a> in Opaque + Binary Blob (OBB) format.</dd> + +<a href="{@docRoot}{@docRoot}google/play/expansion-files.html">APK expansion files</a> + + <dt><a href="{@docRoot}tools/help/proguard.html">ProGuard</a></dt> + <dd>Shrinks, optimizes, and obfuscates your code by removing unused code and renaming +classes, fields, and methods with semantically obscure names.</dd> + + <dt><a href="{@docRoot}tools/help/zipalign.html">zipalign</a></dt> <dd>Optimizes <code>.apk</code> files by ensuring that all uncompressed data starts with a particular alignment relative to the start of the file. This should always be used to align .apk files after they have been signed.</dd> - </dl> + +</dl> + + +<h3 id="tools-image">Image Tools</h3> +<dl> + <dt><a href="{@docRoot}tools/help/draw9patch.html">Draw 9-patch</a></dt> + <dd>Allows you to easily create a {@link android.graphics.NinePatch} graphic using a +WYSIWYG editor. It also previews stretched versions of the image, and highlights the area in which +content is allowed.</dd> + + <dt><a href="{@docRoot}tools/help/etc1tool.html">etc1tool</a></dt> + <dd>A command line utility that lets you encode PNG images to the ETC1 compression standard and + decode ETC1 compressed images back to PNG.</dd> + + <dt><a href="{@docRoot}tools/help/gltracer.html">Tracer for OpenGL ES</a></dt> + <dd>Allows you to capture OpenGL ES commands and frame by frame images to help you understand + how your graphics commands are being executed.</dd> + +</dl> + + <h2 id="tools-platform">Platform Tools</h2> @@ -83,5 +184,14 @@ build tools or Android Development Tools (ADT), so you rarely need to invoke the As a general rule, you should rely on the build tools or the ADT plugin to call them as needed.</p> <p class="note"><strong>Note:</strong> The Android SDK provides additional shell tools that can -be accessed through <code>adb</code>, such as <a href="bmgr.html">bmgr</a> and -<a href="logcat.html">logcat</a>.</p>
\ No newline at end of file +be accessed through <code>adb</code>, such as <a href="{@docRoot}tools/help/bmgr.html">bmgr</a> and +<a href="{@docRoot}tools/help/logcat.html">logcat</a>.</p> +<dl> + <dt><a href="{@docRoot}tools/help/bmgr.html">bmgr</a></dt> + <dd>A shell tool you can use to interact with the Backup Manager on Android devices supporting + API Level 8 or greater.</dd> + + <dt><a href="{@docRoot}tools/help/logcat.html">logcat</a></dt> + <dd>Provides a mechanism for collecting and viewing system debug output.</dd> + +</dl> diff --git a/docs/html/tools/help/layoutopt.jd b/docs/html/tools/help/layoutopt.jd index 1308b1e..1a18326 100644 --- a/docs/html/tools/help/layoutopt.jd +++ b/docs/html/tools/help/layoutopt.jd @@ -3,6 +3,10 @@ parent.title=Tools parent.link=index.html @jd:body + +<p class="note"><strong>Note: </strong>The Android <code>layoutopt</code> tool has been replaced by the {@code lint} tool beginning in ADT and SDK Tools revision 16. The {@code lint} tool reports UI layout performance issues in a similar way as <code>layoutopt</code>, and detects additional problems.</p> +<p>For more information about using {@code lint}, see <a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with lint</a> and the <a href="{@docRoot}tools/help/lint.html">lint reference documentation</a>.</p> + <p><code>layoutopt</code> is a command-line tool that helps you optimize the layouts and layout hierarchies of your applications.<p> diff --git a/docs/html/tools/revisions/studio.jd b/docs/html/tools/revisions/studio.jd new file mode 100644 index 0000000..fe3b99b --- /dev/null +++ b/docs/html/tools/revisions/studio.jd @@ -0,0 +1,224 @@ +page.title=Android Studio Revisions + +@jd:body + + +<div id="qv-wrapper"> +<div id="qv"> + + <h2>See also</h2> + <ol> + <li><a href="{@docRoot}sdk/installing/index.html">Installing Android Studio</a></li> + </ol> + +</div> +</div> + + +<p>Android Studio is the official IDE for Android development, and with a single download includes +everything you need to begin developing Android apps:</p> + +<ul> +<li>IntelliJ IDE + Android Studio plugin</li> +<li>Android SDK Tools</li> +<li>Android Platform-tools</li> +<li>A version of the Android platform</li> +<li>A version of the Android system image for the emulator</li> +</ul> + +<p>For an introduction to Android Studio, make sure to read +<a href="{@docRoot}tools/studio/basics.html">Android Studio Basics</a>.</p> + +<p>Periodic updates are pushed to Android Studio without requiring you to update from here. To +manually check for updates, select <strong>Help > Check for updates</strong> (on Mac, select +<strong>Android Studio > Check for updates</strong>).</p> + + +<h2 id="Revisions">Revisions</h2> + +<p>The sections below provide notes about successive releases of +Android Studio, as denoted by revision number. </p> + + +<div class="toggle-content opened"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" + alt=""/>Android Studio v0.8.14</a> <em>(October 2014)</em> + </p> + + <div class="toggle-content-toggleme"> + <p>See + <a href="http://tools.android.com/recent/androidstudio0814inbetachannel">tools.android.com</a> + for a full list of changes.</p> + </div> +</div> + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" + alt=""/>Android Studio v0.8.6</a> <em>(August 2014)</em> + </p> + + <div class="toggle-content-toggleme"> + <p>See <a href="http://tools.android.com/recent">tools.android.com</a> for a full list of changes.</p> + </div> +</div> + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" + alt=""/>Android Studio v0.8.0</a> <em>(June 2014)</em> + </p> + + <div class="toggle-content-toggleme"> + <p>Added support for Android Wear projects.</p> + <p>See <a href="http://tools.android.com/recent">tools.android.com</a> for a full list of changes.</p> + </div> +</div> + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" + alt=""/>Android Studio v0.5.2</a> <em>(May 2014)</em> + </p> + + <div class="toggle-content-toggleme"> + <ul> + <li>See <a href="http://tools.android.com/recent">tools.android.com</a> for a full list of changes.</li> + </ul> + </div> +</div> + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" + alt=""/>Android Studio v0.4.6</a> <em>(March 2014)</em> + </p> + + <div class="toggle-content-toggleme"> + <ul> + <li>See <a href="http://tools.android.com/recent">tools.android.com</a> for a full list of changes.</li> + </ul> + </div> +</div> + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" + alt=""/>Android Studio v0.4.2</a> <em>(Jan 2014)</em> + </p> + + <div class="toggle-content-toggleme"> + <ul> + <li>See <a href="http://tools.android.com/recent">tools.android.com</a> for a full list of changes.</li> + </ul> + </div> +</div> + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" + alt=""/>Android Studio v0.3.2</a> <em>(Oct 2013)</em> + </p> + + <div class="toggle-content-toggleme"> + <ul> + <li>See <a href="http://tools.android.com/recent">tools.android.com</a> for a full list of changes.</li> + </ul> + </div> +</div> + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" + alt=""/>Android Studio v0.2.x</a> <em>(July 2013)</em> + </p> + + <div class="toggle-content-toggleme"> + <ul> + <li>Merged in the latest IntelliJ codebase changes. Includes fixes for issues reported by Studio users such as tweaks to Linux font sizes and font rendering.</li> + <li>Android Gradle plug-in updated to 0.5.0. + <p class="caution"><strong>Caution:</strong> This new version is not backwards compatible. + When opening a project that uses an older version of the plug-in, Studio will show an error + stating <strong>Gradle <project_name> project refresh failed.</strong></p> + <p>The updated Gradle plug-in includes the following changes:</p> + <ul> + <li>Fixed IDE model to contain the output file even if it's customized through the DSL. Also + fixed the DSL to get/set the output file on the variant object so that it's not necessary to + use <code>variant.packageApplication or variant.zipAlign</code></li> + <li>Fixed dependency resolution so that we resolved the combination of (default config, + build types, flavor(s)) together instead of separately.</li> + <li>Fixed dependency for tests of library project to properly include all the dependencies + of the library itself.</li> + <li>Fixed case where two dependencies have the same leaf name.</li> + <li>Fixed issue where Proguard rules file cannot be applied on flavors.</li> + </ul> + <p>All Gradle plugin release notes are available are here: <a href= + "http://tools.android.com/tech-docs/new-build-system" + >http://tools.android.com/tech-docs/new-build-system</a>.</p> + </li> + <li>Gradle errors from aapt no longer point to merged output files in the build/ folder, they + point back to the real source locations.</li> + <li>Parallel Builds. It's now possible to use Gradle's parallel builds. Please be aware that + parallel builds are in "incubation" (see <a + href="http://www.gradle.org/docs/current/userguide/gradle_command_line.html">Gradle's + documentation</a>.) This feature is off by default. To enable it, go to + <strong>Preferences</strong> > <strong>Compiler</strong> and check the box <em>Compile + independent modules in parallel</em>.</li> + <li>Further work on the new resource repository used for layout rendering, resource + folding in the editor, and more: + <ul> + <li>Basic support for .aar library dependencies (e.g. using a library without a local copy of + the sources). Still not working for resource XML validation and navigation in source editors. + </li> + <li>Cycle detection in resource references.</li> + <li>Quick Documentation (F1), which can show all translations of the string under the caret, + will now also show all resource overlays from the various Gradle flavors and build types, as + well as libraries. They are listed in reverse resource overlay order, with strikethrough on + the versions of the string that are masked.</li> + <li>Fixes to handle updating the merged resources when the set of module dependencies + change.</li> + <li>XML rendering fixes to properly handle character entity declarations and XML and unicode + escapes.</li> + </ul> + <li>Save screenshot support for the layout preview and layout editor windows.</li> + <li>Template bug fixes.</li> + <li>Lint bug fixes.</li> + <li>Various fixes for crash reports. Thank you, and keep filing crash reports!</li> + </ul> + </div> +</div> + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" + alt=""/>Android Studio v0.1.x</a> <em>(May 2013)</em> + </p> + + <div class="toggle-content-toggleme"> + <ul> + <li>Various bug fixes, including a fix for a common Windows installation issue. + </ul> + </div> +</div> + +<p> </p> + + +<h2 id="Troubleshooting">Troubleshooting</h2> + +<p>If you encounter problems in Android Studio, look at the following page +for possible resolutions to known issues: <a href="http://tools.android.com/knownissues" +>http://tools.android.com/knownissues</a>.</p> + + + +</div><!-- end main content --> + + + + +</div><!-- end relative position wrapper --> + + + diff --git a/docs/html/tools/support-library/features.jd b/docs/html/tools/support-library/features.jd index 3ebfc89..079dd71 100644 --- a/docs/html/tools/support-library/features.jd +++ b/docs/html/tools/support-library/features.jd @@ -137,13 +137,16 @@ page.title=Support Library Features <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without resources</a>.</p> +<p class="caution"><strong>Caution:</strong> Using dynamic dependencies, especially for higher version +numbers, can cause unexpected version updates and regression incompatibilities.</p> + <p>The Gradle build script dependency identifier for this library is as follows:</p> <pre> com.android.support:support-v4:21.0.+ </pre> -<p>This dependency notation specifies the release version 21.0.0 or higher.</p> +<p>This dependency notation specifies the latest release version with the 21.0 prefix.</p> <h2 id="multidex">Multidex Support Library</h2> @@ -171,7 +174,7 @@ com.android.support:support-v4:21.0.+ com.android.support:multidex:1.0.+ </pre> -<p>This dependency notation specifies the release version 1.0.0 or higher.</p> +<p>This dependency notation specifies the latest release version with the 1.0 prefix.</p> <h2 id="v7">v7 Support Libraries</h2> @@ -226,7 +229,8 @@ com.android.support:multidex:1.0.+ com.android.support:appcompat-v7:21.0.+ </pre> -<p>This dependency notation specifies the release version 21.0.0 or higher.</p> +<p>This dependency notation specifies the latest release version with the 21.0 prefix.</p> + <h3 id="v7-cardview">v7 cardview library</h3> @@ -248,7 +252,8 @@ libraries with resources</a>.</p> com.android.support:cardview-v7:21.0.+ </pre> -<p>This dependency notation specifies the release version 21.0.0 or higher.</p> +<p>This dependency notation specifies the latest release version with the 21.0 prefix.</p> + <h3 id="v7-gridlayout">v7 gridlayout library</h3> @@ -269,7 +274,7 @@ com.android.support:cardview-v7:21.0.+ com.android.support:gridlayout-v7:21.0.+ </pre> -<p>This dependency notation specifies the release version 21.0.0 or higher.</p> +<p>This dependency notation specifies the latest release version with the 21.0 prefix.</p> <h3 id="v7-mediarouter">v7 mediarouter library</h3> @@ -333,7 +338,9 @@ title card.</p> com.android.support:palette-v7:21.0.+ </pre> -<p>This dependency notation specifies the release version 21.0.0 or higher.</p> +<p>This dependency notation specifies the latest release version with the 21.0 prefix.</p> + + <h3 id="v7-recyclerview">v7 recyclerview library</h3> @@ -356,7 +363,9 @@ libraries with resources</a>.</p> com.android.support:recyclerview-v7:21.0.+ </pre> -<p>This dependency notation specifies the release version 21.0.0 or higher.</p> +<p>This dependency notation specifies the latest release version with the 21.0 prefix.</p> + + <h2 id="v8">v8 Support Library</h2> @@ -399,7 +408,9 @@ com.android.support:recyclerview-v7:21.0.+ com.android.support:support-v13:18.0.+ </pre> -<p>This dependency notation specifies the release version 18.0.0 or higher.</p> +<p>This dependency notation specifies the latest release version with the 18.0 prefix.</p> + + <h2 id="v17-leanback">v17 Leanback Library</h2> @@ -440,4 +451,6 @@ with resources</a>. </p> com.android.support:leanback-v17:21.0.+ </pre> -<p>This dependency notation specifies the release version 21.0.0 or higher.</p> +<p>This dependency notation specifies the latest release version with the 21.0 prefix.</p> + + diff --git a/docs/html/tools/support-library/setup.jd b/docs/html/tools/support-library/setup.jd index 2325a13..845cf76 100644 --- a/docs/html/tools/support-library/setup.jd +++ b/docs/html/tools/support-library/setup.jd @@ -293,8 +293,30 @@ dependencies { android:targetSdkVersion="17" /> </pre> -<p>This change tells Google Play that your application can be installed on devices with Android - 2.1 (API level 7) and higher.</p> +<p>The manifest setting tells Google Play that your application can be installed on devices with Android + 2.1 (API level 7) and higher. </p> + +<p>If you are using Gradle build files, the <code>minSdkVersion</code> setting in the build file + overrides the manifest settings. </p> + +<pre> +apply plugin: 'android' + +android { + ... + + defaultConfig { + minSdkVersion 8 + ... + } + ... +} +</pre> + +<p>In this case, the build file setting tells Google Play that the default build variant of your + application can be installed on devices with Android 2.2 (API level 8) and higher. For more + information about build variants, see + <a href="{@docRoot}sdk/installing/studio-build.html">Build System Overview</a>. </p> <p class="note"> <strong>Note:</strong> If you are including the v4 support and v7 appcompat libraries in your diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs index 7f93eed..022afae 100644 --- a/docs/html/tools/tools_toc.cs +++ b/docs/html/tools/tools_toc.cs @@ -1,10 +1,12 @@ <ul id="nav"> + +<!-- Downloads menu--> + <li class="nav-section"> - <div class="nav-section-header"><a href="<?cs var:toroot -?>sdk/index.html"><span class="en">Download</span></a></div> + <div class="nav-section-header"><a href="<?cs var:toroot?>sdk/index.html"><span class="en">Download</span></a></div> <ul> - <li><a href="<?cs var:toroot ?>sdk/installing/index.html"> + <li><a href="<?cs var:toroot ?>sdk/installing/index.html"> <span class="en">Installing the SDK</span></a></li> <li><a href="<?cs var:toroot ?>sdk/installing/adding-packages.html"> @@ -13,27 +15,19 @@ </li> - <li class="nav-section"> - <div class="nav-section-header"> - <a href="<?cs var:toroot ?>sdk/installing/studio.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> +<!-- Android Studio menu--> + + <li class="nav-section"> + <div class="nav-section-header"><a href="<?cs var:toroot?>tools/basics/index.html"><span class="en">Android Studio</span></a></div> + <ul> + <li><a href="<?cs var:toroot ?>tools/basics/studio-tips.html">Tips and Tricks</a> </li> + </ul> + + </li><!-- End of Android Studio Basics --> + + + +<!-- Workflow menu--> <li class="nav-section"> <div class="nav-section-header"> @@ -58,7 +52,7 @@ <li class="nav-section"> <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/projects/index.html"><span class="en">Setting Up Projects</span></a></div> <ul> - <li><a href="<?cs var:toroot ?>tools/projects/projects-eclipse.html"><span class="en">From Eclipse with ADT</span></a></li> + <li><a href="<?cs var:toroot ?>tools/projects/projects-studio.html"><span class="en">From Android Studio</span></a></li> <li><a href="<?cs var:toroot ?>tools/projects/projects-cmdline.html"><span class="en">From the Command Line</span></a></li> <li><a href="<?cs var:toroot ?>tools/projects/templates.html"><span class="en">Using Code Templates</span></a></li> </ul> @@ -78,7 +72,6 @@ <li><a href="<?cs var:toroot ?>tools/building/multidex.html"> <span class="en">Apps Over 65K Methods</span></a></li> </ul> - </li> <li class="nav-section"> @@ -90,8 +83,8 @@ <a href="<?cs var:toroot?>tools/testing/testing_android.html"> <span class="en">Fundamentals</span></a> </li> - <li><a href="<?cs var:toroot ?>tools/testing/testing_eclipse.html"> - <span class="en">From Eclipse</span></a> + <li><a href="<?cs var:toroot ?>tools/testing/testing_studio.html"> + <span class="en">From Android Studio</span></a> </li> <li><a href="<?cs var:toroot ?>tools/testing/testing_otheride.html"> <span class="en">From Other IDEs</span></a> @@ -130,7 +123,7 @@ <li class="nav-section"> <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/debugging/index.html"><span class="en">Debugging</span></a></div> <ul> - <li><a href="<?cs var:toroot ?>tools/debugging/debugging-projects.html"><span class="en">From Eclipse with ADT</span></a></li> + <li><a href="<?cs var:toroot ?>tools/debugging/debugging-studio.html"><span class="en">From Android Studio</span></a></li> <li><a href="<?cs var:toroot ?>tools/debugging/debugging-projects-cmdline.html"><span class="en">From Other IDEs</span></a></li> <li><a href="<?cs var:toroot ?>tools/debugging/ddms.html"><span class="en">Using DDMS</span></a></li> <li><a href="<?cs var:toroot ?>tools/debugging/debugging-log.html"><span class="en">Reading and Writing Logs</span></a></li> @@ -151,29 +144,17 @@ </ul> </li> </ul> - </li> + </li><!-- end of debugging --> + - <li class="nav-section"> - <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/support-library/index.html"><span -class="en">Support Library</span></a></div> - <ul> - <li><a href="<?cs var:toroot ?>tools/support-library/features.html">Features</a></li> - <li><a href="<?cs var:toroot ?>tools/support-library/setup.html">Setup</a></li> - </ul> - </li> + +<!-- Tool Help menu--> <li class="nav-section"> - <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/help/index.html"><span -class="en">Tools Help</span></a></div> + <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/help/index.html"><span class="en">Tools Help</span></a></div> <ul> <li><a href="<?cs var:toroot ?>tools/help/adb.html">adb</a></li> - <li class="nav-section"> - <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/help/adt.html">ADT</a></div> - <ul> - <li><a href="<?cs var:toroot ?>sdk/installing/installing-adt.html"> - <span class="en">Installing the Eclipse Plugin</span></a></li> - </ul> - </li> + <li><a href="<?cs var:toroot ?>tools/help/adt.html">ADT</a></li> <li><a href="<?cs var:toroot ?>tools/help/android.html">android</a></li> <li><a href="<?cs var:toroot ?>tools/help/avd-manager.html">AVD Manager</a></li> <li><a href="<?cs var:toroot ?>tools/help/bmgr.html">bmgr</a> @@ -190,15 +171,12 @@ class="en">Tools Help</span></a></div> <li><a href="<?cs var:toroot ?>tools/help/mksdcard.html">mksdcard</a></li> <li><a href="<?cs var:toroot ?>tools/help/monkey.html">monkey</a></li> <li class="nav-section"> - <div class="nav-section-header"><a href="<?cs var:toroot -?>tools/help/monkeyrunner_concepts.html"><span class="en">monkeyrunner</span></a></div> + <div class="nav-section-header"><a href="<?cs var:toroot?>tools/help/monkeyrunner_concepts.html"> +<span class="en">monkeyrunner</span></a></div> <ul> - <li><a href="<?cs var:toroot ?>tools/help/MonkeyDevice.html"><span -class="en">MonkeyDevice</span></a></li> - <li><a href="<?cs var:toroot ?>tools/help/MonkeyImage.html"><span -class="en">MonkeyImage</span></a></li> - <li><a href="<?cs var:toroot ?>tools/help/MonkeyRunner.html"><span -class="en">MonkeyRunner</span></a></li> + <li><a href="<?cs var:toroot ?>tools/help/MonkeyDevice.html"><span class="en">MonkeyDevice</span></a></li> + <li><a href="<?cs var:toroot ?>tools/help/MonkeyImage.html"><span class="en">MonkeyImage</span></a></li> + <li><a href="<?cs var:toroot ?>tools/help/MonkeyRunner.html"><span class="en">MonkeyRunner</span></a></li> </ul> </li> <li><a href="<?cs var:toroot ?>tools/help/proguard.html" zh-cn-lang="ProGuard">ProGuard</a></li> @@ -207,7 +185,8 @@ class="en">MonkeyRunner</span></a></li> <li><a href="<?cs var:toroot ?>tools/help/gltracer.html">Tracer for OpenGL ES</a></li> <li><a href="<?cs var:toroot ?>tools/help/traceview.html">Traceview</a></li> <li class="nav-section"> - <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/help/uiautomator/index.html"><span class="en">uiautomator</span></a></div> + <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/help/uiautomator/index.html"> +<span class="en">uiautomator</span></a></div> <ul> <li><a href="<?cs var:toroot ?>tools/help/uiautomator/Configurator.html"><span class="en">Configurator</span></a></li> <li><a href="<?cs var:toroot ?>tools/help/uiautomator/IAutomationSupport.html"><span class="en">IAutomationSupport</span></a></li> @@ -224,30 +203,73 @@ class="en">MonkeyRunner</span></a></li> <li><a href="<?cs var:toroot ?>tools/help/zipalign.html">zipalign</a></li> </ul> </li> + </li><!-- end of tools help --> + + +<!-- Build System menu--> + + <li class="nav-section"> + <div class="nav-section-header"> + <a href="<?cs var:toroot ?>tools/gradle/index.html">Build System</a> + </div> + <ul> + <li><a href="<?cs var:toroot ?>tools/gradle/studio-build.html"> + Building Your Project with Gradle</a></li> + <li><a href="<?cs var:toroot ?>tools/gradle/gradle-ref.html"> + Gradle for Android Reference</a></li> + </ul> + </li><!-- end of build system --> + + +<!-- Support Library menu--> + + <li class="nav-section"> + <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/support-library/index.html"><span +class="en">Support Library</span></a></div> + <ul> + <li><a href="<?cs var:toroot ?>tools/support-library/features.html">Features</a></li> + <li><a href="<?cs var:toroot ?>tools/support-library/setup.html">Setup</a></li> + </ul> + </li><!-- end of support library --> + + + +<!-- Revision menu--> <li class="nav-section"> <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/revisions/index.html"><span class="en">Revisions</span></a></div> <ul> - <li><a href="<?cs var:toroot ?>tools/sdk/tools-notes.html"> + <li><a href="<?cs var:toroot ?>tools/revisions/studio.html"> + <span class="en">Android Studio</span> + </a></li> + <li><a href="<?cs var:toroot ?>tools/revisions/sdk/tools-notes.html"> <span class="en">SDK Tools</span> </a></li> - <li><a href="<?cs var:toroot ?>tools/sdk/eclipse-adt.html"> - <span class="en">ADT Plugin</span> </a></li> <li><a href="<?cs var:toroot ?>tools/revisions/build-tools.html"> <span class="en">Build Tools</span> </a></li> <li><a href="<?cs var:toroot ?>tools/revisions/platforms.html"><span class="en">Platforms</span></a></li> + <li><a href="<?cs var:toroot ?>tools/sdk/eclipse-adt.html"> + <span class="en">ADT Plugin</span></a></li> </ul> - </li> + </li><!-- end of revision --> + + + +<!-- NDK menu--> <li class="nav-section"> <div class="nav-section-header empty"> - <a href="<?cs var:toroot ?>tools/sdk/ndk/index.html">NDK</a> + <a href="<?cs var:toroot ?>tools/ndk/index.html">NDK</a> </div> - </li> + </li><!-- end of NDK --> + + + +<!-- ADK menu--> <li class="nav-section"> <div class="nav-section-header"> @@ -258,7 +280,27 @@ class="en">Platforms</span></a></li> <li><a href="<?cs var:toroot ?>tools/adk/adk2.html">ADK 2012 Guide</a></li> <li><a href="<?cs var:toroot ?>tools/adk/adk.html">ADK 2011 Guide</a></li> </ul> - </li> + </li><!-- end of ADK --> + + + +<!-- Eclipse ADT menu--> + + <li class="nav-section"> + <div class="nav-section-header"> + <a href="<?cs var:toroot ?>tools/eclipse/index.html"> + <span class="en">Eclipse with ADT</span></a> + </div> + <ul> + <li><a href="<?cs var:toroot ?>sdk/installing/migrate.html">Migrating to Android Studio</a></li> + <li><a href="<?cs var:toroot ?>sdk/installing/installing-adt.html">Installing</a></li> + <li><a href="<?cs var:toroot ?>tools/projects/projects-eclipse.html">Setting Up Projects</a></li> + <li><a href="<?cs var:toroot ?>tools/building/building-eclipse.html">Building</a></li> + <li><a href="<?cs var:toroot ?>tools/debugging/debugging-projects.html">Debugging</a></li> + <li><a href="<?cs var:toroot ?>tools/testing/testing_eclipse.html">Testing</a></li> + </ul> + </li><!-- end of Eclipse --> + </ul><!-- nav --> diff --git a/docs/html/tools/workflow/index.jd b/docs/html/tools/workflow/index.jd index 784b212..f76df75 100644 --- a/docs/html/tools/workflow/index.jd +++ b/docs/html/tools/workflow/index.jd @@ -2,14 +2,14 @@ page.title=Introduction @jd:body <p>To develop apps for Android devices, you use a set of tools that are included in the Android SDK. -Once you've downloaded and installed the SDK, you can access these tools right from your Eclipse IDE, -through the ADT plugin, or from the command line. Developing with Eclipse is the preferred method because -it can directly invoke the tools that you need while developing applications.</p> +Once you've downloaded Android Studio and the Android SDK tools you can access these tools directly. +You can also access most of the SDK tools from the command line. Developing with Android Studio is the +preferred method because it can directly invoke the tools that you need while developing applications.</p> - <p>However, you may choose to develop with another IDE or a simple text editor and invoke the - tools on the command line or with scripts. This is a less streamlined way to develop because you - will sometimes have to call command line tools manually, but you will have access to the same - number of features that you would have in Eclipse.</p> +<p>However, you may choose to develop with another IDE or a simple text editor and invoke the +tools on the command line or with scripts. This is a less streamlined way to develop because you +will sometimes have to call command line tools manually, but you will have access to the same +number of features that you would have in Android Studio.</p> <div class="figure" style="width:461px"> <img src="{@docRoot}images/developing/developing_overview.png" @@ -20,57 +20,65 @@ it can directly invoke the tools that you need while developing applications.</p </p> </div> -<p>The basic steps for developing applications (with or without Eclipse) are shown in figure 1. The -development steps encompass four development phases, which include:</p> +<h2>App Workflow</h2> + +<p>The basic steps for developing applications (with or without Android Studio) are shown in +figure 1. The development steps encompass four development phases, which include:</p> <ul> - <li><strong>Setup</strong> + <li><strong>Environment Setup</strong> <p>During this phase you install and set up your development environment. You also create Android Virtual Devices (AVDs) and connect hardware devices on which you can install your applications.</p> - <p>See <a href="{@docRoot}tools/devices/index.html">Managing Virtual Devices</a> - and <a href="{@docRoot}tools/device.html">Using Hardware Devices</a> for more + <p>See <a href="{@docRoot}tools/workflow/devices/index.html">Managing Virtual Devices</a> + and <a href="{@docRoot}tools/workflow/device.html">Using Hardware Devices</a> for more information. </li> - <li><strong>Development</strong> - <p>During this phase you set up and develop your Android project, which contains all of the - source code and resource files for your application. For more information, see - <a href="{@docRoot}tools/projects/index.html">Create an Android project</a>.</p> + <li><strong>Project Setup and Development</strong> + <p>During this phase you set up and develop your Android Studio project and application modules, + which contain all of the source code and resource files for your application. For more + information, see + <a href="{@docRoot}tools/workflow/projects/index.html">Create an Android project</a>.</p> </li> - <li><strong>Debugging and Testing</strong> - <p>During this phase you build your project into a debuggable <code>.apk</code> package that you - can install and run on the emulator or an Android-powered device. If you are using Eclipse, - builds are generated each time you project is saved. If you're using another IDE, - you can build your project using Ant and install it on a device using - <a href="{@docRoot}tools/help/adb.html">adb</a>. For more information, see - <a href="{@docRoot}tools/building/index.html">Build and run your application</a>.</p> - <p>Next, you debug your application using a JDWP-compliant debugger along with the debugging - and logging tools that are provided with the Android SDK. Eclipse already comes packaged with - a compatible debugger. For more information see, - <a href="{@docRoot}tools/debugging/index.html">Debug your application with the - SDK debugging and logging tools</a>.</p> + <li><strong>Building, Debugging and Testing</strong> + <p>During this phase you build your project into a debuggable <code>.apk</code> package(s) + that you can install and run on the emulator or an Android-powered device. Android Studio uses + a build system based on <a href="http://www.gradle.org/" target="_android">Gradle</a> + that provides flexibility, customized build variants, dependency resolution, and much more. + If you're using another IDE, you can build your project using Gradle and install it on a device + using <a href="{@docRoot}tools/help/adb.html">adb</a>. For more information, see + <a href="{@docRoot}tools/workflow/building/index.html">Build and run your application</a>.</p> + <p>Next, with Android Studio you debug your application using the + <a href="{@docRoot}tools/help/monitor.html">Android Debug Monitor</a> and device log messages + (<a href="{@docRoot}tools/help/logcat.html">logact</a>) along with the IntelliJ IDEA intelligent + coding features. You can also use a JDWP-compliant debugger along with the debugging and logging + tools that are provided with the Android SDK. For more information see + <a href="{@docRoot}tools/debugging/index.html">Debug your application with the SDK debugging and logging tools</a>.</p> <p>Last, you test your application using various Android SDK testing tools. For more information, see <a href="{@docRoot}tools/testing/index.html">Test your application with the Testing and Instrumentation framework</a>.</p> </li> <li><strong>Publishing</strong> <p>During this phase you configure and build your application for release and distribute your - application to users. For more information, see - <a href="{@docRoot}tools/publishing/publishing_overview.html">Publishing Overview</a>.</p> + application to users. For more information, see + <a href="{@docRoot}tools/publishing/publishing_overview.html">Publishing + Overview</a>.</p> </li> </ul> + + <h2 id="EssentialTools">Essential command line tools</h2> - <p>When developing in IDEs or editors other than Eclipse, be familiar with - all of the tools below, because you will have to run them from the command line.</p> + <p>When developing in IDEs or editors other than Android Studio, be familiar with + all of the tools below, because you will have to run them from the command line or script.</p> <dl> <dt><a href="{@docRoot}tools/help/android.html">android</a></dt> <dd>Create and update Android projects and create, move, and delete AVDs.</dd> - <dt><a href="{@docRoot}tools/devices/emulator.html">Android Emulator</a></dt> + <dt><a href="{@docRoot}tools/help/emulator.html">Android Emulator</a></dt> <dd>Run your Android applications on an emulated Android platform.</dd> @@ -84,9 +92,9 @@ development steps encompass four development phases, which include:</p> source and third-party tools:</p> <dl> - <dt>Ant</dt> + <dt><a href="http://www.gradle.org/">Gradle</a> </dt> - <dd>To compile and build your Android project into an installable .apk file.</dd> + <dd>To compile and build your Android project into an installable .apk file(s).</dd> <dt>Keytool</dt> @@ -99,52 +107,15 @@ development steps encompass four development phases, which include:</p> JDK.</dd> </dl> - <p>If you are using Eclipse and ADT, tools such as <code>adb</code> and <code>android</code> - are automatically called by Eclipse and ADT so you don't have to manually invoke these tools. + <p>If you are using Android Studio, tools such as <code>adb</code> and <code>android</code> + are automatically called by Android Studio so you don't have to manually invoke these tools. You need to be familiar with <code>adb</code>, however, because certain functions are not -accessible from - Eclipse, such as the <code>adb</code> shell commands. You might also need to call Keytool and -Jarsigner to - sign your applications, but you can set up Eclipse to do this automatically as well.</p> + accessible from Android Studio, such as the <code>adb</code> shell commands. You might also + need to call Keytool and Jarsigner to sign your applications, but you can set up Android Studio + to do this automatically as well.</p> <p>For more information on the tools provided with the Android SDK, see the - <a href="{@docRoot}tools/index.html">Tools</a> section of the documentation.</p> - -<h2 id="ThirdParty">Other Third-Party Development Tools</h2> -<p> - The tools described in this section are not developed by the Android SDK team. The Android Dev Guide - does not provide documentation for these tools. Please refer to the linked documents in each - section for documentation. -</p> -<h3 id="IntelliJ">Developing in IntelliJ IDEA</h3> -<div style="float: right"> -<img alt="The IntelliJ graphical user interface" height="500px" -src="{@docRoot}images/developing/intellijidea_android_ide.png"/> -</div> -<p> - IntelliJ IDEA is a powerful Java IDE from JetBrains that provides - full-cycle Android development support in both the free Community - Edition and the Ultimate edition. -</p> -<p> - The IDE ensures compatibility with the latest Android SDK and offers a - smart code editor with completion, quick navigation between code and - resources, a graphical debugger, unit testing support using Android - Testing Framework, and the ability to run applications in either the - emulator or a USB-connected device. -</p> -<p> - <strong>Links:</strong> -</p> -<ul> - <li> - <a href="http://www.jetbrains.com/idea">IntelliJ IDEA official website</a> -</li> - <li> - <a href="http://www.jetbrains.com/idea/features/google_android.html">Android support in IntelliJ IDEA</a> -</li> - <li> - <a href="http://wiki.jetbrains.net/intellij/Android">IntelliJ IDEA Android Tutorials</a> - </li> -</ul> + <a href="{@docRoot}tools/help/index.html">Tools</a> section of the documentation.</p> + + |
