diff options
Diffstat (limited to 'docs/html/tools')
-rw-r--r-- | docs/html/tools/building/building-cmdline.jd | 17 | ||||
-rw-r--r-- | docs/html/tools/building/building-studio.jd | 19 | ||||
-rw-r--r-- | docs/html/tools/building/configuring-gradle.jd | 8 | ||||
-rw-r--r-- | docs/html/tools/building/plugin-for-gradle.jd | 13 | ||||
-rw-r--r-- | docs/html/tools/debugging/annotations.jd | 241 | ||||
-rw-r--r-- | docs/html/tools/debugging/improving-w-lint.jd | 1 | ||||
-rw-r--r-- | docs/html/tools/help/hierarchy-viewer.jd | 29 | ||||
-rw-r--r-- | docs/html/tools/revisions/gradle-plugin.jd | 68 | ||||
-rw-r--r-- | docs/html/tools/revisions/index.jd | 6 | ||||
-rw-r--r-- | docs/html/tools/revisions/studio.jd | 55 | ||||
-rw-r--r-- | docs/html/tools/sdk/tools-notes.jd | 27 | ||||
-rw-r--r-- | docs/html/tools/studio/index.jd | 321 | ||||
-rw-r--r-- | docs/html/tools/testing-support-library/index.jd | 8 | ||||
-rw-r--r-- | docs/html/tools/tools_toc.cs | 1 |
14 files changed, 685 insertions, 129 deletions
diff --git a/docs/html/tools/building/building-cmdline.jd b/docs/html/tools/building/building-cmdline.jd index ec00b50..33798a5 100644 --- a/docs/html/tools/building/building-cmdline.jd +++ b/docs/html/tools/building/building-cmdline.jd @@ -34,9 +34,9 @@ parent.link=index.html </div> </div> - <p>By default, there are two build types to build your application using the gradle.build settings: + <p>By default, there are two build types to build your application using the Gradle build settings: one for debugging your application — <em>debug</em> — and one for building your - final package for release — <em>release mode</em>. Regardless of which way you build type + final package for release — <em>release mode</em>. Regardless of which build type your modules use, the app must be signed before it can install on an emulator or device—with a debug key when building in debug mode and with your own private key when building in release mode.</p> @@ -48,23 +48,24 @@ parent.link=index.html development device. You cannot distribute an application that is signed with a debug key. When you build using the release build type, the .apk file is <em>unsigned</em>, so you must manually sign it with your own private key, using Keytool and Jarsigner settings in the - module's gradle.build file.</p> + module's <code>build.gradle</code> file.</p> <p>It's important that you read and understand <a href= "{@docRoot}tools/publishing/app-signing.html">Signing Your Applications</a>, particularly once you're ready to release your application and share it with end-users. That document describes the - procedure for generating a private key and then using it to sign your .apk file. If you're just + procedure for generating a private key and then using it to sign your APK file. If you're just getting started, however, you can quickly run your applications on an emulator or your own development device by building in debug mode.</p> <p>If you don't have <a href="http://www.gradle.org/">Gradle</a>, you can obtain it from the <a href="http://gradle.org/">Gradle - home page</a>. Install it and make sure it is in your executable PATH. Before calling Ant, you + home page</a>. Install it and make sure it is in your executable PATH. Before calling Gradle, you need to declare the JAVA_HOME environment variable to specify the path to where the JDK is installed.</p> - <p class="note"><strong>Note:</strong> When installing JDK on Windows, the default is to install - in the "Program Files" directory. This location will cause <code>ant</code> to fail, because of - the space. To fix the problem, you can specify the JAVA_HOME variable like this: + <p class="note"><strong>Note:</strong> When using <code>ant</code> and installing JDK on Windows, + the default is to install in the "Program Files" directory. This location will cause + <code>ant</code> to fail, because of the space. To fix the problem, you can specify the JAVA_HOME + variable like this: <pre>set JAVA_HOME=c:\Progra~1\Java\<jdkdir></pre> <p>The easiest solution, however, is to install JDK in a non-space directory, for example:</p> diff --git a/docs/html/tools/building/building-studio.jd b/docs/html/tools/building/building-studio.jd index 68800da..4431194 100644 --- a/docs/html/tools/building/building-studio.jd +++ b/docs/html/tools/building/building-studio.jd @@ -67,26 +67,13 @@ selected build variant. For more information, see the <a href="{@docRoot}sdk/installing/studio-build.html">Build System</a> guide.</p> <p>To view the list of all available build tasks in Android Studio, click <strong>Gradle</strong> -on the right side of the IDE window. The <em>Gradle tasks</em> panel appears as shown in -figure 2. Double-click any build task to run it in Android Studio. To hide the <em>Gradle tasks</em> -panel, click <strong>Gradle</strong> again.</p> +on the right side of the IDE window. The <em>Gradle tasks</em> panel appears.</p> -<img src="{@docRoot}images/tools/studio-gradle-panel.png" alt="" /> -<p class="img-caption"><strong>Figure 2.</strong> The list of build tasks in Android Studio.</p> <h3 id="buildRelease">Build a release version</h3> -<p>You can now build the release version of your application for distribution. To build it from Android -Studio:</p> - -<ol> - <li>Click <strong>Gradle</strong> on the right side of the IDE window.</li> - <li>On the <em>All tasks</em> section of the sidebar that appears, expand - <strong>BuildSystemExample</strong>.</li> - <li>Expand <strong>:app</strong> and double-click <strong>assembleRelease</strong>.</li> -</ol> - -<p>You can use this procedure to invoke any build task from Android Studio.</p> +<p>You can now use the <strong>Build</strong> menu options to build the release version of your +application for distribution. </p> <p>The build generates an APK for each build variant: the <code>app/build/apk/</code> directory contains packages named diff --git a/docs/html/tools/building/configuring-gradle.jd b/docs/html/tools/building/configuring-gradle.jd index 8379508..7cca5b4 100644 --- a/docs/html/tools/building/configuring-gradle.jd +++ b/docs/html/tools/building/configuring-gradle.jd @@ -470,7 +470,11 @@ applied to each build. </p> <li>fullRelease</li> </ul> -<p>To build this example, invoke the <code>assemble</code> task from Android Studio or from the -command line.</p> +<p>To build this example, click the <strong>Build</strong> menu option in Android Studio or invoke +the <code>assemble</code> task from the command line. </p> + +<p class="note"><strong>Note:</strong> The <strong>Build > Make Project</strong> option compiles +all the source files in the entire project that have been modified since the last compilation. The +<strong>Build > Rebuild Project</strong> option recomplies all the source files in the project.</p> <p>Separate output folders are created for each build variant. </p> diff --git a/docs/html/tools/building/plugin-for-gradle.jd b/docs/html/tools/building/plugin-for-gradle.jd index 54a03fd..a497c1b 100644 --- a/docs/html/tools/building/plugin-for-gradle.jd +++ b/docs/html/tools/building/plugin-for-gradle.jd @@ -15,7 +15,7 @@ page.title=Android Plug-in for Gradle <li><a href="{@docRoot}sdk/installing/studio-build.html"> Build System Overview</a></li> <li><a href="{@docRoot}tools/building/index.html"> -Buidling and Running</a></li> +Building and Running</a></li> <li><a href="{@docRoot}tools/building/building-studio.html"> Building and Running from Android Studio</a></li> </ul> @@ -273,16 +273,9 @@ tasks are:</p> <dd><p>Performs the clean.</p></dd> </dl> -<p>The Android plugin provides additional tasks for <em>connectedCheck</em> and <em>deviceCheck</em> +<p>The Android plugin provides the <em>connectedCheck</em> and <em>deviceCheck</em> tasks for checks run on connected, emulated, and remote devices. Gradle tasks can be viewed by clicking -the Gradle tab</a> in the right margin. -<img src="{@docRoot}images/tools/studio-gradle-tab.png"></p> -<p class="img-caption"><strong>Figure 1:</strong> Gradle tab</p> - -<p>Running a top-level task, runs all the dependent tasks. For example, the <em>assemble</em> task -has dependent tasks for <em>assembleDebug</em> and <em>assembleRelease</em> to make the debug and -release APKs. The <em>assemble</em> task depends on these tasks so calling it builds both APKs. -These tasks can also be called independently to build the debug or release APK separately. </p> +the Gradle tab</a> in the right margin.</p> <p>You can view the list of available tasks and invoke any task from Android Studio and from the command line, as described in diff --git a/docs/html/tools/debugging/annotations.jd b/docs/html/tools/debugging/annotations.jd new file mode 100644 index 0000000..fe9f9cc --- /dev/null +++ b/docs/html/tools/debugging/annotations.jd @@ -0,0 +1,241 @@ +page.title=Improving Code Inspection with Annotations +@jd:body + +<div id="qv-wrapper"> +<div id="qv"> + + <h2>In this document</h2> + <ol> + <li><a href="#adding-nullness">Adding Nullness Annotations</a></li> + <li><a href="#res-annotations">Adding Resource Annotation</a></li> + <li><a href="#enum-annotations">Creating Enumerated Annotations</a></li> + </ol> + + <h2>See also</h2> + <ol> + <li><a href="{@docRoot}tools/help/lint.html">lint (reference)</a></li> + <li><a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with lint</a></li> + <li><a href="{@docRoot}tools/studio/index.html#annotations">Annotations in Android Studio</a></li> + </ol> + +</div> +</div> + +<p>Using code inspections tools such as <a href="{@docRoot}tools/help/lint.html">lint</a> can help +you find problems and improve your code, but inspection tools can only infer so much. Android +resource ids, for example, use an {@code int} to identify strings, graphics, colors and other +resource types, so inspection tools cannot tell when you have specified a string resource where +you should have specified a color. This situation means that your app may render incorrectly or +fail to run at all, even if you use code inspection. </p> + +<p>Annotations allow you to provide hints to code inspections tools like {@code lint}, to help +detect these, more subtle code problems. They are added as metadata tags that you attach to +variables, parameters, and return values to inspect method return values, passed parameters, and +local variables and fields. When used with code inspections tools, annotations can help you detect +problems, such as null pointer exceptions and resource type +conflicts. </p> + +<p>For more information on enabling <a href="{@docRoot}tools/help/lint.html">lint</a> inspections +and running <a href="{@docRoot}tools/help/lint.html">lint</a>, +see <a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with lint</a>.</p> + +<p>Android supports a variety of annotations for insertion in the methods, parameters, and return +values in your code, for example:</p> + +<dl> + <dt>{@link android.support.annotation.Nullable @Nullable}</dt> + <dd>Can be null.</dd> + + <dt>{@link android.support.annotation.NonNull @NonNull}</dt> + <dd>Cannot be null.</dd> + + <dt>{@link android.support.annotation.StringRes @StringRes}</dt> + <dd>References a <a href="{@docRoot}reference/android/R.string.html"><code>R.string</code></a> + resource.</dd> + + <dt>{@link android.support.annotation.DrawableRes @DrawableRes}</dt> + <dd>References a + <a href="{@docRoot}guide/topics/resources/drawable-resource.html"><code>Drawable</code></a> + resource. </dd> + + <dt>{@link android.support.annotation.ColorRes @ColorRes}</dt> + <dd>References a <a href="{@docRoot}reference/android/graphics/Color.html"><code>Color</code></a> + resource. </dd> + + <dt>{@link android.support.annotation.InterpolatorRes @InterpolatorRes}</dt> + <dd>References a + <a href="{@docRoot}reference/android/view/animation/Interpolator.html"><code>Interpolator</code></a> + resource. </dd> + + <dt>{@link android.support.annotation.AnyRes @AnyRes}</dt> + <dd>References any type of <a href="{@docRoot}reference/android/R.html"><code>R.</code></a> + resource. </dd> + </dl> + +<p>For a complete list of the supported annotations, either examine the contents of the +{@link android.support.annotation Support-Annotations} library or use the +auto-complete feature to display the available options for the <code>import +android.support.annotation.</code> statement. The +<a href="{@docRoot}tools/help/sdk-manager.html"> SDK Manager</a> packages the +{@link android.support.annotation Support-Annotations} library in the Android Support Repository +for use with Android Studio and in the Android +<a href="{@docRoot}tools/support-library/index.html">Support Library</a> for use with other Android +development tools.</p> + + +<p>To add annotations to your code, first add a dependency to the +{@link android.support.annotation Support-Annotations} library. In Android Studio, +add the dependency to your <code>build.gradle</code> file. </p> + +<pre> +dependencies { + compile 'com.android.support:support-annotations:22.0.0' +} +</pre> + + +<p>The {@link android.support.annotation Support-Annotations} library is decorated with the +supported annotations so using this library's methods and resources automatically checks the code +for potential problems.</p> + +<p>If you include annotations in a library and use the +<a href="{@docRoot}tools/building/plugin-for-gradle.html"><code>Android Plugin for Gradle</code></a> +to build an Android ARchive (AAR) artifact of that library, the annotations are included as part +of the artifact in XML format in the <code>annotations.zip</code> file. </p> + +<p>To start a code inspection from Android Studio, which includes validating annotations and +automatic <a href="{@docRoot}tools/help/lint.html">lint</a> checking, select +<strong>Analyze > Inspect Code</strong> from the menu options. Android Studio displays conflict +messages throughout the code to indication annotation conflicts and suggest possible +resolutions.</p> + + +<h2 id="adding-nullness">Adding Nullness Annotations</h2> +<p>Add {@link android.support.annotation.Nullable @Nullable} and +{@link android.support.annotation.NonNull @NonNull} annotations to check +the nullness of a given variable, parameter, or return value. For example, if a local variable +that contains a null value is passed as a parameter to a method with the +{@link android.support.annotation.NonNull @NonNull} annotation +attached to that parameter, building the code generates a warning indicating a non-null conflict. </p> + +<p>This example attaches the {@link android.support.annotation.NonNull @NonNull} annotation to +the <code>context</code> and <code>attrs</code> parameters to check that the passed parameter +values are not null. </p> + +<pre> +import android.support.annotation.NonNull; +... + + /** Add support for inflating the <fragment> tag. */ + @NonNull + @Override + public View onCreateView(String name, @NonNull Context context, + @NonNull AttributeSet attrs) { + ... + } +... +</pre> + +<p class="note"><strong>Note:</strong> Android Studio supports running a nullability analysis to +automatically infer and insert nullness annotations in your code. For more information about +inferring nullability in Android Studio, see +<a href="{@docRoot}tools/studio/index.html#annotations">Annotations in Android Studio</a>. </p> + + +<h2 id="res-annotations">Adding Resource Annotations</h2> +<p>Add {@link android.support.annotation.StringRes @StringRes} annotations to check that +a resource parameter contains a +<a href="{@docRoot}reference/android/R.string.html"><code>R.string</code></a> +reference. During code inspection, the annotation generates a warning if a <code>R.string</code> +reference is not passed in the parameter.</p> + +<p>Validating resource types can be useful as Android references to +<a href="{@docRoot}guide/topics/resources/drawable-resource.html"><code>Drawables</code></a> and +<a href="{@docRoot}reference/android/R.string.html"><code>R.string</code></a> resources are both +passed as integers. Code that expects a parameter to reference a <code>Drawable</code> can be passed +the expected reference type of int, but actually reference a <code>R.string</code></a> resource. </p> + +<p>This example attaches the {@link android.support.annotation.StringRes @StringRes} +annotation to the <code>resId</code> parameter to validate that it is really a string resource. </p> + +<pre> +import android.support.annotation.StringRes; +... + public abstract void setTitle(@StringRes int resId); + ... +</pre> + + +<p>Annotations for the other resource types, such as +{@link android.support.annotation.DrawableRes @DrawableRes}, +{@link android.support.annotation.ColorRes @ColorRes}, and +{@link android.support.annotation.InterpolatorRes @InterpolatorRes} can be added using +the same annotation format and run during the code inspection. </p> + + +<h2 id="enum-annotations">Creating Enumerated Annotations</h2> +<p>Use the {@link android.support.annotation.IntDef @IntDef} and +{@link android.support.annotation.StringDef @StringDef} annotations +so you can create enumerated annotations of integer and string sets to validate other types of code +references, such as passing references to a set of constants. </p> + +<p>The following example illustrates the steps to create an enumerated annotation that ensures +a value passed as a method parameter references one of the defined constants.</p> + +<pre> +import android.support.annotation.IntDef; +... +public abstract class ActionBar { + ... + //Define the list of accepted constants + @IntDef({NAVIGATION_MODE_STANDARD, NAVIGATION_MODE_LIST, NAVIGATION_MODE_TABS}) + + //Tell the compiler not to store annotation data in the <code>.class</code> file + @Retention(RetentionPolicy.SOURCE) + + //Declare the <code>NavigationMode</code> annotation + public @interface NavigationMode {} + + //Declare the constants + public static final int NAVIGATION_MODE_STANDARD = 0; + public static final int NAVIGATION_MODE_LIST = 1; + public static final int NAVIGATION_MODE_TABS = 2; + + //Decorate the target methods with the annotation + @NavigationMode + public abstract int getNavigationMode(); + + //Attach the annotation + public abstract void setNavigationMode(@NavigationMode int mode); + +</pre> + +<p>When you build this code, a warning is generated if the <code>mode</code> parameter does +not reference one of the defined constants (<code>NAVIGATION_MODE_STANDARD</code>, +<code>NAVIGATION_MODE_LIST</code>, or <code>NAVIGATION_MODE_TABS</code>).</p> + +<p>You can also define an annotation with a <code>flag</code> to check if a parameter +or return value references a valid pattern. This example creates the +<code>DisplayOptions</code> annotation with a list of valid <code>DISPLAY_</code> constants. </p> + +<pre> +import android.support.annotation.IntDef; +... + +@IntDef(flag=true, value={ + DISPLAY_USE_LOGO, + DISPLAY_SHOW_HOME, + DISPLAY_HOME_AS_UP, + DISPLAY_SHOW_TITLE, + DISPLAY_SHOW_CUSTOM +}) +@Retention(RetentionPolicy.SOURCE) +public @interface DisplayOptions {} + +... +</pre> + +<p>When you build code with an annotation flag, a warning is generated if the decorated parameter +or return value does not reference a valid pattern.</p> + + diff --git a/docs/html/tools/debugging/improving-w-lint.jd b/docs/html/tools/debugging/improving-w-lint.jd index ff94b7f..8f74f46 100644 --- a/docs/html/tools/debugging/improving-w-lint.jd +++ b/docs/html/tools/debugging/improving-w-lint.jd @@ -22,6 +22,7 @@ parent.link=index.html <h2>See Also</h2> <ol> <li><a href="{@docRoot}tools/help/lint.html">lint (reference)</a></li> + <li><a href="{@docRoot}tools/degugging/annotations.html">Using Android Annotations</a></li> </ol> </div> </div> diff --git a/docs/html/tools/help/hierarchy-viewer.jd b/docs/html/tools/help/hierarchy-viewer.jd index 4a346e0..da4cc1e 100644 --- a/docs/html/tools/help/hierarchy-viewer.jd +++ b/docs/html/tools/help/hierarchy-viewer.jd @@ -3,16 +3,27 @@ parent.title=Tools parent.link=index.html @jd:body -<p>Hierarchy Viewer allows you to debug and optimize your user -interface. It provides a visual representation of the layout's View hierarchy -(the Layout View) and a magnified inspector of the display (the Pixel Perfect View). -</p> +<p>The Hierarchy Viewer allows you to debug and optimize your user +interface. It provides a visual representation of the layout's View hierarchy +(the Layout View) and a magnified inspector of the display (the Pixel Perfect View). </p> + +<p>To start the Hierarchy Viewer, do one of the following: </p> -<p>To start Hierarchy Viewer, enter the following command from the SDK <code>tools/</code> directory:</p> - <pre>hierarchyviewer</pre> -</ol> +<ul> +<li> From Android Studio, choose <strong>Tools > Android Device Monitor</strong> or click the +Android Device Monitor icon +<img src="{@docRoot}images/tools/hierarchicalviewer-icon.png" alt=""/>. Click the Open Perspectives +icon <img src="{@docRoot}images/tools/studio-DDMS-open-perspective-icon.png" alt=""/> and select +<strong>Hierarchy View</strong>. </li> +<li>From the SDK <code>tools/</code> directory, enter: + <pre>monitor</pre> </li> +</ul> -<p>For more information on how to use Hierarchy Viewer, see -<a href="{@docRoot}tools/debugging/debugging-ui.html">Debugging and Profiling UIs</a> +<p>For more information on how to use the Hierarchy Viewer, see +<a href="{@docRoot}tools/debugging/debugging-ui.html">Optimizing Your UI</a>. </p> +<p class="note"><strong>Note:</strong> The command line version of Hierarchy Viewer has been +deprecated. </p> + + diff --git a/docs/html/tools/revisions/gradle-plugin.jd b/docs/html/tools/revisions/gradle-plugin.jd index fd294d2..90ec44a 100644 --- a/docs/html/tools/revisions/gradle-plugin.jd +++ b/docs/html/tools/revisions/gradle-plugin.jd @@ -36,9 +36,77 @@ plugin you are using, check the version declaration in the project-level <p>For a summary of known issues in Android Plugin for Gradle, see <a href="http://tools.android.com/knownissues">http://tools.android.com/knownissues</a>.</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 Plugin for Gradle, Revision 1.2.0</a> <em>(April 2015)</em> + </p> + + <div class="toggle-content-toggleme"> + + <dl> + <dt>Dependencies:</dt> + + <dd> + <ul> + <li>Gradle 2.2.1 or higher.</li> + <li>Build Tools 21.1.1 or higher.</li> + </ul> + </dd> + + <dt>General Notes:</dt> + <dd> + <ul> + <li>Enhanced support for running unit tests with Gradle. </li> + <ul> + <li>Added support to include Java-style resources in the classpath when running unit + tests directly from Gradle. + </li> + <li>Added unit test dependency support for Android ARchive (AAR) artifacts. + </li> + <li>Added support for the <code>unitTestVariants</code> property so unit test variants + can be manipulated using the <code>build.gradle</code> file. + </li> + <li>Added the <code>unitTest.all</code> code block under <code>testOptions</code> to + configure customized tasks for unit test. The following sample code shows how to add + unit test configuration settings using this new option: +<pre> +android { + testOptions { + unitTest.all { + jvmArgs '-XX:MaxPermSize=256m' // Or any other gradle option. + } + } +} +</pre> + </li> + <li>Fixed the handling of enums and public instance fields in the packaging of the + <code>mockable-android.jar</code> file. + </li> + <li>Fixed library project task dependencies so test classes recompile after changes. + </li> + </ul> + <li>Added the <code>testProguardFile</code> property to apply + <a href="{@docRoot}tools/help/proguard.html">ProGuard</a> files when minifying a test APK. + </li> + <li>Added the <code>timeOut</code> property to the <code>adbOptions</code> code block + for setting the maximum recording time for + <a href="{@docRoot}tools/help/adb.html">Android Debug Bridge</a> screen recording. + </li> + <li>Added support for 280 dpi resources. + </li> + <li>Improved performance during project evaluation. + </li> + </ul> + </dd> + </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 Plugin for Gradle, Revision 1.1.3</a> <em>(March 2015)</em> </p> diff --git a/docs/html/tools/revisions/index.jd b/docs/html/tools/revisions/index.jd index 0e7ceef..0b8db83 100644 --- a/docs/html/tools/revisions/index.jd +++ b/docs/html/tools/revisions/index.jd @@ -6,4 +6,8 @@ page.noplus=1 an update at their own schedule, so some have their own set of release notes. You can find information about some of the packages in this section, including the core <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools</a> and the latest <a -href="{@docRoot}tools/revisions/platforms.html">Platforms</a>.</p>
\ No newline at end of file +href="{@docRoot}tools/revisions/platforms.html">SDK Platforms</a>. Release notes are also available +for Android developer tools, such as +<a href="{@docRoot}tools/revisions/studio.html">Android Studio</a> and the +<a href="{@docRoot}tools/revisions/gradle-plugin.html">Android Plugin for Gradle</a>. +</p> diff --git a/docs/html/tools/revisions/studio.jd b/docs/html/tools/revisions/studio.jd index 3982f2e..f530a5f 100644 --- a/docs/html/tools/revisions/studio.jd +++ b/docs/html/tools/revisions/studio.jd @@ -29,9 +29,9 @@ everything you need to begin developing Android apps:</p> <p>For an introduction to Android Studio, read the <a href="{@docRoot}tools/studio/index.html">Android Studio</a> guide.</p> -<p>Periodic updates are pushed to Android Studio without requiring you to update. To -manually check for updates, select <strong>Help > Check for updates</strong> (on Mac, select -<strong>Android Studio > Check for updates</strong>).</p> +<p>Periodic updates are pushed to Android Studio without requiring you to update your Android +project. 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> @@ -43,6 +43,53 @@ 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 v1.2.0</a> <em>(April 2015)</em> + </p> + + <div class="toggle-content-toggleme"> + <p>Various fixes and enhancements:</p> + <ul> + <li>Updated the Android runtime window to include the + <a href="{@docRoot}tools/studio/index.html#mem-cpu">Memory Monitor</a> tool + and added a tab for CPU performance monitoring.</li> + <li>Added a <em>Captures</em> tab in the left margin to display the captured memory and CPU + performance data files, such as CPU method tracking and memory heap snapshots.</li> + <li>Expanded <a href="{@docRoot}tools/debugging/annotations.html">annotation</a> + support with additional metadata annotations and inferred nullability. </li> + <li>Enhanced the Translations Editor with additional support for Best Current Practice + (BCP) 47, which uses 3-letter language and region codes.</li> + <li>Integrated IntelliJ 14 and 14.1 features for improved code analysis and performance:</li> + <ul> + <li>Enhanced debugging to show inline values for variables and referring objects, + as well as perform inline evaluation of lambda and operator expressions. </li> + <li>Added code style detection for tab and indent sizes. </li> + <li>Added scratch files for code experiments and prototyping without project files.</li> + <li>Added the simultaneous insertion of opening and closing tags in HTML and XML files.</li> + <li>Added a built-in Java class decompiler so you can look at what’s inside a library + for which the source code is not available. </li> + </ul> + <p>See + <a class="external-link" href="https://www.jetbrains.com/idea/whatsnew">What's New in IntelliJ</a> + for a complete description of the new features and enhancements.</p> + </li> + <li>Added additional <a href="{@docRoot}tools/studio/index.html#project-view">Project Views</a> + for <em>Scratches</em>, <em>Project Files</em>, <em>Problems</em>, <em>Production</em>, + and <em>Tests</em> to enhance project management and access. </li> + <li>Enhanced the <strong>File > Settings</strong> menu and dialogs for improved settings + access and management. </li> + <li>Added support for high-density displays for Windows and Linux. </li> + <li>Added support for 280 dpi resources in the <code>res/drawable-280dpi/</code> folder. + </ul> + </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 v1.1.0</a> <em>(February 2015)</em> </p> @@ -63,6 +110,7 @@ Android Studio, as denoted by revision number. </p> for region and language combinations, launcher icons, resource names, and other common code problems.</li> <li>Added support for Best Current Practice (BCP) language tag 47. </li> + </ul> </div> </div> @@ -85,6 +133,7 @@ Android Studio, as denoted by revision number. </p> updates, use <strong>File > Settings > Updates</strong> to change to the <strong>Stable</strong> update channel. </li> + </ul> </div> </div> diff --git a/docs/html/tools/sdk/tools-notes.jd b/docs/html/tools/sdk/tools-notes.jd index 47b603a..434dc44 100644 --- a/docs/html/tools/sdk/tools-notes.jd +++ b/docs/html/tools/sdk/tools-notes.jd @@ -24,6 +24,33 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues <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=""/>SDK Tools, Revision 24.2.0</a> <em>(May 2015)</em> + </p> + + <div class="toggle-content-toggleme"> + + <dl> + <dt>Dependencies:</dt> + + <dd> + <ul> + <li>Android SDK Platform-tools revision 19 or later.</li> + </ul> + </dd> + + <dt>General Notes:</dt> + <dd> + <ul> + <li>Fixed several minor emulator issues.</li> + </ul> + </dd> + </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=""/>SDK Tools, Revision 24.1.2</a> <em>(February 2015)</em> </p> diff --git a/docs/html/tools/studio/index.jd b/docs/html/tools/studio/index.jd index eaa96d3..a5b14a7 100644 --- a/docs/html/tools/studio/index.jd +++ b/docs/html/tools/studio/index.jd @@ -18,7 +18,7 @@ page.title=Android Studio Overview <h2>See also</h2> <ol> - <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 class="external-link" href="http://confluence.jetbrains.com/display/IntelliJIDEA/FAQ+on+Migrating+to+IntelliJ+IDEA">IntelliJ FAQ on migrating to IntelliJ IDEA</a></li> </ol> </div> @@ -26,8 +26,7 @@ page.title=Android Studio Overview <p>Android Studio is the official IDE for Android application development, -based on <a href="https://www.jetbrains.com/idea/" class="external-link" -target="_blank">IntelliJ IDEA</a>. +based on <a class="external-link" href="https://www.jetbrains.com/idea/" target="_blank">IntelliJ IDEA</a>. On top of the capabilities you expect from IntelliJ, Android Studio offers:</p> @@ -38,10 +37,9 @@ Android Studio offers:</p> <li>Rich layout editor with support for drag and drop theme editing</li> <li>{@code 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>Built-in support for + <a href="http://developers.google.com/cloud/devtools/android_studio_templates/">Google Cloud Platform</a>, + making it easy to integrate Google Cloud Messaging and App Engine</li> <li>And much more</li> </ul> @@ -55,24 +53,25 @@ Studio features.</p> "{@docRoot}tools/workflow/index.html">Workflow</a> section, such as <a href= "{@docRoot}tools/projects/projects-studio.html">Managing Projects from Android Studio</a> and <a href="{@docRoot}tools/building/building-studio.html">Building and Running from Android -Studio</a>.</p> +Studio</a>. For a summary of the latest changes to Android Studio, see the +<a href="{@docRoot}tools/revisions/studio.html">Android Studio Release Notes</a>.</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 +<h3 id="project-view"><em>Android</em> project view</h3> +<p>By default, Android Studio displays your project files in the <em>Android</em> project view. This view shows a flattened version of your project's structure that provides quick access to the key source files of Android projects and helps you work with the <a href="{@docRoot}sdk/installing/studio-build.html">Gradle-based build system</a>. -The Android project view:</p> +The <em>Android</em> 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>Groups the build files for all modules in a common folder.</li> + <li>Groups all the manifest files for each module in a common folder.</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> @@ -81,7 +80,7 @@ The Android project view:</p> <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 class="img-caption"><strong>Figure 2.</strong> Show 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 @@ -91,19 +90,20 @@ top level of the project hierarchy and contains these three elements at the top <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> + <li><code>Gradle Scripts/</code> - Gradle build and property files.</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 to the segregated project view, select <strong>Project</strong> from -the <strong>Project</strong> drop-down. </p> +representation. To switch to back to the segregated project view, select <strong>Project</strong> +from the <strong>Project</strong> drop-down. </p> -<h3>Android Studio Project and Directory Structure</h3> -<p>When you use the <em>Project</em> view of a new project in Android Studio, you +<h3 id="other-views">Other Android Studio views</h3> +<p>When you use the <em>Project</em> view in Android Studio, you should notice that the project structure appears different than you may be used to in Eclipse. Each instance of Android Studio contains a project with one or more application modules. Each application module folder contains the complete source sets for that module, including @@ -113,11 +113,28 @@ module's {@code src/main} directory for source code updates, the gradle.build fi 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> <class="img-caption"><strong>Figure 3.</strong> View Android Studio <em>Project</em> + structure.</p> + +<p>You can also customize the view of the project files to focus on specific aspects of your app +development: </p> + +<ul> + <li><em>Packages</em> </li> + <li><em>Project Files</em> </li> + <li><em>Scratches</em> </li> + <li><em>Problems</em> </li> + <li><em>Production</em> </li> + <li><em>Tests</em> </li> +</ul> + +<p>For example, selecting the <strong>Problems</strong> view of your project displays links to the +source files containing any recognized coding and syntax errors, such as missing a XML element +closing tag in a layout file.<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/projects/index.html">Managing Projects</a>.</p> +<a class="external-link" href="http://confluence.jetbrains.com/display/IntelliJIDEA/Project+Organization">IntelliJ project organization</a> +and <a href="{@docRoot}tools/projects/index.html">Managing Projects</a>.</p> @@ -156,7 +173,7 @@ To configure custom build settings in an Android Studio project, see <a href="{@docRoot}tools/building/configuring-gradle.html">Configuring Gradle Builds</a>.</p> -<h3>Application ID for Package Identification </h3> +<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. @@ -243,25 +260,53 @@ Manager (HAXM) emulator accelerator and creates a default emulator for quick app <p>For more information, see <a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs</a>.</p> +<h3 id="inline-debug">Inline debugging</h3> +<p>Use inline debugging to enhance your code walk-throughs in the debugger view +with inline verification of references, expressions, and variable values. Inline debug information +includes: </p> +<ul> + <li>Inline variable values</li> + <li>Referring objects that reference a selected object </li> + <li>Method return values</li> + <li>Lambda and operator expressions</li> + <li>Tool tip values</li> +</ul> + +<p>To enable inline debugging, in the <em>Debug</em> window click the Settings icon +<img src="{@docRoot}images/tools/studio-debug-settings-icon.png"/> and select the +check box for <strong>Show Values In Editor</strong>.</p> + +<h3 id="mem-cpu">Memory and CPU monitor</h3> +<p>Android Studio provides a memory and CPU monitor view so you can more easily monitor your +app's performance and memory usage to track CPU usage, 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>Android</strong> tab in the lower left corner of the +runtime window to launch the Android runtime window. Click the <strong>Memory</strong> or +<strong>CPU</strong> tab. </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" srcset="{@docRoot}images/tools/studio-memory-monitor_2x.png 2x" width"635" height="171" alt="" /> + <p class="img-caption"><strong>Figure 4.</strong> Monitor memory and CPU usage.</p> - <img src="{@docRoot}images/tools/studio-memory-monitor.png" /> - <p class="img-caption"><strong>Figure 5.</strong> Memory Monitor</p> +<h3>Data file access</h3> +<p>The Android SDK tools, such as <a href="{@docRoot}tools/help/systrace.html">Systrace</a>, +<a href="{@docRoot}tools/help/logcat.html">logcat</a>, and +<a href="{@docRoot}tools/help/traceview.html">Traceview</a>, generate performance and debugging +data for detailed app analysis.</p> +<p>To view the available generated data files, click <strong>Captures</strong> in the left +corner of the runtime window. In the list of the generated files, double-click a file to view +the data. Right-click any <code>.hprof</code> files to convert them to a standard +<a href="{@docRoot}tools/help/hprof-conv.html"><code>.hprof</code> </a> file format.</p> -<h3>Code Inspections</h3> -<p>In Android Studio, the configured <a href="{@docRoot}tools/help/lint.html"><code>lint</code></a> and -other IDE inspections run automatically whenever you compile your program. In addition to the + +<h3>Code inspections</h3> +<p>In Android Studio, the configured <a href="{@docRoot}tools/help/lint.html"><code>lint</code></a> +and other IDE inspections run automatically whenever you compile your program. In addition to the configured {@code lint} checks, additional -<a href="https://www.jetbrains.com/idea/help/inspection-basics.html?search=inspection" class="external-link" -target="_blank">IntelliJ code inspections</a> -run to streamline code review.</p> +<a class="external-link" href="https://www.jetbrains.com/idea/help/inspection-basics.html?search=inspection" +target="_blank">IntelliJ code inspections</a> and annotation validation run to streamline code +review.</p> <p>Android Studio enables several <code>lint</code> checks @@ -269,10 +314,10 @@ 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> + 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> @@ -302,13 +347,13 @@ android { <p>You can also manage inspection profiles and configure inspections within Android Studio. -Choose <strong>File > Settings > Project Settings</strong>. The -<em>Inspection Configuration</em> page appears with the supported inspections.</p> +Choose <strong>File > Settings > Project Settings</strong> and expand <strong>Editor</strong>. +The <em>Inspection Configuration</em> page appears with the supported inspections.</p> <p><img src="{@docRoot}images/tools/studio-inspections-config.png" alt="" /> </p> -<p class="img-caption"><strong>Figure 5.</strong> Inspection Configuration</p> +<p class="img-caption"><strong>Figure 5.</strong> Configure inspections.</p> -<p class="note"><strong>Note:</strong> If you wish to change the behavior of specific -inspection notifications, you can change the inspection severity, for example from <em>warning</em> +<p class="note"><strong>Note:</strong> To change the behavior of specific +inspection notifications, change the inspection severity, for example from <em>warning</em> to <em>error</em>. </p> @@ -317,7 +362,7 @@ The <em>Inspections Scope</em> dialog appears so you can specify the desired ins -<h4>Running Inspections from the command line</h4> +<h4>Running inspections from the command line</h4> <p>You can also run {@code lint} inspections from the command line in your SDK directory. </p> <pre> sdk$ lint [flags] <project directories> @@ -328,25 +373,127 @@ flags can be used to display the available issues and explanations. </p> <p>For more information, see -<a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with {@code lint}</a> and -<a href="{@docRoot}tools/help/lint.html">lint tool</a>.</p> +<a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with {@code lint}</a> +and <a href="{@docRoot}tools/help/lint.html">lint tool</a>.</p> + + + +<h3 id="annotations">Annotations in Android Studio</h3> +<p>Android Studio supports annotations for variables, parameters, and return values to help you +catch bugs, such as null pointer exceptions and resource type conflicts. The +<a href="{@docRoot}tools/help/sdk-manager.html">Android SDK Manager</a> packages +the {@link android.support.annotation Support-Annotations} library +in the Android Support Repository for use with Android +Studio. Android Studio validates the configured annotations during code inspection. </p> + +<p>To add annotations to your code in Android Studio, first add a dependency for the +{@link android.support.annotation Support-Annotations} library:</p> +<ol> + <li>Select <strong>File > Project Structure</strong>.</li> + <li>In the <em>Project Structure</em> dialog, select the desired module, click the + <strong>Dependencies</strong> tab. </li> + <li>Click the <img src="{@docRoot}images/tools/studio-add-icon.png"/> icon to include a + <strong>Library dependency</strong>.</li> + <li>In the <em>Choose Library Dependency</em> dialog, select <code>support-annotations</code> and + click <strong>Ok</strong>. </li> +</ol> + +<p>The <code>build.gradle</code> file is updated with the <code>support-annotations</code> +dependency.</p> + +<p>You can also manually add this dependency to your <code>build.gradle</code> file, as shown in +the following example. </p> + +<pre> +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile 'com.android.support:appcompat-v7:22.0.0' + <strong>compile 'com.android.support:support-annotations:22.0.0'</strong> +} +</pre> + + + +<h4>Inferring nullability</h4> +<p>A nullability analysis scans the contracts throughout the method hierarchies in your code to +detect:</p> +<ul> + <li>Calling methods that can return null </li> + <li>Methods that should not return null </li> + <li>Variables, such as fields, local variables, and parameters, that can be null </li> + <li>Variables, such as fields, local variables, and parameters, that cannot hold a null value </li> +</ul> + +<p>The analysis then automatically inserts the appropriate null annotations in the detected +locations. </p> + +<p>To run a nullability analysis in Android Studio, +select the <strong>Analyze > Infer Nullity</strong> +menu option. Android Studio inserts the Android +{@link android.support.annotation.Nullable @Nullable} and +{@link android.support.annotation.NonNull @NonNull} annotations in detected locations +in your code. After running a null analysis, it's good practice to verify the injected +annotations.</p> + +<p class="note"><strong>Note:</strong> The nullability analysis may insert the IntelliJ +<a class="external-link" href="https://www.jetbrains.com/idea/help/-nullable-and-notnull-annotations.html?search=annotations"> +<code>@Nullable</code></a> and +<a class="external-link" href="https://www.jetbrains.com/idea/help/-nullable-and-notnull-annotations.html?search=annotations"> +<code>@NotNull</code></a> annotations instead of the Android null annotations. When running +a null analysis, manually search and replace any IntelliJ annotations or include +<code>com.intellij:annotations:12.0</code> as a compile dependency in your +<code>build.gradle</code> file. This example includes the IntelliJ annotations 12.0 library as a +dependency in the <code>build.gradle</code> file: + +<pre> +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + compile 'com.android.support:appcompat-v7:22.0.0' + compile 'com.android.support:support-annotations:22.0.0' + <strong>compile 'com.intellij:annotations:12.0'</strong> +} +</pre> + +</p> + + +<h4>Validating annotations</h4> +<p>You can also manually add nullability, resource, and enumerated annotations throughout your code +to perform validations for a variety of reference values, such as +<a href="{@docRoot}reference/android/R.string.html"><code>R.string</code></a> resources, +<a href="{@docRoot}guide/topics/resources/drawable-resource.htm"><code>Drawable</code></a> +resources, +<a href="{@docRoot}reference/android/graphics/Color.html"><code>Color</code></a> resources, +and enumerated constants. </p> + +<p>Run <strong>Analyze > Inspect Code</strong> to validate the configured annotations. </p> + +<p>For a complete list of the supported annotations, either use the auto-complete feature to display +the available options for the <code>import android.support.annotation.</code> statement or +view the contents of the +{@link android.support.annotation Support-Annotations} +library. </p> + +<p>For more details about Android annotations, see +<a href="{@docRoot}tools/debugging/annotations.html">Improving Code Inspection with Annotations</a>. + <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 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> + <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 8.</strong> API Version Rendering</p> + <p class="img-caption"><strong>Figure 8.</strong> Multi-API version rendering.</p> <p>From the Design View, you can drag and drop elements from the Palette to the Preview or @@ -373,17 +520,17 @@ controlling device behaviors, and more. It also includes the Hierarchy Viewer to <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 emulator accelerator.</p> +<p>When you begin the installation process, an installation and setup wizard walks 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 emulator accelerator.</p> -<p>An updated setup wizard walks you through the setup processes as +<p>During the installation process, a 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 speedy and reliable emulation. </p> <p><img src="{@docRoot}images/tools/studio-setup-wizard.png" /></p> -<p class="img-caption"><strong>Figure 9.</strong> Setup Wizard</p> +<p class="img-caption"><strong>Figure 9.</strong> Installation and setup wizard.</p> <h3>Expanded template and form factor support</h3> @@ -391,11 +538,11 @@ reliable emulation. </p> types. </p> <h4> Android Wear and TV support</h4> - <p>For easy cross-platform development, the Project Wizard provides new templates for + <p>For easy cross-platform development, the Project Wizard provides 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 10.</strong> Supported Form Factors</p> + <p class="img-caption"><strong>Figure 10.</strong> Supported 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> @@ -405,7 +552,26 @@ types. </p> 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 11.</strong> Setup Wizard</p> + <p class="img-caption"><strong>Figure 11.</strong> Google App Engine integration.</p> + + +<h3>Easy access to project and file settings</h3> +<p>Android Studio provides setting dialogs so you can manage the most important project and file +settings from the <strong>File</strong> menus as well as the build and configuration files. For +example, you can use the <strong>File > Project Structure</strong> menu or +the <code>build.gradle</code> file to update your <code>productFlavor</code> settings. +Additional settings from the <strong>File</strong> menus include: +<ul> + <li>SDK and JDK location </li> + <li>SDK version </li> + <li>Gradle and Android Plugin for Gradle versions </li> + <li>Build tools version </li> + <li>Multidex setting</li> + <li>Product flavors </li> + <li>Build types </li> + <li>Dependencies </li> +</ul> +</p> @@ -452,13 +618,14 @@ repositories, Gradle initialization and synchronization, and Android Studio vers <p>Android Studio supports HTTP proxy settings so you can run Android Studio behind a firewall or secure network. To set the HTTP proxy settings in Android Studio:</p> <ol> - <li>From the main menu choose <strong>File > Settings > IDE Setting -- HTTP Proxy</strong>. + <li>From the main menu choose <strong>File > Settings > Appearance & Behavior -- System + Settings -- HTTP Proxy</strong>. <li>In Android Studio, open the IDE Settings dialog. <ul> - <li>On Windows and Linux, choose + <li>On Windows and Linux, choose <strong>File > Settings > IDE Setting -- HTTP Proxy</strong>. </li> - <li>On Mac, choose + <li>On Mac, choose <strong>Android Studio > Preferences > IDE Setting -- HTTP Proxy</strong>. </li> </ul> The HTTP Proxy page appears.</li> @@ -545,37 +712,37 @@ SDK Manager page. </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> +<h3 id="trans-editor"> Translations Editor</h3> +<p>Multi-language support is enhanced with the Translations Editor plugin so you can easily add +a variety of locales to the app's translation file. With +<a href="https://tools.ietf.org/html/bcp47">BCP 47</a> support, the editor combines language and +region codes into a single selection for targeted localizations. Color codes indicate whether a +locale is complete or still missing string translations. </p> -<p>To access the Translation Editor, open a <code>strings.xml</code> file and click the +<p>To access the Translations 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 12.</strong> Translation Editor</p> + <p class="img-caption"><strong>Figure 12.</strong> Add locales and strings in the + Translations Editor.</p> <h3> Editor support for the latest Android APIs</h3> <p>Android Studio supports the <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 drawable XML tags and attributes, such as <ripple> -and <animated-selector>, are supported.</p> +UI versions). Also, the drawable XML tags and attributes, such as <code><ripple></code> +and <code><animated-selector></code>, are supported.</p> <h3 id="git-samples"> Easy access to Android code samples on GitHub</h3> -<p>Clicking <strong>Import Samples</strong> from the <strong>File</strong> menu or <em>Welcome</em> page - -provides seamless access to Google code samples on GitHub.</p> +<p>Clicking <strong>Import Samples</strong> from the <strong>File</strong> menu or <em>Welcome</em> +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 13.</strong> Code Sample Access</p> + <p class="img-caption"><strong>Figure 13.</strong> Get code samples from GitHub.</p> <p><img src="{@docRoot}images/tools/studio-sample-in-editor.png" /></p> - <p class="img-caption"><strong>Figure 14.</strong> Imported Code Sample</p> + <p class="img-caption"><strong>Figure 14.</strong> Imported code sample.</p> diff --git a/docs/html/tools/testing-support-library/index.jd b/docs/html/tools/testing-support-library/index.jd index c8c9ef5..32f0553 100644 --- a/docs/html/tools/testing-support-library/index.jd +++ b/docs/html/tools/testing-support-library/index.jd @@ -585,11 +585,13 @@ allAppsButton.clickAndWaitForNewWindow();</pre> <pre> dependencies { - androidTestCompile 'com.android.support.test:testing-support-lib:0.1' + androidTestCompile 'com.android.support.test:runner:0.2' + // Set this dependency to use JUnit 4 rules + androidTestCompile 'com.android.support.test:rules:0.2' // Set this dependency to build and run Espresso tests - androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0' + androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1' // Set this dependency to build and run UI Automator tests - androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.0.0' + androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.0' }</pre> <p>To set diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs index 9ba7a22..d92af04 100644 --- a/docs/html/tools/tools_toc.cs +++ b/docs/html/tools/tools_toc.cs @@ -129,6 +129,7 @@ <li><a href="<?cs var:toroot ?>tools/debugging/improving-w-lint.html"><span class="en">Improving Your Code with lint</span></a></li> <li><a href="<?cs var:toroot ?>tools/debugging/debugging-ui.html"><span class="en">Optimizing your UI</span></a></li> <li><a href="<?cs var:toroot ?>tools/debugging/debugging-tracing.html"><span class="en">Profiling with Traceview and dmtracedump</span></a></li> + <li><a href="<?cs var:toroot ?>tools/debugging/annotations.html"><span class="en">Improving Code Inspection with Annotations</span></a></li> <li><a href="<?cs var:toroot ?>tools/debugging/systrace.html"><span class="en">Analyzing Display and Performance</span></a></li> <li><a href="<?cs var:toroot ?>tools/debugging/debugging-memory.html">Investigating Your RAM Usage</a></li> <li><a href="<?cs var:toroot ?>tools/debugging/debugging-devtools.html"><span class="en">Using the Dev Tools App</span></a></li> |