summaryrefslogtreecommitdiffstats
path: root/docs/html/tools
diff options
context:
space:
mode:
Diffstat (limited to 'docs/html/tools')
-rw-r--r--docs/html/tools/adk/adk.jd2
-rw-r--r--docs/html/tools/building/building-studio.jd12
-rw-r--r--docs/html/tools/building/configuring-gradle.jd8
-rw-r--r--docs/html/tools/debugging/debugging-memory.jd328
-rw-r--r--docs/html/tools/debugging/debugging-ui.jd38
-rw-r--r--docs/html/tools/debugging/improving-w-lint.jd131
-rw-r--r--docs/html/tools/extras/oem-usb.jd26
-rw-r--r--docs/html/tools/help/adb.jd1
-rw-r--r--docs/html/tools/help/android.jd25
-rw-r--r--docs/html/tools/help/draw9patch.jd40
-rw-r--r--docs/html/tools/help/index.jd24
-rw-r--r--docs/html/tools/help/lint.jd27
-rw-r--r--docs/html/tools/help/proguard.jd145
-rw-r--r--docs/html/tools/help/sdk-manager.jd2
-rw-r--r--docs/html/tools/help/systrace.jd3
-rw-r--r--docs/html/tools/projects/index.jd59
-rw-r--r--docs/html/tools/revisions/build-tools.jd37
-rw-r--r--docs/html/tools/revisions/gradle-plugin.jd328
-rw-r--r--docs/html/tools/revisions/platforms.jd28
-rw-r--r--docs/html/tools/revisions/studio.jd29
-rw-r--r--docs/html/tools/sdk/eclipse-adt.jd48
-rw-r--r--docs/html/tools/sdk/tools-notes.jd32
-rw-r--r--docs/html/tools/studio/index.jd234
-rw-r--r--docs/html/tools/support-library/index.jd104
-rw-r--r--docs/html/tools/testing-support-library/index.jd629
-rw-r--r--docs/html/tools/testing/testing-tools.jd56
-rw-r--r--docs/html/tools/tools_toc.cs59
27 files changed, 2128 insertions, 327 deletions
diff --git a/docs/html/tools/adk/adk.jd b/docs/html/tools/adk/adk.jd
index 7e75c11..3f45c3c 100644
--- a/docs/html/tools/adk/adk.jd
+++ b/docs/html/tools/adk/adk.jd
@@ -331,7 +331,7 @@ href="http://arduino.cc/en/Main/ArduinoBoardADK">Arduino Mega ADK</a> (for EU na
<li>Install the application to your device.</li>
<li>Connect the ADK board (USB-A) to your Android-powered device (micro-USB). Ensure that the
- power cable to the accessory is plugged in or that the micro-USB port on the accesory is
+ power cable to the accessory is plugged in or that the micro-USB port on the accessory is
connected to your computer for power (this also allows you to <a href="#monitoring">monitor the
ADK board</a>). When connected, accept the prompt that asks for whether or not to open the
DemoKit application to connect to the accessory. If the prompt does not show up, connect and
diff --git a/docs/html/tools/building/building-studio.jd b/docs/html/tools/building/building-studio.jd
index cb8cc50..68800da 100644
--- a/docs/html/tools/building/building-studio.jd
+++ b/docs/html/tools/building/building-studio.jd
@@ -52,10 +52,10 @@ progress of the build:</p>
<p>Click <img src="{@docRoot}images/tools/as-gradlebutton.png" alt=""
style="vertical-align:bottom;margin:0;"/> on the bottom
-right part of the window to show the <em>Gradle Console</em>, as shown in figure 2.</p>
+right part of the window to show the <em>Gradle Console</em>, as shown in figure 1.</p>
-<img src="{@docRoot}images/tools/as-gradleconsole.png" alt="" />
-<p class="img-caption"><strong>Figure 2.</strong> The Gradle Console in Android Studio.</p>
+<img src="{@docRoot}images/tools/studio-gradle-console.png" alt="" />
+<p class="img-caption"><strong>Figure 1.</strong> The Gradle Console in Android Studio.</p>
<p>The Gradle Console shows the build tasks and subtasks that the build system runs for
Android Studio. If the build fails, you can find more details on the console. To hide the Gradle
@@ -68,11 +68,11 @@ selected build variant. For more information, see the
<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 3. Double-click any build task to run it in Android Studio. To hide the <em>Gradle tasks</em>
+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>
-<img src="{@docRoot}images/tools/as-gradlepanel.png" alt="" />
-<p class="img-caption"><strong>Figure 3.</strong> The list of build tasks in Android Studio.</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>
diff --git a/docs/html/tools/building/configuring-gradle.jd b/docs/html/tools/building/configuring-gradle.jd
index 5af2096..8379508 100644
--- a/docs/html/tools/building/configuring-gradle.jd
+++ b/docs/html/tools/building/configuring-gradle.jd
@@ -59,8 +59,7 @@ android {
buildTypes {
release {
minifyEnabled true
- proguardFiles getDefaultProguardFile('proguard-android.txt'), \
- 'proguard-rules.txt'
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
@@ -187,8 +186,7 @@ android {
buildTypes {
release {
minifyEnabled true
- proguardFiles getDefaultProguardFile('proguard-android.txt'), \
- 'proguard-rules.txt'
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
@@ -197,7 +195,7 @@ android {
<p><code>getDefaultProguardFile('proguard-android.txt')</code> obtains the default ProGuard
settings from the Android SDK installation. Android Studio adds the module-specific rules file
-<code>proguard-rules.txt</code> at the root of the module, where you can add custom ProGuard
+<code>proguard-rules.pro</code> at the root of the module, where you can add custom ProGuard
rules.</p>
<h3 id="configureSigning">Configure signing settings</h3>
diff --git a/docs/html/tools/debugging/debugging-memory.jd b/docs/html/tools/debugging/debugging-memory.jd
index ae67b3c..5893ad1 100644
--- a/docs/html/tools/debugging/debugging-memory.jd
+++ b/docs/html/tools/debugging/debugging-memory.jd
@@ -24,63 +24,72 @@ page.tags=memory,OutOfMemoryError
<p>Because Android is designed for mobile devices, you should always be careful about how much
-random-access memory (RAM) your app uses. Although Android’s Dalvik virtual machine performs
-routine garbage collection, this doesn’t mean you can ignore when and where your app allocates and
+random-access memory (RAM) your application uses. Although Dalvik and ART perform
+routine garbage collection (GC), this doesn’t mean you can ignore when and where your application allocates and
releases memory. In order to provide a stable user experience that allows the system to quickly
-switch between apps, it’s important that your app does not needlessly consume memory when the user
+switch between apps, it is important that your application does not needlessly consume memory when the user
is not interacting with it.</p>
<p>Even if you follow all the best practices for <a href="{@docRoot}training/articles/memory.html"
>Managing Your App Memory</a> during
development (which you should), you still might leak objects or introduce other memory bugs. The
-only way to be certain your app is using as little memory as possible is to analyze your app’s
+only way to be certain your application is using as little memory as possible is to analyze your app’s
memory usage with tools. This guide shows you how to do that.</p>
<h2 id="LogMessages">Interpreting Log Messages</h2>
-<p>The simplest place to begin investigating your apps memory usage is the Dalvik log messages. You'll
-find these log messages in <a href="{@docRoot}tools/help/logcat.html">logcat</a> (the output is
-available in the Device Monitor or directly in IDEs such as Eclipse and Android Studio).</p>
+<p>The simplest place to begin investigating your application’s memory usage is the runtime log messages.
+Sometimes when a GC occurs, a message is printed to
+<a href="{@docRoot}tools/help/logcat.html">logcat</a>. The logcat output is also available in the
+Device Monitor or directly in IDEs such as Eclipse and Android Studio.</p>
-<p>Every time a garbage collection occurs, logcat prints a message with the following information:</p>
+<h3 id="DalvikLogMessages">Dalvik Log Messages</h3>
+
+<p>In Dalvik (but not ART), every GC prints the following information to logcat:</p>
<pre class="no-pretty-print">
D/dalvikvm: &lt;GC_Reason> &lt;Amount_freed>, &lt;Heap_stats>, &lt;External_memory_stats>, &lt;Pause_time>
</pre>
+<p>Example:</p>
+
+<pre class="no-pretty-print">
+D/dalvikvm( 9050): GC_CONCURRENT freed 2049K, 65% free 3571K/9991K, external 4703K/5261K, paused 2ms+2ms
+</pre>
+
<dl>
<dt>GC Reason</dt>
<dd>
-What triggered the garbage collection and what kind of collection it is. Reasons that may appear
+What triggered the GC and what kind of collection it is. Reasons that may appear
include:
<dl>
<dt><code>GC_CONCURRENT</code></dt>
-<dd>A concurrent garbage collection that frees up memory as your heap begins to fill up.</dd>
+<dd>A concurrent GC that frees up memory as your heap begins to fill up.</dd>
<dt><code>GC_FOR_MALLOC</code></dt>
-<dd>A garbage collection caused because your app attempted to allocate memory when your heap was
-already full, so the system had to stop your app and reclaim memory.</dd>
+<dd>A GC caused because your application attempted to allocate memory when your heap was
+already full, so the system had to stop your application and reclaim memory.</dd>
<dt><code>GC_HPROF_DUMP_HEAP</code></dt>
-<dd>A garbage collection that occurs when you create an HPROF file to analyze your heap.</dd>
+<dd>A GC that occurs when you request to create an HPROF file to analyze your heap.</dd>
<dt><code>GC_EXPLICIT</code>
-<dd>An explicit garbage collection, such as when you call {@link java.lang.System#gc()} (which you
-should avoid calling and instead trust the garbage collector to run when needed).</dd>
+<dd>An explicit GC, such as when you call {@link java.lang.System#gc()} (which you
+should avoid calling and instead trust the GC to run when needed).</dd>
<dt><code>GC_EXTERNAL_ALLOC</code></dt>
<dd>This happens only on API level 10 and lower (newer versions allocate everything in the Dalvik
-heap). A garbage collection for externally allocated memory (such as the pixel data stored in
+heap). A GC for externally allocated memory (such as the pixel data stored in
native memory or NIO byte buffers).</dd>
</dl>
</dd>
<dt>Amount freed</dt>
-<dd>The amount of memory reclaimed from this garbage collection.</dd>
+<dd>The amount of memory reclaimed from this GC.</dd>
<dt>Heap stats</dt>
-<dd>Percentage free and (number of live objects)/(total heap size).</dd>
+<dd>Percentage free of the heap and (number of live objects)/(total heap size).</dd>
<dt>External memory stats</dt>
<dd>Externally allocated memory on API level 10 and lower (amount of allocated memory) / (limit at
@@ -91,20 +100,141 @@ which collection will occur).</dd>
beginning of the collection and another near the end.</dd>
</dl>
-<p>For example:</p>
+<p>As these log messages accumulate, look out for increases in the heap stats (the
+{@code 3571K/9991K} value in the above example). If this value continues to increase, you may have
+a memory leak.</p>
+
+
+<h3 id="ARTLogMessages">ART Log Messages</h3>
+
+<p>Unlike Dalvik, ART doesn't log messqages for GCs that were not explicity requested. GCs are only
+printed when they are they are deemed slow. More precisely, if the GC pause exceeds than 5ms or
+the GC duration exceeds 100ms. If the application is not in a pause perceptible process state,
+then none of its GCs are deemed slow. Explicit GCs are always logged.</p>
+
+<p>ART includes the following information in its garbage collection log messages:</p>
<pre class="no-pretty-print">
-D/dalvikvm( 9050): GC_CONCURRENT freed 2049K, 65% free 3571K/9991K, external 4703K/5261K, paused 2ms+2ms
+I/art: &lt;GC_Reason> &lt;GC_Name> &lt;Objects_freed>(&lt;Size_freed>) AllocSpace Objects, &lt;Large_objects_freed>(&lt;Large_object_size_freed>) &lt;Heap_stats> LOS objects, &lt;Pause_time(s)>
+</pre>
+
+<p>Example:</p>
+
+<pre class="no-pretty-print">
+I/art : Explicit concurrent mark sweep GC freed 104710(7MB) AllocSpace objects, 21(416KB) LOS objects, 33% free, 25MB/38MB, paused 1.230ms total 67.216ms
</pre>
-<p>As these log messages stack up, look out for increases in the heap stats (the
-{@code 3571K/9991K} value in the above example). If this value
-continues to increase and doesn't ever seem to get smaller, you could have a memory leak.</p>
+<dl>
+<dt>GC Reason</dt>
+<dd>
+What triggered the GC and what kind of collection it is. Reasons that may appear
+include:
+<dl>
+<dt><code>Concurrent</code></dt>
+<dd>A concurrent GC which does not suspend application threads. This GC runs in a background thread
+and does not prevent allocations.</dd>
+
+<dt><code>Alloc</code></dt>
+<dd>The GC was initiated because your application attempted to allocate memory when your heap
+was already full. In this case, the garbage collection occurred in the allocating thread.</dd>
+
+<dt><code>Explicit</code>
+<dd>The garbage collection was explicitly requested by an application, for instance, by
+calling {@link java.lang.System#gc()} or {@link java.lang.Runtime#gc()}. As with Dalvik, in ART it is
+recommended that you trust the GC and avoid requesting explicit GCs if possible. Explicit GCs are
+discouraged since they block the allocating thread and unnecessarily was CPU cycles. Explicit GCs
+could also cause jank if they cause other threads to get preempted.</dd>
+
+<dt><code>NativeAlloc</code></dt>
+<dd>The collection was caused by native memory pressure from native allocations such as Bitmaps or
+RenderScript allocation objects.</dd>
+
+<dt><code>CollectorTransition</code></dt>
+<dd>The collection was caused by a heap transition; this is caused by switching the GC at run time.
+Collector transitions consist of copying all the objects from a free-list backed
+space to a bump pointer space (or visa versa). Currently collector transitions only occur when an
+application changes process states from a pause perceptible state to a non pause perceptible state
+(or visa versa) on low RAM devices.
+</dd>
+
+<dt><code>HomogeneousSpaceCompact</code></dt>
+<dd>Homogeneous space compaction is free-list space to free-list space compaction which usually
+occurs when an application is moved to a pause imperceptible process state. The main reasons for doing
+this are reducing RAM usage and defragmenting the heap.
+</dd>
+
+<dt><code>DisableMovingGc</code></dt>
+<dd>This is not a real GC reason, but a note that collection was blocked due to use of
+GetPrimitiveArrayCritical. while concurrent heap compaction is occuring. In general, the use of
+GetPrimitiveArrayCritical is strongly discouraged due to its restrictions on moving collectors.
+</dd>
+
+<dt><code>HeapTrim</code></dt>
+<dd>This is not a GC reason, but a note that collection was blocked until a heap trim finished.
+</dd>
+
+</dl>
+</dd>
+
+
+<dl>
+<dt>GC Name</dt>
+<dd>
+ART has various different GCs which can get run.
+<dl>
+<dt><code>Concurrent mark sweep (CMS)</code></dt>
+<dd>A whole heap collector which frees collects all spaces other than the image space.</dd>
+
+<dt><code>Concurrent partial mark sweep</code></dt>
+<dd>A mostly whole heap collector which collects all spaces other than the image and zygote spaces.
+</dd>
+
+<dt><code>Concurrent sticky mark sweep</code></dt>
+<dd>A generational collector which can only free objects allocated since the last GC. This garbage
+collection is run more often than a full or partial mark sweep since it is faster and has lower pauses.
+</dd>
+
+<dt><code>Marksweep + semispace</code></dt>
+<dd>A non concurrent, copying GC used for heap transitions as well as homogeneous space
+compaction (to defragement the heap).</dd>
+
+</dl>
+</dd>
+
+<dt>Objects freed</dt>
+<dd>The number of objects which were reclaimed from this GC from the non large
+object space.</dd>
+
+<dt>Size freed</dt>
+<dd>The number of bytes which were reclaimed from this GC from the non large object
+space.</dd>
+
+<dt>Large objects freed</dt>
+<dd>The number of object in the large object space which were reclaimed from this garbage
+collection.</dd>
+
+<dt>Large object size freed</dt>
+<dd>The number of bytes in the large object space which were reclaimed from this garbage
+collection.</dd>
+
+<dt>Heap stats</dt>
+<dd>Percentage free and (number of live objects)/(total heap size).</dd>
+<dt>Pause times</dt>
+<dd>In general pause times are proportional to the number of object references which were modified
+while the GC was running. Currently, the ART CMS GCs only has one pause, near the end of the GC.
+The moving GCs have a long pause which lasts for the majority of the GC duration.</dd>
+</dl>
+
+<p>If you are seeing a large amount of GCs in logcat, look for increases in the heap stats (the
+{@code 25MB/38MB} value in the above example). If this value continues to increase and doesn't
+ever seem to get smaller, you could have a memory leak. Alternatively, if you are seeing GC which
+are for the reason "Alloc", then you are already operating near your heap capacity and can expect
+OOM exceptios in the near future. </p>
<h2 id="ViewHeap">Viewing Heap Updates</h2>
-<p>To get a little information about what kind of memory your app is using and when, you can view
+<p>To get a little information about what kind of memory your application is using and when, you can view
real-time updates to your app's heap in the Device Monitor:</p>
<ol>
@@ -117,15 +247,15 @@ real-time updates to your app's heap in the Device Monitor:</p>
</ol>
<p>The Heap view shows some basic stats about your heap memory usage, updated after every
-garbage collection. To see the first update, click the <strong>Cause GC</strong> button.</p>
+GC. To see the first update, click the <strong>Cause GC</strong> button.</p>
<img src="{@docRoot}images/tools/monitor-vmheap@2x.png" width="760" alt="" />
<p class="img-caption"><strong>Figure 1.</strong> The Device Monitor tool,
showing the <strong>[1] Update Heap</strong> and <strong>[2] Cause GC</strong> buttons.
The Heap tab on the right shows the heap results.</p>
-<p>Continue interacting with your app to watch your heap allocation update with each garbage
-collection. This can help you identify which actions in your app are likely causing too much
+<p>Continue interacting with your application to watch your heap allocation update with each garbage
+collection. This can help you identify which actions in your application are likely causing too much
allocation and where you should try to reduce allocations and release
resources.</p>
@@ -136,9 +266,9 @@ resources.</p>
<p>As you start narrowing down memory issues, you should also use the Allocation Tracker to
get a better understanding of where your memory-hogging objects are allocated. The Allocation
Tracker can be useful not only for looking at specific uses of memory, but also to analyze critical
-code paths in an app such as scrolling.</p>
+code paths in an application such as scrolling.</p>
-<p>For example, tracking allocations when flinging a list in your app allows you to see all the
+<p>For example, tracking allocations when flinging a list in your application allows you to see all the
allocations that need to be done for that behavior, what thread they are on, and where they came
from. This is extremely valuable for tightening up these paths to reduce the work they need and
improve the overall smoothness of the UI.</p>
@@ -151,7 +281,7 @@ improve the overall smoothness of the UI.</p>
<li>In the DDMS window, select your app's process in the left-side panel.</li>
<li>In the right-side panel, select the <strong>Allocation Tracker</strong> tab.</li>
<li>Click <strong>Start Tracking</strong>.</li>
-<li>Interact with your app to execute the code paths you want to analyze.</li>
+<li>Interact with your application to execute the code paths you want to analyze.</li>
<li>Click <strong>Get Allocations</strong> every time you want to update the
list of allocations.</li>
</ol>
@@ -163,7 +293,7 @@ thread, in which class, in which file and at which line.</p>
<img src="{@docRoot}images/tools/monitor-tracker@2x.png" width="760" alt="" />
<p class="img-caption"><strong>Figure 2.</strong> The Device Monitor tool,
-showing recent app allocations and stack traces in the Allocation Tracker.</p>
+showing recent application allocations and stack traces in the Allocation Tracker.</p>
<p class="note"><strong>Note:</strong> You will always see some allocations from {@code
@@ -186,9 +316,11 @@ divided between different types of RAM allocation with the
following <a href="{@docRoot}tools/help/adb.html">adb</a> command:</p>
<pre class="no-pretty-print">
-adb shell dumpsys meminfo &lt;package_name>
+adb shell dumpsys meminfo &lt;package_name|pid> [-d]
</pre>
+<p>The -d flag prints more info related to Dalvik and ART memory usage.</p>
+
<p>The output lists all of your app's current allocations, measured in kilobytes.</p>
<p>When inspecting this information, you should be familiar with the
@@ -218,13 +350,57 @@ actual RAM weight of a process and for comparison against the RAM use of other p
total available RAM.</p>
-<p>For example, below is the the output for Gmail’s process on a tablet device. There is a lot of
+<p>For example, below is the the output for Map’s process on a Nexus 5 device. There is a lot of
information here, but key points for discussion are listed below.</p>
+<code>adb shell dumpsys meminfo com.google.android.apps.maps -d</code>
<p class="note"><strong>Note:</strong> The information you see may vary slightly from what is shown
here, as some details of the output differ across platform versions.</p>
<pre class="no-pretty-print">
+** MEMINFO in pid 18227 [com.google.android.apps.maps] **
+ Pss Private Private Swapped Heap Heap Heap
+ Total Dirty Clean Dirty Size Alloc Free
+ ------ ------ ------ ------ ------ ------ ------
+ Native Heap 10468 10408 0 0 20480 14462 6017
+ Dalvik Heap 34340 33816 0 0 62436 53883 8553
+ Dalvik Other 972 972 0 0
+ Stack 1144 1144 0 0
+ Gfx dev 35300 35300 0 0
+ Other dev 5 0 4 0
+ .so mmap 1943 504 188 0
+ .apk mmap 598 0 136 0
+ .ttf mmap 134 0 68 0
+ .dex mmap 3908 0 3904 0
+ .oat mmap 1344 0 56 0
+ .art mmap 2037 1784 28 0
+ Other mmap 30 4 0 0
+ EGL mtrack 73072 73072 0 0
+ GL mtrack 51044 51044 0 0
+ Unknown 185 184 0 0
+ TOTAL 216524 208232 4384 0 82916 68345 14570
+
+ Dalvik Details
+ .Heap 6568 6568 0 0
+ .LOS 24771 24404 0 0
+ .GC 500 500 0 0
+ .JITCache 428 428 0 0
+ .Zygote 1093 936 0 0
+ .NonMoving 1908 1908 0 0
+ .IndirectRef 44 44 0 0
+
+ Objects
+ Views: 90 ViewRootImpl: 1
+ AppContexts: 4 Activities: 1
+ Assets: 2 AssetManagers: 2
+ Local Binders: 21 Proxy Binders: 28
+ Parcel memory: 18 Parcel count: 74
+ Death Recipients: 2 OpenSSL Sockets: 2
+</pre>
+
+<p>Here is an older dumpsys on Dalvik of the gmail app:</p>
+
+<pre class="no-pretty-print">
** MEMINFO in pid 9953 [com.google.android.gm] **
Pss Pss Shared Private Shared Private Heap Heap Heap
Total Clean Dirty Dirty Clean Clean Size Alloc Free
@@ -272,7 +448,7 @@ app’s process from Zygote.
<p class="note"><strong>Note:</strong> On newer platform versions that have the <code>Dalvik
Other</code> section, the <code>Pss Total</code> and <code>Private Dirty</code> numbers for Dalvik Heap do
-not include Dalvik overhead such as the just-in-time compilation (JIT) and garbage collection (GC)
+not include Dalvik overhead such as the just-in-time compilation (JIT) and GC
bookkeeping, whereas older versions list it all combined under <code>Dalvik</code>.</p>
<p>The <code>Heap Alloc</code> is the amount of memory that the Dalvik and native heap allocators keep
@@ -282,12 +458,62 @@ with all the others.</p>
</dd>
<dt><code>.so mmap</code> and <code>.dex mmap</code></dt>
-<dd>The RAM being used for mmapped <code>.so</code> (native) and <code>.dex</code> (Dalvik) code. The
-<code>Pss Total</code> number includes platform code shared across apps; the <code>Private Clean</code> is
-your app’s own code. Generally, the actual mapped size will be much larger—the RAM here is only
-what currently needs to be in RAM for code that has been executed by the app. However, the .so mmap
-has a large private dirty, which is due to fix-ups to the native code when it was loaded into its
-final address.
+<dd>The RAM being used for mmapped <code>.so</code> (native) and <code>.dex</code> (Dalvik or ART)
+code. The <code>Pss Total</code> number includes platform code shared across apps; the
+<code>Private Clean</code> is your app’s own code. Generally, the actual mapped size will be much
+larger—the RAM here is only what currently needs to be in RAM for code that has been executed by
+the app. However, the .so mmap has a large private dirty, which is due to fix-ups to the native
+code when it was loaded into its final address.
+</dd>
+
+<dt><code>.oat mmap</code></dt>
+<dd>This is the amount of RAM used by the code image which is based off of the preloaded classes
+which are commonly used by multiple apps. This image is shared across all apps and is unaffected
+by particular apps.
+</dd>
+
+<dt><code>.art mmap</code></dt>
+<dd>This is the amount of RAM used by the heap image which is based off of the preloaded classes
+which are commonly used by multiple apps. This image is shared across all apps and is unaffected
+by particular apps. Even though the ART image contains {@link java.lang.Object} instances, it does not
+count towards your heap size.
+</dd>
+
+<dt><code>.Heap</code> (only with -d flag)</dt>
+<dd>This is the amount of heap memory for your app. This excludes objects in the image and large
+object spaces, but includes the zygote space and non-moving space.
+</dd>
+
+<dt><code>.LOS</code> (only with -d flag)</dt>
+<dd>This is the amount of RAM used by the ART large object space. This includes zygote large
+objects. Large objects are all primitive array allocations larger than 12KB.
+</dd>
+
+<dt><code>.GC</code> (only with -d flag)</dt>
+<dd>This is the amount of internal GC accounting overhead for your app. There is not really any way
+to reduce this overhead.
+</dd>
+
+<dt><code>.JITCache</code> (only with -d flag)</dt>
+<dd>This is the amount of memory used by the JIT data and code caches. Typically, this is zero
+since all of the apps will be compiled at installed time.
+</dd>
+
+<dt><code>.Zygote</code> (only with -d flag)</dt>
+<dd>This is the amount of memory used by the zygote space. The zygote space is created during
+device startup and is never allocated into.
+</dd>
+
+<dt><code>.NonMoving</code> (only with -d flag)</dt>
+<dd>This is the amount of RAM used by the ART non-moving space. The non-moving space contains
+special non-movable objects such as fields and methods. You can reduce this section by using fewer
+fields and methods in your app.
+</dd>
+
+<dt><code>.IndirectRef</code> (only with -d flag)</dt>
+<dd>This is the amount of RAM used by the ART indirect reference tables. Usually this amount is
+small, but if it is too high, it may be possible to reduce it by reducing the number of local and
+global JNI references used.
</dd>
<dt><code>Unknown</code></dt>
@@ -318,7 +544,7 @@ window, so this can help you identify memory leaks involving dialogs or other wi
</dd>
<dt><code>AppContexts</code> and <code>Activities</code></dt>
-<dd>The number of app {@link android.content.Context} and {@link android.app.Activity} objects that
+<dd>The number of application {@link android.content.Context} and {@link android.app.Activity} objects that
currently live in your process. This can be useful to quickly identify leaked {@link
android.app.Activity} objects that can’t be garbage collected due to static references on them,
which is common. These objects often have a lot of other allocations associated with them and so
@@ -327,7 +553,7 @@ are a good way to track large memory leaks.</dd>
<p class="note"><strong>Note:</strong> A {@link android.view.View} or {@link
android.graphics.drawable.Drawable} object also holds a reference to the {@link
android.app.Activity} that it's from, so holding a {@link android.view.View} or {@link
-android.graphics.drawable.Drawable} object can also lead to your app leaking an {@link
+android.graphics.drawable.Drawable} object can also lead to your application leaking an {@link
android.app.Activity}.</p>
</dd>
@@ -363,13 +589,13 @@ then click <strong>Save</strong>.</li>
showing the <strong>[1] Dump HPROF file</strong> button.</p>
<p>If you need to be more precise about when the dump is created, you can also create a heap dump
-at the critical point in your app code by calling {@link android.os.Debug#dumpHprofData
+at the critical point in your application code by calling {@link android.os.Debug#dumpHprofData
dumpHprofData()}.</p>
<p>The heap dump is provided in a format that's similar to, but not identical to one from the Java
HPROF tool. The major difference in an Android heap dump is due to the fact that there are a large
number of allocations in the Zygote process. But because the Zygote allocations are shared across
-all app processes, they don’t matter very much to your own heap analysis.</p>
+all application processes, they don’t matter very much to your own heap analysis.</p>
<p>To analyze your heap dump, you can use a standard tool like jhat or the <a href=
"http://www.eclipse.org/mat/downloads.php">Eclipse Memory Analyzer Tool</a> (MAT). However, first
@@ -434,7 +660,7 @@ showing what your largest objects are. Below this chart, are links to couple of
<p class="note"><strong>Note:</strong> Most apps will show an instance of
{@link android.content.res.Resources} near the top with a good chunk of heap, but this is
- usually expected when your app uses lots of resources from your {@code res/} directory.</p>
+ usually expected when your application uses lots of resources from your {@code res/} directory.</p>
</li>
</ul>
@@ -473,19 +699,19 @@ to inspect the changes in memory allocation. To compare two heap dumps using MAT
<h2 id="TriggerLeaks">Triggering Memory Leaks</h2>
-<p>While using the tools described above, you should aggressively stress your app code and try
-forcing memory leaks. One way to provoke memory leaks in your app is to let it
+<p>While using the tools described above, you should aggressively stress your application code and try
+forcing memory leaks. One way to provoke memory leaks in your application is to let it
run for a while before inspecting the heap. Leaks will trickle up to the top of the allocations in
-the heap. However, the smaller the leak, the longer you need to run the app in order to see it.</p>
+the heap. However, the smaller the leak, the longer you need to run the application in order to see it.</p>
<p>You can also trigger a memory leak in one of the following ways:</p>
<ol>
<li>Rotate the device from portrait to landscape and back again multiple times while in different
-activity states. Rotating the device can often cause an app to leak an {@link android.app.Activity},
+activity states. Rotating the device can often cause an application to leak an {@link android.app.Activity},
{@link android.content.Context}, or {@link android.view.View} object because the system
-recreates the {@link android.app.Activity} and if your app holds a reference
+recreates the {@link android.app.Activity} and if your application holds a reference
to one of those objects somewhere else, the system can't garbage collect it.</li>
-<li>Switch between your app and another app while in different activity states (navigate to
+<li>Switch between your application and another application while in different activity states (navigate to
the Home screen, then return to your app).</li>
</ol>
diff --git a/docs/html/tools/debugging/debugging-ui.jd b/docs/html/tools/debugging/debugging-ui.jd
index f927d08..cf7e3ba 100644
--- a/docs/html/tools/debugging/debugging-ui.jd
+++ b/docs/html/tools/debugging/debugging-ui.jd
@@ -34,17 +34,17 @@ parent.link=index.html
<h2>Related videos</h2>
<ol>
<li>
-<iframe title="Hierarchyviewer"
- width="210" height="160"
- src="//www.youtube.com/embed/PAgE7saQUUY?rel=0&amp;hd=1"
+<iframe title="Hierarchyviewer"
+ width="210" height="160"
+ src="//www.youtube.com/embed/PAgE7saQUUY?rel=0&amp;hd=1"
frameborder="0" allowfullscreen>
</iframe>
</li>
<li>
-<iframe title="Pixel Perfect"
- width="210" height="160"
- src="//www.youtube.com/embed/C45bMZGdN7Y?rel=0&amp;hd=1"
- frameborder="0"
+<iframe title="Pixel Perfect"
+ width="210" height="160"
+ src="//www.youtube.com/embed/C45bMZGdN7Y?rel=0&amp;hd=1"
+ frameborder="0"
allowfullscreen>
</iframe>
</li>
@@ -52,11 +52,10 @@ parent.link=index.html
</div>
</div>
- <p>
-Sometimes your application's layout can slow down your application.
- To help debug issues in your layout, the Android SDK provides the Hierarchy Viewer and
- <code>lint</code> tools.
- </p>
+
+<p>Sometimes your application's layout can slow down your application.
+To help debug issues in your layout, the Android SDK provides the Hierarchy Viewer and
+<code><a href="{@docRoot}tools/help/lint.html">lint</a></code> tools. </p>
<p>The Hierarchy Viewer application allows you to debug and optimize your user interface. It
provides a visual representation of the layout's View hierarchy (the View Hierarchy window)
@@ -64,8 +63,10 @@ Sometimes your application's layout can slow down your application.
and a magnified view of the display (the Pixel Perfect window) to closely examine the pixels
in your layout.</p>
- <p>Android <code>lint</code> is a static code scanning tool that helps you optimize the layouts and layout
- hierarchies of your applications, as well as detect other common coding problems. You can run it against your layout files or resource
+ <p>Android <code><a href="{@docRoot}tools/help/lint.html">lint</a></code> is a static code
+ scanning tool that helps you optimize the layouts and layout
+ hierarchies of your applications, as well as detect other common coding problems. You can run it
+ against your layout files or resource
directories to quickly check for inefficiencies or other types of problems that could be
affecting the performance of your application.</p>
@@ -493,7 +494,10 @@ Sometimes your application's layout can slow down your application.
alt=""
height="600"/>
<p class="img-caption"><strong>Figure 4.</strong> The Pixel Perfect window</p>
+
+
<h2 id="lint">Using lint to Optimize Your UI</h2>
-<p>The Android {@code lint} tool lets you analyze the XML files that define your application's UI to find inefficiencies in the view hierarchy.</p>
-<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>The Android <a href="{@docRoot}tools/help/lint.html">lint</a> tool lets you analyze the XML
+files that define your application's UI to find inefficiencies in the view hierarchy.</p>
+<p class="note"><strong>Note: </strong>The Android <code>layoutopt</code> tool has been replaced by the {@code lint} tool beginning in 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 tools help</a>.</p>
diff --git a/docs/html/tools/debugging/improving-w-lint.jd b/docs/html/tools/debugging/improving-w-lint.jd
index 7e238fa..ff94b7f 100644
--- a/docs/html/tools/debugging/improving-w-lint.jd
+++ b/docs/html/tools/debugging/improving-w-lint.jd
@@ -9,11 +9,11 @@ parent.link=index.html
<ol>
<li><a href="#overview">Overview</a></li>
- <li><a href=#eclipse">Running lint from Eclipse</a></li>
+ <li><a href=#studio">Running lint from Android Studio</a></li>
<li><a href=#commandline">Running lint from the command-line</a></li>
<li><a href=#config">Configuring lint</a>
<ol>
- <LI><a href="#eclipse_config">Configuring lint in Eclipse</a></LI>
+ <LI><a href="#studio_config">Configuring lint in Android Studio</a></LI>
<LI><a href="#pref">Configuring the lint file</a></LI>
<LI><a href="#src">Configuring lint checking in Java and XML source files</a></LI>
</ol>
@@ -31,8 +31,15 @@ parent.link=index.html
In addition to testing that your Android application meets its functional requirements, it's important to ensure that your code has no structural problems. Poorly structured code can impact the reliability and efficiency of your Android apps and make your code harder to maintain. For example, if your XML resource files contain unused namespaces, this takes up space and incurs unnecessary processing. Other structural issues, such as use of deprecated elements or API calls that are not supported by the target API versions, might lead to code failing to run correctly.</p>
<h2 id="overview">Overview</h2>
-<p>The Android SDK provides a code scanning tool called {@code lint} that can help you to easily identify and correct problems with the structural quality of your code, without having to execute the app or write any test cases. Each problem detected by the tool is reported with a description message and a severity level, so that you can quickly prioritize the critical improvements that need to be made. You can also configure a problem's severity level to ignore issues that are not relevant for your project, or raise the severity level. The tool has a command-line interface, so you can easily integrate it into your automated testing process.</p>
-<p>The {@code lint} tool checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization. You can run {@code lint} from the command-line or from the Eclipse environment.</p>
+<p>The Android SDK provides a code scanning tool called <a href="{@docRoot}tools/help/lint.html"><code>lint</code></a>
+that can help you to easily identify and correct problems with the structural quality of your code, without having to execute the app or write any test cases. Each problem detected by the tool is reported with a description message and a severity level, so that you can quickly prioritize the critical improvements that need to be made. You can also configure a problem's severity level to ignore issues that are not relevant for your project, or raise the severity level. The tool has a command-line interface, so you can easily integrate it into your automated testing process.</p>
+<p>The {@code lint} tool checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization. You can run {@code lint} from the command-line or from Android Studio.</p>
+
+<p class="note"><strong>Note:</strong> In Android Studio, additional
+<a href="https://www.jetbrains.com/idea/help/inspection-basics.html?search=inspection" class="external-link"
+target="_blank">IntelliJ code inspections</a> run when your code is compiled in Android Studio to
+streamline code review.</p>
+
<p>Figure 1 shows how the {@code lint} tool processes the application source files.</p>
<img id="Fig1" src="{@docRoot}images/tools/lint.png" alt="">
<p class="img-caption"><strong>Figure 1.</strong> Code scanning workflow with the {@code lint} tool</p>
@@ -42,25 +49,51 @@ In addition to testing that your Android application meets its functional requir
<dt><b>The <code>lint.xml</code> file</b></dt>
<dd>A configuration file that you can use to specify any {@code lint} checks that you want to exclude and to customize problem severity levels.</dd>
<dt><b>The {@code lint} tool</b></dt>
-<dd>A static code scanning tool that you can run on your Android project from the command-line or from Eclipse. The {@code lint} tool checks for structural code problems that could affect the quality and performance of your Android application. It is strongly recommended that you correct any errors that {@code lint} detects before publishing your application.</dd>
+<dd>A static code scanning tool that you can run on your Android project from the command-line or Android Studio. The {@code lint} tool checks for structural code problems that could affect the quality and performance of your Android application. It is strongly recommended that you correct any errors that {@code lint} detects before publishing your application.</dd>
<dt><b>Results of {@code lint} checking</b></dt>
-<dd>You can view the results from {@code lint} in the console or in the <strong>Lint Warnings</strong> view in Eclipse. Each issue is identified by the location in the source files where it occurred and a description of the issue.</dd>
+<dd>You can view the results from {@code lint} in the console or in the <strong>Event Log</strong> in Android Studio. Each issue is identified by the location in the source files where it occurred and a description of the issue.</dd>
</dl>
-<p>The {@code lint} tool is automatically installed as part of the Android SDK Tools revision 16 or higher. If you want to use {@code lint} in the Eclipse environment, you must also install the Android Development Tools (ADT) Plugin for Eclipse revision 16 or higher. For more information about installing the SDK or the ADT Plugin for Eclipse, see <a href="http://developer.android.com/sdk/installing.html">Installing the SDK.</a></p>
+<p>The {@code lint} tool is automatically installed as part of the Android SDK Tools revision 16 or higher.</p>
+
+
+<h2 id="studio">Running lint in Android Studio</h2>
+<p>In Android Studio, the configured <code>lint</code> and
+IDE inspections run automatically whenever you build your app. The IDE inspections are
+configured along with the {@code lint} checks to run
+<a href="https://www.jetbrains.com/idea/help/inspection-basics.html?search=inspection" class="external-link"
+target="_blank">IntelliJ code inspections</a> to streamline code review.</p>
+
+<p class="note"><strong>Note:</strong> To view and modify inspection severity
+levels, use the <strong>File &gt; Settings &gt; Project Settings</strong> menu to open the
+<em>Inspection Configuration</em> page with a list of the supported inspections.</p>
+
+
+<p>With Android Studio, you can also run {@code lint} inspections for a specific build variant,
+or for all build variants from the <code>build.gradle</code> file. Add the
+<code>lintOptions</code> property to the <code>android</code> settings in the build file.
+This code snippet from a Gradle build file shows how to set the <code>quiet</code> option to
+<code>true</code> and the <code>abortOnError</code> option to <code>false</code>. </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>To manually run inspections in Android Studio, from the application or right-click menu,
+choose <strong>Analyze &gt; Inspect Code</strong>. The <em>Specify Inspections Scope</em> dialog
+appears so you can specify the desired inspection scope and profile.</p>
+
-<h2 id="eclipse">Running lint from Eclipse</h2>
-<p>If the ADT Plugin is installed in your Eclipse environment, the {@code lint} tool runs automatically when you perform one of these actions:</p>
-<ul>
-<LI>Export an APK</LI>
-<LI>Edit and save an XML source file in your Android project (such as a manifest or layout file)</LI>
-<LI>Use the layout editor in Eclipse to make changes</LI>
-</ul>
-<p>Note that when you export an APK, {@code lint} only runs an automatic check for fatal errors and aborts the export if fatal errors are found. You can turn off this automatic checking from the <strong>Lint Error Checking</strong> page in Eclipse Preferences. </p>
-<p>The output is displayed in the <strong>Lint Warnings</strong> view. If the <strong>Lint Warnings</strong> view is not showing in the workbench, you can bring it up from the Eclipse menu by clicking <strong>Window &gt; Show View &gt; Other &gt; Android &gt; Lint Warnings</strong>.</p>
-<p>Figure 2 shows an example of the output in the Lint Warnings view.</p>
-<img id="Fig2" src="{@docRoot}images/tools/lint_output.png" alt="">
-<p class="img-caption"><strong>Figure 2.</strong> Sample output in the <strong>Lint Warnings</strong> view</p>
-<p>You can also run a {@code lint} scan manually on your Android project in Eclipse by right-clicking on the project folder in the Package Explorer > <strong>Android Tools &gt; Run Lint: Check for Common Errors</strong>.</p>
<h2 id="commandline">Running lint from the Command-Line</h2>
@@ -96,38 +129,45 @@ res: Warning: Missing density variation folders in res: drawable-xhdpi [IconMiss
<p>By default, when you run a {@code lint} scan, the tool checks for all issues that are supported by {@code lint}. You can also restrict the issues for {@code lint} to check and assign the severity level for those issues. For example, you can disable {@code lint} checking for specific issues that are not relevant to your project and configure {@code lint} to report non-critical issues at a lower severity level.</p>
<p>You can configure {@code lint} checking at different levels:</p>
<ul>
-<LI>Globally, for all projects</LI>
-<li>Per project</li>
-<li>Per file</li>
-<li>Per Java class or method (by using the <code>&#64;SuppressLint</code> annotation), or per XML element (by using the <code>tools:ignore</code> attribute.</li>
+<LI>Globally, for the entire project</LI>
+<li>Per project module</li>
+<li>Per production module</li>
+<li>Per test module</li>
+<li>Per open files</li>
+<li>Per class hierarchy</li>
+<li>Per Version Control System (VCS) scopes</li>
</ul>
-<h3 id="eclipse_config">Configuring lint in Eclipse</h3>
-<p>You can configure global, project-specific, and file-specific settings for {@code lint} from the Eclipse user interface.</p>
+<h3 id="studio_config">Configuring lint in Android Studio</h3>
+<p>Android Studio allows you to enable or disable individual inspections and configure
+project-global, directory-specific, and file-specific settings for {@code lint}.</p>
+
+<p>You can manage inspection profiles and configure inspection severity within Android Studio using
+the <strong>File &gt; Settings &gt; Project Settings</strong> menu to open the <em>Inspections</em>
+page with a list of the supported profiles and inspections.</p>
+<p><img src="{@docRoot}images/tools/studio-inspections-config.png" alt="" /> </p>
+<p class="img-caption"><strong>Figure 3.</strong> Inspection Configuration</p>
<h4>Global preferences</h4>
<ol>
-<LI>Open <strong>Window &gt; Preferences &gt; Android &gt; Lint Error Checking</strong>.</LI>
-<li>Specify your preferences and click <b>OK</b>.</li>
+<li>To specify global project settings, select the project folder in the Project View and choose
+<strong>Analyze &gt; Inspect Code</strong>.</li>
+
+<li>Specify your inspection scope and profile, and click <b>OK</b>.</li>
</ol>
-<p>These settings are applied by default when you run {@code lint} on your Android projects in Eclipse.</p>
+<p>The configured settings run the specified {@code lint} inspections. The {@code lint}
+inspections are also run whenever you build and run your Android project and modules.</p>
-<h4>Project and file-specific preferences</h4>
+<h4>Module and file-specific preferences</h4>
<ol>
-<LI>Run the {@code lint} tool on your project by right-clicking on your project folder in the Package Explorer and selecting <strong>Android Tools &gt; Run Lint: Check for Common Errors</strong>. This action brings up the <strong>Lint Warnings</strong> view which displays a list of issues that {@code lint} detected in your project.</LI>
-<li>From the <strong>Lint Warnings</strong> view, use the toolbar options to configure {@code lint} preferences for individual projects and files in Eclipse. The options you can select include:
-<ul>
-<LI><b>Suppress this error with an annotation/attribute</b> - If the issue appears in a Java class, the {@code lint} tool adds a <code>&#64;SuppressLint</code> annotation to the method where the issue was detected. If the issue appears in an {@code .xml} file, {@code lint} inserts a <code>tools:ignore</code> attribute to disable checking for the {@code lint} issue in this file.</LI>
-<LI><b>Ignore in this file</b> - Disables checking for this {@code lint} issue in this file.</LI>
-<li><b>Ignore in this project</b> - Disables checking for this {@code lint} issue in this project.</li>
-<li><b>Always ignore</b> - Disables checking for this {@code lint} issue globally for all projects.</li>
-</ul>
-</li>
+<LI>Run the {@code lint} tool on your module by right-clicking on your module folder or file in the Project View and selecting <strong>Analyze &gt; Inspect Code</strong>. This displays the {@code lint} inspection results
+with a list of issues that {@code lint} detected in your module.</LI>
+<li>From the <strong>Lint Warnings</strong> view, use the toolbar options to configure {@code lint} preferences for individual modules and files, and set the issue display options.</li>
</ol>
-<p>If you select the second or third option, the {@code lint} tool automatically generates a <code>lint.xml</code> file with these configuration settings in your Android application project folder. </p>
+
<h3 id="pref">Configuring the lint file</h3>
-<p>You can specify your {@code lint} checking preferences in the <code>lint.xml</code> file. If you are creating this file manually, place it in the root directory of your Android project. If you are configuring {@code lint} preferences in Eclipse, the <code>lint.xml</code> file is automatically created and added to your Android project for you.</p>
+<p>You can specify your {@code lint} checking preferences in the <code>lint.xml</code> file. If you are creating this file manually, place it in the root directory of your Android project. If you are configuring {@code lint} preferences in Android Studio, the <code>lint.xml</code> file is automatically created and added to your Android project for you.</p>
<p>The <code>lint.xml</code> file consists of an enclosing <code>&lt;lint&gt;</code> parent tag that contains one or more children <code>&lt;issue&gt;</code> elements. Each <code>&lt;issue&gt;</code> is identified by a unique <code>id</code> attribute value, which is defined by {@code lint}.</p>
<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
@@ -165,12 +205,9 @@ res: Warning: Missing density variation folders in res: drawable-xhdpi [IconMiss
<h3 id="src">Configuring lint checking in Java and XML source files</h3>
<p>You can disable {@code lint} checking from your Java and XML source files.</p>
-<p class="note"><strong>Tip: </strong>If you are using Eclipse, you can use the <strong>Quick Fix</strong> feature to automatically add the annotation or attribute to disable {@code lint} checking to your Java or XML source files:
-<ol>
-<LI>Open the Java or XML file that has a {@code lint} warning or error in an Eclipse editor.</LI>
-<LI>Move your cursor to the location in the file where is {@code lint} issue is found, then press <code>Ctrl+1</code> to bring up the <strong>Quick Fix</strong> pop-up.</LI>
-<li>From the <strong>Quick Fix</strong> pop-up, select the action to add an annotation or attribute to ignore the {@code lint} issue.</li>
-</ol>
+<p class="note"><strong>Tip: </strong>If you are using Android Studio, you can use the
+<strong>File &gt; Settings &gt; Project Settings &gt; Inspections</strong> feature to manage the
+{@code lint} checking to your Java or XML source files.
</p>
<h4>Configuring lint checking in Java</h4>
diff --git a/docs/html/tools/extras/oem-usb.jd b/docs/html/tools/extras/oem-usb.jd
index b25b41e..6d449ee 100644
--- a/docs/html/tools/extras/oem-usb.jd
+++ b/docs/html/tools/extras/oem-usb.jd
@@ -32,12 +32,13 @@ not exhaustive for all available Android-powered devices.</p>
To start developing with your device, read <a
href="{@docRoot}tools/device.html">Using Hardware Devices</a>.</p>
-<p class="note"><strong>Note:</strong> If your device is one of the Android Developer Phones
-(ADP), a Nexus One, or a Nexus S, then you need
-the <a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a>, instead of an OEM driver. The Galaxy
-Nexus driver, however, is distributed by <a
-href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW">Samsung</a>
-(listed as model SCH-I515).</p>
+<p>The Google USB Driver is <strong>required for Windows only</strong> in order to perform
+<a href="{@docRoot}tools/help/adb.html">adb</a> debugging with any of
+the <strong>Google Nexus devices</strong>. The one exception is the
+Galaxy Nexus: the driver for Galaxy Nexus is distributed by <a
+href="http://www.samsung.com/us/support/owners/product/GT-I9250TSGGEN">Samsung</a>
+(listed as model GT-I9250TSGGEN).</p>
+
<h2 id="InstallingDriver">Installing a USB Driver</h2>
@@ -99,7 +100,7 @@ driver:</p>
<li>Select <strong>Device Manager</strong> in the left pane of the Computer Management
window.</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
+ <li>Right-click on <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
@@ -145,14 +146,14 @@ driver:</p>
and select <strong>Manage</strong>.</li>
<li>Select <strong>Device Manager</strong> in the left pane.</li>
<li>Locate and expand <em>ADB Interface</em> in the right pane.</li>
- <li>Right-click on <em>HTC Dream Composite ADB Interface</em>, and select <strong>Update
+ <li>Right-click on <em>Android Composite ADB Interface</em>, and select <strong>Update
Driver Software</strong>.</li>
<li>When Vista starts updating the driver, a prompt will ask how you want to
search for the driver
software. Select <strong>Browse my computer for driver software</strong>.</li>
<li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
Driver is located in {@code &lt;sdk&gt;\extras\google\usb_driver\}.) As long as you specified the
-exact location of the
+exact location of the
installation package, you may leave <strong>Include subfolders</strong> checked or
unchecked&mdash;it doesn't matter.</li>
<li>Click <strong>Next</strong>. Vista might prompt you to confirm the privilege elevation
@@ -164,13 +165,6 @@ exact location of the
<h2 id="Drivers">OEM Drivers</h2>
-<p class="note"><strong>Note:</strong> If your device is one of the Android Developer Phones
-(purchased from the Google Play Developer Console), a Nexus One, or a Nexus S, then you need
-the <a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a>, instead of an OEM driver. The Galaxy
-Nexus driver, however, is distributed by <a
-href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW">Samsung</a>
-(listed as model SCH-I515).</p>
-
<table><tr>
<th>OEM</th>
diff --git a/docs/html/tools/help/adb.jd b/docs/html/tools/help/adb.jd
index e2dd196..41c6686 100644
--- a/docs/html/tools/help/adb.jd
+++ b/docs/html/tools/help/adb.jd
@@ -962,7 +962,6 @@ install [options] &lt;PATH>
</code></td>
<td>Installs a package (specified by {@code &lt;PATH>}) to the system. <p>Options:
<ul>
- <li>{@code -l}: Install the package with forward lock.
<li>{@code -r}: Reinstall an exisiting app, keeping its data.
<li>{@code -t}: Allow test APKs to be installed.
<li>{@code -i &lt;INSTALLER_PACKAGE_NAME>}: Specify the installer package name.
diff --git a/docs/html/tools/help/android.jd b/docs/html/tools/help/android.jd
index 19891e8..0d7d2aa 100644
--- a/docs/html/tools/help/android.jd
+++ b/docs/html/tools/help/android.jd
@@ -6,25 +6,26 @@ parent.link=index.html
<p>{@code android} is an important development tool that lets you:</p>
<ul>
- <li>Create, delete, and view Android Virtual Devices (AVDs). See <a href=
- "{@docRoot}tools/devices/managing-avds-cmdline.html">Managing AVDs from the Command
-Line</a>.</li>
+ <li>Create, delete, and view Android Virtual Devices (AVDs). See <a href=
+ "{@docRoot}tools/devices/managing-avds-cmdline.html">Managing AVDs from the Command Line</a>.</li>
- <li>Create and update Android projects. See <a href=
+ <li>Create and update Android projects. See <a href=
"{@docRoot}tools/projects/projects-cmdline.html">Managing Projects from
the Command Line</a>.</li>
- <li>Update your Android SDK with new platforms, add-ons, and documentation. See <a href=
- "{@docRoot}sdk/exploring.html">Exploring the SDK</a>.</li>
- </ul>If you are using Eclipse, the <code>android</code> tool's features are integrated
- into ADT, so you should not need to use this tool directly.
-
+ <li>Update your Android SDK with new platforms, add-ons, and documentation. See <a href=
+ "{@docRoot}tools/help/sdk-manager.html">SDK Manager</a>.</li>
+ </ul>
+
+<p>If you are using Android Studio or Eclipse, the <code>android</code> tool's features are
+integrated into the IDE, so you should not need to use this tool directly. </p>
+
<p class="note"><strong>Note:</strong> The documentation of options below is not exhaustive
and may be out of date. For the most current list of options, execute <code>android
--help</code>.</p>
-
-
-
+
+
+
<h2>Syntax</h2>
<pre>android [global options] action [action options]</pre>
diff --git a/docs/html/tools/help/draw9patch.jd b/docs/html/tools/help/draw9patch.jd
index 859b1cf..7c26441 100644
--- a/docs/html/tools/help/draw9patch.jd
+++ b/docs/html/tools/help/draw9patch.jd
@@ -2,42 +2,50 @@ page.title=Draw 9-patch
page.tags=NinePatch
@jd:body
-<p>The Draw 9-patch tool allows you to easily create a
- {@link android.graphics.NinePatch} graphic using a WYSIWYG editor.</p>
-<p>For an introduction to Nine-patch graphics and how they work, please read
-the section about Nine-patch in the
-<a href="{@docRoot}guide/topics/graphics/2d-graphics.html#nine-patch">2D Graphics</a>
+<p>The Draw 9-patch tool is a WYSIWYG editor that allows you to create bitmap images that
+automatically resize to accommodate the contents of the view and the size of the screen. Selected
+parts of the image are scaled horizontally or vertically based indicators drawn within the image. </p>
+<p>For an introduction to NinePatch graphics and how they work, please read
+the section about NinePatch Drawables in the
+<a href="{@docRoot}guide/topics/graphics/2d-graphics.html#nine-patch">Canvas and Drawables</a>
document.</p>
<img src="{@docRoot}images/draw9patch-norm.png" style="float:right" alt="" height="300" width="341"
/>
-<p>Here's a quick guide to create a Nine-patch graphic using the Draw 9-patch tool.
-You'll need the PNG image with which you'd like to create a NinePatch.</p>
+<p>Here's a quick guide to create a NinePatch graphic using the Draw 9-patch tool.
+You'll need the PNG image with which you'd like to create a NinePatch image.</p>
<ol>
- <li>From a terminal, launch the <code>draw9patch</code> application from your SDK
- <code>/tools</code> directory.
+ <li>From a terminal, run the <code>draw9patch</code> command from your SDK
+ <code>sdk/tools</code> directory to launch the Draw 9-patch tool.
</li>
- <li>Drag your PNG image into the Draw 9-patch window
+ <li>Drag your PNG image into the Draw 9-patch window
(or <strong>File</strong> > <strong>Open 9-patch...</strong> to locate the file).
Your workspace will now open.
<p>The left pane is your drawing area, in which you can edit the lines for the
- stretchable patches and content area. The right
+ stretchable patches and content area. The right
pane is the preview area, where you can preview your graphic when stretched.</p>
</li>
- <li>Click within the 1-pixel perimeter to draw the lines that define the stretchable
- patches and (optional) content area. Right-click (or hold Shift and click, on Mac) to erase
+ <li>Click within the 1-pixel perimeter to draw the lines that define the stretchable
+ patches and (optional) content area. Right-click (or hold Shift and click, on Mac) to erase
previously drawn lines.
</li>
<li>When done, select <strong>File</strong> > <strong>Save 9-patch...</strong>
<p>Your image will be saved with the <code>.9.png</code> file name.</p>
</li>
</ol>
- <p class="note"><strong>Note:</strong> A normal PNG file (<code>*.png</code>) will be
- loaded with an empty one-pixel border added around the image, in which you can draw
+
+ <p>To make sure that your NinePatch graphics scale down properly, verify that any
+ stretchable regions are at least 2x2 pixels in size.
+ Otherwise, they may disappear when scaled down. Also, provide one pixel of extra safe space in
+ the graphics before and after stretchable regions to avoid interpolation during scaling that may
+ cause the color at the boundaries to change. </p>
+
+ <p class="note"><strong>Note:</strong> A normal PNG file (<code>*.png</code>) will be
+ loaded with an empty one-pixel border added around the image, in which you can draw
the stretchable patches and content area.
- A previously saved 9-patch file (<code>*.9.png</code>) will be loaded as-is,
+ A previously saved NinePatch file (<code>*.9.png</code>) will be loaded as-is,
with no drawing area added, because it already exists.</p>
<img src="{@docRoot}images/draw9patch-bad.png" style="float:right;clear:both" alt="" height="300" width="341"
diff --git a/docs/html/tools/help/index.jd b/docs/html/tools/help/index.jd
index 75324b7..4c97d0c 100644
--- a/docs/html/tools/help/index.jd
+++ b/docs/html/tools/help/index.jd
@@ -70,11 +70,6 @@ avd</code>) the emulator (<code>emulator</code>), and the Dalvik Debug Monitor S
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>
@@ -95,25 +90,6 @@ with Traceview and dmtracedump</a></dd>
<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="{@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.
- <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="{@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>
diff --git a/docs/html/tools/help/lint.jd b/docs/html/tools/help/lint.jd
index ba31f6d..0f52689 100644
--- a/docs/html/tools/help/lint.jd
+++ b/docs/html/tools/help/lint.jd
@@ -14,14 +14,23 @@ parent.link=index.html
</div>
</div>
-<p>The Android {@code lint} tool is a static code analysis tool that checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization. </p>
-<p>For more information on running {@code lint}, see <a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with lint</a>.</p>
+<p>The Android {@code lint} tool is a static code analysis tool that checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization.</p>
-<h2 id="syntax">Syntax</h2>
+<p>In Android Studio, the configured <code>lint</code> and other IDE inspections run automatically
+whenever you compile your program. You can also manually run inspections in Android Studio
+by selecting <strong>Analyze &gt; Inspect Code</strong> from the application or right-click menu.
+The <em>Specify Inspections Scope</em> dialog appears so you can specify the desired inspection
+profile and scope.</p>
+
+<p>For more information on enabling {@code lint} inspections and running {@code lint},
+see <a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with lint</a>.</p>
+
+<h2 id="syntax">Command Line Syntax</h2>
<p>
<pre>lint [flags] &lt;project directory&gt;</pre>
-For example, you can issue the following command to scan the Java and XML files under the {@code myproject} directory and its subdirectories. The result is displayed on the console.
+For example, you can issue the following command to scan the Java and XML files under the
+{@code myproject} directory and its subdirectories. The result is displayed on the console.
<pre>lint myproject</pre>
You can also use {@code lint} to check for a specific issue. For example, you can run the following command to scan the files under the {@code myproject} directory and its subdirectories to check for XML attributes missing the Android namespace prefix. The issue ID {@code MissingPrefix} tells lint to only scan for this issue.
@@ -172,7 +181,11 @@ You can create an HTML report for the issues that {@code lint} detects. For exam
<h2 id="config_keywords">Configuring Java and XML Source Files</h2>
<p>To configure lint checking, you can apply the following annotation or attribute to the source files in your Android project. </p>
<ul>
-<LI>To disable lint checking for a specific Java class or method, use the <code>@SuppressLint</code> annotation. </LI>
-<li>To disable lint checking for specific sections of your XML file, use the <code>tools:ignore</code> attribute. </li>
+<LI>To disable {@code lint} checking for a specific Java class or method, use the <code>@SuppressLint</code>
+annotation. </LI>
+<li>To disable {@code lint} checking for specific sections of your XML file, use the
+<code>tools:ignore</code> attribute. </li>
</ul>
-<p>You can also specify your lint checking preferences for a specific Android project in the lint.xml file. For more information on configuring lint, see <a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with lint</a>.</p>
+<p>You can also specify your {@code lint} checking preferences for a specific Android project in
+the <code>lint.xml</code> file. For more information on configuring {@code lint}, see
+<a href="{@docRoot}tools/debugging/improving-w-lint.html">Improving Your Code with lint</a>.</p>
diff --git a/docs/html/tools/help/proguard.jd b/docs/html/tools/help/proguard.jd
index aa9a0bc..b5d84ed 100644
--- a/docs/html/tools/help/proguard.jd
+++ b/docs/html/tools/help/proguard.jd
@@ -8,7 +8,9 @@ parent.link=index.html
<h2>In this document</h2>
<ol>
- <li><a href="#enabling">Enabling ProGuard</a></li>
+ <li><a href="#enabling-gradle">Enabling ProGuard (Gradle Builds)</a></li>
+
+ <li><a href="#enabling">Enabling ProGuard (Ant Builds)</a></li>
<li><a href="#configuring">Configuring ProGuard</a></li>
@@ -37,7 +39,10 @@ parent.link=index.html
</div>
</div>
- <p>The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and
+
+
+ <p>The <a href="http://proguard.sourceforge.net">ProGuard</a> tool shrinks, optimizes, and
+ obfuscates your code by removing unused code and
renaming classes, fields, and methods with semantically obscure names. The result is a smaller
sized <code>.apk</code> file that is more difficult to reverse engineer. Because ProGuard makes your
application harder to reverse engineer, it is important that you use it
@@ -45,44 +50,102 @@ parent.link=index.html
<a href="{@docRoot}google/play/licensing/index.html">Licensing Your Applications</a>.</p>
<p>ProGuard is integrated into the Android build system, so you do not have to invoke it
- manually. ProGuard runs only when you build your application in release mode, so you do not
- have to deal with obfuscated code when you build your application in debug mode.
+ manually. ProGuard runs only when you build your application in release mode, so you do not
+ have to deal with obfuscated code when you build your application in debug mode.
Having ProGuard run is completely optional, but highly recommended.</p>
-
+
<p>This document describes how to enable and configure ProGuard as well as use the
<code>retrace</code> tool to decode obfuscated stack traces.</p>
- <h2 id="enabling">Enabling ProGuard</h2>
+
+ <h2 id="enabling-gradle">Enabling ProGuard (Gradle Builds)</h2>
+ <p>When you create a project in Android Studio or with the Gradle build system, the
+ <code>minifyEnabled</code> property in the <code>build.gradle</code> file enables and disables
+ ProGuard for release builds. The <code>minifyEnabled</code> property is part of the
+ <code>buildTypes</code> <code>release</code> block that controls the settings applied to
+ release builds. Set the <code>minifyEnabled</code> property to <code>true</code> to enable
+ ProGuard, as shown in this example. </p>
+
+ <pre class="no-pretty-print">
+ android {
+ ...
+
+ buildTypes {
+ release {
+ minifyEnabled true
+ proguardFiles getDefaultProguardFile('proguard-android.txt'),
+ 'proguard-rules.pro'
+ }
+ }
+ }
+ </pre>
+
+ <p>The <code>getDefaultProguardFile('proguard-android.txt')</code> method obtains the default
+ ProGuard settings from the Android SDK <code>tools/proguard/</code> folder. The
+ <code>proguard-android-optimize.txt</code> file is also available in this Android SDK
+ folder with the same rules but with optimizations enabled. ProGuard optimizations perform
+ analysis at the bytecode level, inside and across methods to help make your app smaller and run
+ faster. Android Studio adds the <code>proguard-rules.pro</code> file at the root of the module,
+ so you can also easily add custom ProGuard rules specific to the current module. </p>
+
+ <p>You can also add ProGuard files to the <code>getDefaultProguardFile</code>
+ directive for all release builds or as part of the <code>productFlavor</code> settings in the
+ <code>build.gradle</code> file to customize the settings applied to build variants. This example
+ adds the <code>proguard-rules-new.pro</code> to the <code>proguardFiles</code>
+ directive and the <code>other-rules.pro</code> file to the <code>flavor2</code> product flavor. </p>
+
+<pre class="no-pretty-print">
+ android {
+ ...
+
+ buildTypes {
+ release {
+ minifyEnabled true
+ proguardFiles getDefaultProguardFile('proguard-android.txt'),
+ 'proguard-rules.pro', 'proguard-rules-new.pro'
+ }
+ }
+
+ productFlavors {
+ flavor1 {
+ }
+ flavor2 {
+ proguardFile 'other-rules.pro'
+ }
+ }
+ }
+ </pre>
+
+
+
+ <h2 id="enabling">Enabling ProGuard (Ant Builds)</h2>
<p>When you create an Android project, a <code>proguard.cfg</code> file is automatically
generated in the root directory of the project. This file defines how ProGuard optimizes and
obfuscates your code, so it is very important that you understand how to customize it for your
needs. The default configuration file only covers general cases, so you most likely have to edit
- it for your own needs. See the following section about <a href="#configuring">Configuring ProGuard</a> for information on
- customizing the ProGuard configuration file.</p>
+ it for your own needs. See the following section about <a href="#configuring">Configuring
+ ProGuard</a> for information on customizing the ProGuard configuration file.</p>
<p>To enable ProGuard so that it runs as part of an Ant or Eclipse build, set the
<code>proguard.config</code> property in the <code>&lt;project_root&gt;/project.properties</code>
file. The path can be an absolute path or a path relative to the project's root.</p>
-<p class="note"><strong>Note:</strong> When using Android Studio, you must add Proguard
-to your <code>gradle.build</code> file's build types. For more information, see the
-<a href="http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Running-ProGuard"
->Gradle Plugin User Guide</a>.
+ <p>If you left the <code>proguard.cfg</code> file in its default location (the project's root
+ directory), you can specify its location like this:</p>
-<p>If you left the <code>proguard.cfg</code> file in its default location (the project's root directory),
-you can specify its location like this:</p>
<pre class="no-pretty-print">
proguard.config=proguard.cfg
</pre>
+
<p>
You can also move the the file to anywhere you want, and specify the absolute path to it:
</p>
+
<pre class="no-pretty-print">
proguard.config=/path/to/proguard.cfg
</pre>
-
<p>When you build your application in release mode, either by running <code>ant release</code> or
by using the <em>Export Wizard</em> in Eclipse, the build system automatically checks to see if
the <code>proguard.config</code> property is set. If it is, ProGuard automatically processes
@@ -116,19 +179,19 @@ proguard.config=/path/to/proguard.cfg
<li><code>&lt;project_root&gt;/proguard</code> if you are using Eclipse.</li>
</ul>
-
+
<p class="caution"><strong>Caution:</strong> Every time you run a build in release mode, these files are
overwritten with the latest files generated by ProGuard. Save a copy of them each time you release your
- application in order to de-obfuscate bug reports from your release builds.
- For more information on why saving these files is important, see
+ application in order to de-obfuscate bug reports from your release builds.
+ For more information on why saving these files is important, see
<a href="#considerations">Debugging considerations for published applications</a>.
</p>
<h2 id="configuring">Configuring ProGuard</h2>
- <p>For some situations, the default configurations in the <code>proguard.cfg</code> file will
- suffice. However, many situations are hard for ProGuard to analyze correctly and it might remove code
- that it thinks is not used, but your application actually needs. Some examples include:</p>
+ <p>For some situations, the default configurations in the ProGuard configuration file will
+ suffice. However, many situations are hard for ProGuard to analyze correctly and it might remove
+ code that it thinks is not used, but your application actually needs. Some examples include:</p>
<ul>
<li>a class that is referenced only in the <code>AndroidManifest.xml</code> file</li>
@@ -138,61 +201,63 @@ proguard.config=/path/to/proguard.cfg
<li>dynamically referenced fields and methods</li>
</ul>
- <p>The default <code>proguard.cfg</code> file tries to cover general cases, but you might
+ <p>The default ProGuard configuration file tries to cover general cases, but you might
encounter exceptions such as <code>ClassNotFoundException</code>, which happens when ProGuard
strips away an entire class that your application calls.</p>
<p>You can fix errors when ProGuard strips away your code by adding a <code>-keep</code> line in
- the <code>proguard.cfg</code> file. For example:</p>
+ the ProGuard configuration file. For example:</p>
<pre>
-keep public class &lt;MyClass&gt;
</pre>
<p>There are many options and considerations when using the <code>-keep</code> option, so it is
- highly recommended that you read the
+ highly recommended that you read the
<a href="http://stuff.mit.edu/afs/sipb/project/android/sdk/android-sdk-linux/tools/proguard/docs/index.html#manual/introduction.html">ProGuard
- Manual</a> for more information about customizing your configuration file. The
- <em>Overview of Keep options</em> and <em>Examples</em> sections are particularly helpful.
+ Manual</a> for more information about customizing your configuration file. The
+ <em>Overview of Keep options</em> and <em>Examples</em> sections are particularly helpful.
The <a href=
"http://stuff.mit.edu/afs/sipb/project/android/sdk/android-sdk-linux/tools/proguard/docs/index.html#manual/troubleshooting.html">Troubleshooting
- </a> section of the ProGuard Manual outlines other common problems you might encounter
+ </a> section of the ProGuard Manual outlines other common problems you might encounter
when your code gets stripped away.</p>
<h2 id="decoding">Decoding Obfuscated Stack Traces</h2>
<p>When your obfuscated code outputs a stack trace, the method names are obfuscated, which makes
debugging hard, if not impossible. Fortunately, whenever ProGuard runs, it outputs a
- <code>&lt;project_root&gt;/bin/proguard/mapping.txt</code> file, which shows you the original
- class, method, and field names mapped to their obfuscated names.</p>
+ <code>mapping.txt</code> file, which shows you the original class, method, and field names
+ mapped to their obfuscated names.</p>
<p>The <code>retrace.bat</code> script on Windows or the <code>retrace.sh</code> script on Linux
- or Mac OS X can convert an obfuscated stack trace to a readable one. It is located in the
- <code>&lt;sdk_root&gt;/tools/proguard/</code> directory. The syntax for executing the
+ or Mac OS X can convert an obfuscated stack trace to a readable one. It is located
+ in the <code>&lt;sdk_root&gt;/tools/proguard/</code> directory. The syntax for executing the
<code>retrace</code> tool is:</p>
<pre>retrace.bat|retrace.sh [-verbose] mapping.txt [&lt;stacktrace_file&gt;]</pre>
<p>For example:</p>
-
+
<pre>retrace.bat -verbose mapping.txt obfuscated_trace.txt</pre>
-
+
<p>If you do not specify a value for <em>&lt;stacktrace_file&gt;</em>, the <code>retrace</code> tool reads
from standard input.</p>
<h3 id="considerations">Debugging considerations for published applications</h3>
- <p>Save the <code>mapping.txt</code> file for every release that you publish to your users.
- By retaining a copy of the <code>mapping.txt</code> file for each release build,
+ <p>Save the <code>mapping.txt</code> file for every release that you publish to your users.
+ By retaining a copy of the <code>mapping.txt</code> file for each release build,
you ensure that you can debug a problem if a user encounters a bug and submits an obfuscated stack trace.
A project's <code>mapping.txt</code> file is overwritten every time you do a release build, so you must be
- careful about saving the versions that you need.</p>
+ careful about saving the versions that you need. For Eclipse, this file is stored in
+ <code>&lt;project_root&gt;/bin/proguard/</code>. For Android Studio, this file is stored in
+ the app <code>build/outs/</code> folder. </p>
<p>For example, say you publish an application and continue developing new features of
the application for a new version. You then do a release build using ProGuard soon after. The
build overwrites the previous <code>mapping.txt</code> file. A user submits a bug report
- containing a stack trace from the application that is currently published. You no longer have a way
+ containing a stack trace from the application that is currently published. You no longer have a way
of debugging the user's stack trace, because the <code>mapping.txt</code> file associated with the version
on the user's device is gone. There are other situations where your <code>mapping.txt</code> file can be overwritten, so
ensure that you save a copy for every release that you anticipate you have to debug.</p>
- <p>How you save the <code>mapping.txt</code> file is your decision. For example, you can rename them to
- include a version or build number, or you can version control them along with your source
- code.</p>
+ <p>How you save the <code>mapping.txt</code> files is your decision. For example, you can rename
+ the files to include a version or build number, or you can version control them along with your
+ source code.</p>
diff --git a/docs/html/tools/help/sdk-manager.jd b/docs/html/tools/help/sdk-manager.jd
index b084237..0c77395 100644
--- a/docs/html/tools/help/sdk-manager.jd
+++ b/docs/html/tools/help/sdk-manager.jd
@@ -16,7 +16,7 @@ your environment.</p>
<li>On Windows, double-click the <code>SDK Manager.exe</code> file at the root of the Android
SDK directory.</li>
<li>On Mac or Linux, open a terminal and navigate to the <code>tools/</code> directory in the
-Android SDK, then execute <code>android sdk</code>.</li>
+location where the Android SDK is installed, then execute <code>android sdk</code>.</li>
</ul>
<p>You can select which packages you want to download by toggling the checkboxes on the left, then
diff --git a/docs/html/tools/help/systrace.jd b/docs/html/tools/help/systrace.jd
index d6fc05e..4461da9 100644
--- a/docs/html/tools/help/systrace.jd
+++ b/docs/html/tools/help/systrace.jd
@@ -68,7 +68,8 @@ or the Android <a href="{@docRoot}tools/help/monitor.html">Device Monitor</a>.
<ol>
<li>In <a href="{@docRoot}sdk/installing/studio.html">Android Studio</a>, open an
Android application project.</li>
- <li>Open the Device Monitor by selecting <strong>Tools &gt; Android &gt; Monitor</strong>.</li>
+ <li>Open the Device Monitor by selecting <strong>Tools &gt; Android &gt; Android Device
+ Monitor</strong>.</li>
<li>In the <strong>Devices</strong> tab, select the device on which to run a trace. If no
devices are listed, make sure your device is connected via USB cable and that debugging is
enabled on the device.</li>
diff --git a/docs/html/tools/projects/index.jd b/docs/html/tools/projects/index.jd
index 5f4f2cc..8665479 100644
--- a/docs/html/tools/projects/index.jd
+++ b/docs/html/tools/projects/index.jd
@@ -1,4 +1,6 @@
page.title=Managing Projects Overview
+meta.tags="project, mipmap"
+page.tags="project", "mipmap"
@jd:body
<div id="qv-wrapper">
@@ -8,7 +10,9 @@ page.title=Managing Projects Overview
<ol>
<li><a href="#ProjectFiles">Android Project Files</a></li>
<li><a href="#ApplicationModules">Android Application Modules</a></li>
-
+ <ol>
+ <li><a href="#mipmap">Managing Launcher Icons as mipmap Resources</a></li>
+ </ol>
<li><a href="#LibraryModules">Library Modules</a>
<ol>
<li><a href="#considerations">Development considerations</a></li>
@@ -230,7 +234,18 @@ project and override similar module file settings.</p>
focused). See the <a href=
"{@docRoot}guide/topics/resources/drawable-resource.html">Drawable</a> resource type.</dd>
- <dt><code>layout/</code></dt>
+
+ <dt><code>mipmap/</code></dt>
+
+ <dd>For app launcher icons. The Android system retains the resources in this folder
+ (and density-specific folders such as mipmap-xxxhdpi) regardless of the screen resolution
+ of the device where your app is installed. This behavior allows launcher apps to pick
+ the best resolution icon for your app to display on the home screen. For more information
+ about using the <code>mipmap</code> folders, see
+ <a href="#mipmap">Managing Launcher Icons as mipmap Resources</a>. </p>
+
+
+ <dt><code>layout/</code></dt>
<dd>XML files that are compiled into screen layouts (or part of a screen). See the <a href=
"{@docRoot}guide/topics/resources/layout-resource.html">Layout</a> resource type.</dd>
@@ -304,6 +319,46 @@ project and override similar module file settings.</p>
+<h2 id="mipmap">Managing Launcher Icons as mipmap Resources</h2>
+
+<p>Different home screen launcher apps on different devices show app launcher icons at various
+resolutions. When app resource optimization techniques remove resources for unused
+screen densities, launcher icons can wind up looking fuzzy because the launcher app has to upscale
+a lower-resolution icon for display. To avoid these display issues, apps should use the
+<code>mipmap/</code> resource folders for launcher icons. The Android system
+preserves these resources regardless of density stripping, and ensures that launcher apps can
+pick icons with the best resolution for display. </p>
+
+<p>Make sure launcher apps show a high-resolution icon for your app by moving all densities of your
+launcher icons to density-specific <code>res/mipmap/</code> folders
+(for example <code>res/mipmap-mdpi/</code> and <code>res/mipmap-xxxhdpi/</code>). The
+<code>mipmap/</code> folders replace the <code>drawable/</code> folders for launcher icons. For
+xxhpdi launcher icons, be sure to add the higher resolution xxxhdpi versions of the
+icons to enhance the visual experience of the icons on higher resolution devices.</p>
+
+<p class="note"><strong>Note:</strong> Even if you build a single APK for all devices, it is still
+best practice to move your launcher icons to the <code>mipmap/</code> folders.</p>
+
+
+<h3>Manifest update</h3>
+
+<p>When you move your launcher icons to the <code>mipmap-[density]</code> folders, change the
+launcher icon references in the <code>AndroidManifest.xml</code> file so your manifest references
+the <code>mipmap/</code> location. This example changes the manifest file to reference the
+<code>ic_launcher</code> icon in the <code>mipmap/</code> folder. </p>
+
+<pre>
+...
+&lt;application android:name="ApplicationTitle"
+ android:label="@string/app_label"
+ android:icon="@mipmap/ic_launcher" &gt;
+ ...
+</pre>
+
+
+
+
+
<h2 id="LibraryModules">Library Module</h2>
<div class="sidebox-wrapper">
diff --git a/docs/html/tools/revisions/build-tools.jd b/docs/html/tools/revisions/build-tools.jd
index 593770a..e8706c1 100644
--- a/docs/html/tools/revisions/build-tools.jd
+++ b/docs/html/tools/revisions/build-tools.jd
@@ -78,6 +78,41 @@ listing in the Android SDK Manager.</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=""/>Build Tools, Revision 22.0.1</a> <em>(March 2015)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+ <p>Fixed compatibility issues with
+ <a href="{@docRoot}guide/topics/renderscript/compute.html">RenderScript</a> kernels on
+ Android 4.4 (API level 19) to Android 4.1 (API level 16) devices.</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=""/>Build Tools, Revision 22.0.0</a> <em>(March 2015)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+ <p>Added support for Android 5.1 (API level 22).</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=""/>Build Tools, Revision 21.1.2</a> <em>(February 2015)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+ <p>Fixed problem with building data layouts in 32-bit mode.</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=""/>Build Tools, Revision 21.1.1</a> <em>(November 2014)</em>
</p>
<div class="toggle-content-toggleme">
@@ -92,7 +127,7 @@ listing in the Android SDK Manager.</p>
alt=""/>Build Tools, Revision 21.1</a> <em>(October 2014)</em>
</p>
<div class="toggle-content-toggleme">
- <p>Added multidex file support for APKs and Jack suppport to address the 64K method reference
+ <p>Added multidex file support for APKs and Jack support to address the 64K method reference
limit.</p>
</div>
</div>
diff --git a/docs/html/tools/revisions/gradle-plugin.jd b/docs/html/tools/revisions/gradle-plugin.jd
new file mode 100644
index 0000000..fd294d2
--- /dev/null
+++ b/docs/html/tools/revisions/gradle-plugin.jd
@@ -0,0 +1,328 @@
+page.title=Android Plugin for Gradle Release Notes
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}sdk/installing/studio-build.html">Build System Overview</a></li>
+ <li><a href="{@docRoot}tools/building/plugin-for-gradle.html">Android Plugin for Gradle</a></li>
+ </ol>
+
+</div>
+</div>
+
+
+<p>The Android build system uses the Android Plugin for Gradle to support building Android
+applications with the <a href="http://www.gradle.org/">Gradle</a> build toolkit. The plugin runs
+independent of Android Studio so the plugin and the Gradle build system can be updated
+independently of Android Studio.</p>
+
+<p class="note"><strong>Note:</strong> When you update Android Studio or open a project in a
+previous version of Android Studio, Android Studio prompts you to automatically update the plugin
+and Gradle to the latest available versions. You can choose to accept these updates based
+on your project's build requirements. </p>
+
+
+<h2 id="revisions">Revisions</h2>
+
+<p>The sections below provide notes about successive releases of
+the Android Plugin for Gradle, as denoted by revision number. To determine what revision of the
+plugin you are using, check the version declaration in the project-level
+<strong>build.gradle</strong> file. </p>
+
+<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.1.3</a> <em>(March 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>Fixed issue with duplicated dependencies on a test app that triggered a ProGuard failure. </li>
+ <li>Fixed Comparator implementation which did not comply with the JDK Comparator contract and
+ generated a JDK 7 error.</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.2</a> <em>(February 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>Normalized path when creating a mockable JAR for unit testing. </li>
+ <li>Fixed the <code>archivesBaseName</code> setting in the <code>build.gradle</code> file. </li>
+ <li>Fixed the unresolved placeholder failure in manifest merger when building a library
+ test application.</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.1</a> <em>(February 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>Modified build variants so only variants that package a
+ <a href="{@docRoot}training/wearables/apps/index.html">Wear</a> app trigger Wear-specific
+ build tasks. </li>
+ <li>Changed dependency related issues to fail at build time rather than at debug time.
+ This behavior allows you to run diagnostic diagnostic tasks (such as 'dependencies') to help
+ resolve the conflict. </li>
+ <li>Fixed the <code>android.getBootClasspath()</code> method to return a value. </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.0</a> <em>(February 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>Added new unit test support</li>
+ <ul>
+ <li>Enabled
+ <a href="{@docRoot}training/activity-testing/activity-unit-testing.html">unit tests</a> to
+ run on the local JVM against a special version of the <code>android.jar</code> file that is
+ compatible with popular mocking frameworks, for example Mockito. </li>
+ <li>Added new test tasks <code>testDebug</code>, <code>testRelease</code>, and
+ <code>testMyFlavorDebug</code> when using product flavors. </li>
+ <li>Added new source folders recognized as unit tests: <code>src/test/java/</code>,
+ <code>src/testDebug/java/</code>, <code>src/testMyFlavor/java/</code>.
+ <li>Added new configurations in the <code>build.gradle</code> file for declaring test-only
+ dependencies, for example, <code>testCompile 'junit:junit:4.11'</code>,
+ <code>testMyFlavorCompile 'some:library:1.0'</code>.
+ <p class="note"><strong>Note:</strong> Test-only dependencies are not currently compatible
+ with Jack (Java Android Compiler Kit). </p>
+ </li>
+ <li>Added the <code>android.testOptions.unitTests.returnDefaultValues</code> option to
+ control the behaviour of the mockable android.jar. </li>
+ </ul>
+ <li>Replaced <code>Test</code> in test task names with <code>AndroidTest</code>.
+ For example, the <code>assembleDebugTest</code> task is now
+ <code>assembleDebugAndroidTest</code> task. Unit test tasks still have <code>UnitTest</code>
+ in the task name, for example <code>assembleDebugUnitTest</code>. </li>
+ <li>Modified <a href="{@docRoot}tools/help/proguard.html">ProGuard</a> configuration files to
+ no longer apply to the test APK. If minification is enabled, ProGuard processes the test APK
+ and applies only the mapping file that is generated when minifying the main APK. </li>
+ <li>Updated dependency management</li>
+ <ul>
+ <li>Fixed issues using <code>provided</code> and <code>package</code> scopes.
+ <p class="note"><strong>Note:</strong> These scopes are incompatible with AAR
+ (Android ARchive) packages and will cause a build with AAR packages to fail.</p>
+ </li>
+ <li>Modified dependency resolution to compare the dependencies of an app under test and the
+ test app. If an artifact with the same version is found for both apps, it's not included with
+ the test app and is packaged only with the app under test. If an artifact with a different
+ version is found for both apps, the build fails.</li>
+ </ul>
+
+ <li>Added support for <code>anyDpi</code>
+ <a href="{@docRoot}guide/topics/resources/providing-resources.html"> resource qualifier</a>
+ in resource merger. </li>
+ <li>Improved evaluation and IDE sync speeds for projects with a large number of
+ Android <a href="{@docRoot}sdk/installing/create-project.html#CreatingAModule"> modules</a>. </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.0.1</a> <em>(January 2015)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+
+ <dl>
+ <dt>Dependencies:</dt>
+
+ <dd>
+ <ul>
+ <li>Gradle 2.2.1 up to 2.3.x.
+ <p class="note"><strong>Note:</strong> This version of the Android Plugin for Gradle is
+ not compatible with Gradle 2.4 and higher. </p>
+ </li>
+ <li>Build Tools 21.1.1 or higher.</li>
+ </ul>
+ </dd>
+
+ <dt>General Notes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed issue with Gradle build failure when accessing the
+ <code>extractReleaseAnnotations</code> module.
+ (<a href="http://b.android.com/81638">Issue 81638</a>).</li>
+ <li>Fixed issue with <code>Disable</code> passing the
+ <code>--no-optimize</code> setting to the Dalvik Executable (dex) bytecode.
+ (<a href="http://b.android.com/82662">Issue 82662</a>).</li>
+ <li>Fixed manifest merger issues when importing libraries with a
+ <code>targetSdkVersion</code> less than 16.</li>
+ <li>Fixed density ordering issue when using Android Studio with JDK 8.</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.0.0</a> <em>(December 2014)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+
+ <dl>
+ <dt>Dependencies:</dt>
+
+ <dd>
+ <ul>
+ <li>Gradle 2.2.1 up to 2.3.x.
+ <p class="note"><strong>Note:</strong> This version of the Android Plugin for Gradle is
+ not compatible with Gradle 2.4 and higher. </p>
+ </li>
+ <li>Build Tools 21.1.1 or higher.</li>
+ </ul>
+ </dd>
+
+ <dt>General Notes:</dt>
+ <dd>
+ <ul>
+ <li>Initial plugin release.</li>
+ </ul>
+ </dd>
+ </div>
+</div>
+
+
+
+
+<h2>Updating the Android Plugin for Gradle Version</h2>
+<p>The Android Plugin for Gradle version is specified in the
+<strong>File &gt; Project Structure</strong> menu or the project-level
+<code>build.gradle</code> file. The plugin version applies to all modules built in that
+Android Studio project. This example updates the Android Plugin for Gradle to version 1.1.0:
+<pre>
+...
+ dependencies {
+ classpath 'com.android.tools.build:gradle:1.1.0'
+ }
+...
+</pre>
+
+
+<p class="caution"><strong>Caution:</strong> You should not use dynamic dependencies (+) in
+version numbers. Using this feature can cause unexpected version updates and difficulty
+resolving version differences. </p>
+
+<p>If you're building with Gradle but using not Android Studio, the build process downloads the
+latest Android Plugin for Gradle plugin when it runs. </p>
+
+
+
+<h2>Updating the Gradle Version </h2>
+
+<p>Android Studio requires Gradle version 2.2.1 or later. To view and
+update the Gradle version, edit the Gradle distribution reference in the
+<code>gradle/wrapper/gradle-wrapper.properties</code> file. This example shows the
+Android Plugin for Gradle version set to 2.2.1.</p>
+
+<pre>
+...
+distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip
+...
+</pre>
+
+
+
+
+<p>For more details about the supported Android Plugin for Gradle properties and syntax, click
+the link to the
+<a href="{@docRoot}tools/building/plugin-for-gradle.html">Plugin Language Reference</a>.</p>
+
+
+
+
+
diff --git a/docs/html/tools/revisions/platforms.jd b/docs/html/tools/revisions/platforms.jd
index a73be5e..8a31beb 100644
--- a/docs/html/tools/revisions/platforms.jd
+++ b/docs/html/tools/revisions/platforms.jd
@@ -54,11 +54,35 @@ most recent release and restart the SDK Manager. If you do not, the latest Andro
packages may not be available for download.</p>
-<h2 id="5.0">Android 5.0</h2>
+<h2 id="5.1">Android 5.1</h2>
<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="" />Revision 1</a> <em>(March 2015)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+
+ <p>Initial release for Android 5.1 (API level 22).</p>
+ <p>Also see the
+ <a href="{@docRoot}about/versions/android-5.1.html">Android 5.1 APIs overview</a>.</p>
+ <p>Dependencies:</p>
+ <ul>
+ <li>Android SDK Platform-tools r22 or higher is required.</li>
+ <li>Android SDK Tools 23.0.5 or higher is required.</li>
+ </ul>
+ </div>
+
+</div>
+
+
+
+<h2 id="5.0">Android 5.0</h2>
+
+<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="" />Revision 2</a> <em>(December 2014)</em>
</p>
@@ -94,7 +118,7 @@ class="toggle-content-img" alt="" />Revision 1</a> <em>(October 2014)</em>
<p>The platform includes the following new device definitions for use in creating
Android Virtual Devices in the <a href="{@docRoot}tools/help/avd-manager.html">AVD Manager</a>:</p>
-
+
<ul>
<li>Nexus 6 (5.96", 1440 x 2560, Normal 560dpi screen) </li>
<li>Nexus 9 (8.9", 2048 x 1536, X-Large xhdpi screen) </li>
diff --git a/docs/html/tools/revisions/studio.jd b/docs/html/tools/revisions/studio.jd
index 3806933..3982f2e 100644
--- a/docs/html/tools/revisions/studio.jd
+++ b/docs/html/tools/revisions/studio.jd
@@ -29,7 +29,7 @@ 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 from here. To
+<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>
@@ -43,6 +43,33 @@ 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.1.0</a> <em>(February 2015)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+ <p>Various fixes and enhancements:</p>
+ <ul>
+ <li>Added support for the <a href="{@docRoot}design/wear/index.html">Android Wear</a> watch
+ template. </li>
+ <li>Modified new project and module creation to include
+ <a href="{@docRoot}tools/projects/index.html#mipmap"><code>res/mipmap</code></a> folders for
+ density-specific launcher icons. These <code>res/mipmap</code> folders replace the
+ <a href="{@docRoot}guide/topics/resources/drawable-resource.html"><code>res/drawable</code></a>
+ folders for launcher icons. </li>
+ <li>Updated launcher icons to have a
+ <a href="{@docRoot}design/material/index.html">Material Design</a> look and added an
+ <code>xxxhdpi</code> launcher icon. </li>
+ <li>Added and enhanced <a href="{@docRoot}tools/help/lint.html"><code>lint</code></a> checks
+ 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>
+ </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.0.1</a> <em>(December 2014)</em>
</p>
diff --git a/docs/html/tools/sdk/eclipse-adt.jd b/docs/html/tools/sdk/eclipse-adt.jd
index c3a4dea..08634da 100644
--- a/docs/html/tools/sdk/eclipse-adt.jd
+++ b/docs/html/tools/sdk/eclipse-adt.jd
@@ -53,6 +53,40 @@ 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=""/>ADT 23.0.6</a> <em>(March 2015)</em>
+ </p>
+
+ <div class="toggle-content-toggleme">
+<dl>
+ <dt>Dependencies:</dt>
+
+ <dd>
+ <ul>
+ <li>Java 7 or higher is required if you are targeting Android 5.0 and higher.</li>
+ <li>Java 1.6 or higher is required if you are targeting other releases.</li>
+ <li>Eclipse Indigo (Version 3.7.2) or higher is required.</li>
+ <li>This version of ADT is designed for use with
+ <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r24.1.2</a>.
+ If you haven't already installed SDK Tools r24.1.2 into your SDK, use the
+ Android SDK Manager to do so.</li>
+ </ul>
+ </dd>
+
+ <dt>General Notes:</dt>
+ <dd>
+ <ul>
+ <li>Fixed issues with the rendering library.</li>
+ </ul>
+ </dd>
+</dl>
+</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=""/>ADT 23.0.4</a> <em>(October 2014)</em>
</p>
@@ -62,12 +96,12 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues
<dd>
<ul>
- <li>Java 7 or higher is required if you are targeting the L Developer Preview.</li>
+ <li>Java 7 or higher is required if you are targeting Android 5.0 and higher.</li>
<li>Java 1.6 or higher is required if you are targeting other releases.</li>
<li>Eclipse Indigo (Version 3.7.2) or higher is required.</li>
<li>This version of ADT is designed for use with
- <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r23.0.2</a>.
- If you haven't already installed SDK Tools r23.0.2 into your SDK, use the
+ <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r23.0.4</a>.
+ If you haven't already installed SDK Tools r23.0.4 into your SDK, use the
Android SDK Manager to do so.</li>
</ul>
</dd>
@@ -96,7 +130,7 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues
<dd>
<ul>
- <li>Java 7 or higher is required if you are targeting the L Developer Preview.</li>
+ <li>Java 7 or higher is required if you are targeting Android 5.0 and higher.</li>
<li>Java 1.6 or higher is required if you are targeting other releases.</li>
<li>Eclipse Indigo (Version 3.7.2) or higher is required.</li>
<li>This version of ADT is designed for use with
@@ -132,7 +166,7 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues
<dd>
<ul>
- <li>Java 7 or higher is required if you are targeting the L Developer Preview.</li>
+ <li>Java 7 or higher is required if you are targeting Android 5.0 and higher.</li>
<li>Java 1.6 or higher is required if you are targeting other releases.</li>
<li>Eclipse Indigo (Version 3.7.2) or higher is required.</li>
<li>This version of ADT is designed for use with
@@ -167,7 +201,7 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues
<dd>
<ul>
- <li>Java 7 or higher is required if you are targeting the L Developer Preview.</li>
+ <li>Java 7 or higher is required if you are targeting Android 5.0 and higher.</li>
<li>Java 1.6 or higher is required if you are targeting other releases.</li>
<li>Eclipse Indigo (Version 3.7.2) or higher is required.</li>
<li>This version of ADT is designed for use with
@@ -2274,7 +2308,7 @@ bigger than the screen.</li>
<dt>DDMS integration:</dt>
<dd>
<ul>
-<li>Includes the improvements from the standlone DDMS, revision 3.</li>
+<li>Includes the improvements from the standalone DDMS, revision 3.</li>
<li>Adds an option to open HPROF files into eclipse instead of writing them on
disk. If a profiler such as MAT (<a href="http://eclipse.org/mat">Memory Analyzer
Tool</a>) is installed, it'll open the file.</li>
diff --git a/docs/html/tools/sdk/tools-notes.jd b/docs/html/tools/sdk/tools-notes.jd
index e50b7ac..47b603a 100644
--- a/docs/html/tools/sdk/tools-notes.jd
+++ b/docs/html/tools/sdk/tools-notes.jd
@@ -21,10 +21,38 @@ Tools you are using, refer to the "Installed Packages" listing in the Android SD
<p>For a summary of all known issues in SDK Tools, 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=""/>SDK Tools, Revision 24.1.2</a> <em>(February 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 boot failures of MIPS system images on Mac OS X.</li>
+ <li>Fixed AVD screen capture issues when using GPU emulation.</li>
+ <li>Fixed memory leaks in emulator system.</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.0.2</a> <em>(December 2014)</em>
</p>
@@ -96,7 +124,7 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues
<dt>General Notes:</dt>
<dd>
<ul>
- <li>Added support for Andriod Studio 1.0 and emulator enhancements.</li>
+ <li>Added support for Android Studio 1.0 and emulator enhancements.</li>
</ul>
</dd>
</div>
diff --git a/docs/html/tools/studio/index.jd b/docs/html/tools/studio/index.jd
index 42ab89c..eaa96d3 100644
--- a/docs/html/tools/studio/index.jd
+++ b/docs/html/tools/studio/index.jd
@@ -10,6 +10,7 @@ page.title=Android Studio Overview
<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="#proxy">HTTP Proxy Settings</a></li>
<li><a href="#other">Other Highlights</a></li>
@@ -35,7 +36,7 @@ Android Studio offers:</p>
<li>Build variants and multiple <code>apk</code> file generation</li>
<li>Code templates to help you build common app features</li>
<li>Rich layout editor with support for drag and drop theme editing</li>
- <li>Lint tools to catch performance, usability, version compatibility, and other problems</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/"
@@ -64,7 +65,7 @@ Studio</a>.</p>
<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
+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>
@@ -96,12 +97,12 @@ top level of the project hierarchy and contains these three elements at the top
<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>
+representation. To switch to back to the segregated project view, select <strong>Project</strong> from
+the <strong>Project</strong> drop-down. </p>
-<h3>New Project and Directory Structure</h3>
+<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
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
@@ -119,6 +120,7 @@ specification and the files under {@code src/androidTest} directory for test cas
<a href="{@docRoot}tools/projects/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
@@ -180,7 +182,7 @@ uniquely identify application packages for publishing. The application ID is set
<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
+<p>When using build variants, the build system enables you 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>
@@ -242,19 +244,28 @@ Manager (HAXM) emulator accelerator and creates a default emulator for quick app
-<h3> Memory Monitor</h3>
+<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 4.</strong> Memory Monitor</p>
+ <p class="img-caption"><strong>Figure 5.</strong> Memory Monitor</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
+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>
-<h3> New Lint inspections</h3>
-<p>Lint has several new checks to ensure:
+<p>Android Studio enables several <code>lint</code> 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
@@ -267,44 +278,75 @@ memory the connected device is using. With your app running on a device or emula
<li>many others</li>
</ul>
-<p>Hovering over a Lint error displays the full issue explanation inline for easy error
+
+<p>Hovering over an inspection 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>
+<p>With Android Studio, you can also run {@code lint} inspections for a specific build variant, or
+for all build variants. You can configure the {@code lint} inspections that run by adding a
+<code>lintOptions</code> property to the Android settings in the <code>build.gradle</code>
+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>You can also manage inspection profiles and configure inspections within Android Studio.
+Choose <strong>File &gt; Settings &gt; Project Settings</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="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>
+to <em>error</em>. </p>
+
+
+<p>To manually run inspections in Android Studio, choose <strong>Analyze &gt; Inspect Code</strong>.
+The <em>Inspections Scope</em> dialog appears so you can specify the desired inspection profile and scope.</p>
+
+
+
+<h4>Running Inspections from the command line</h4>
+<p>You can also run {@code lint} inspections from the command line in your SDK directory. </p>
+<pre>
+sdk$ lint [flags] <project directories>
+</pre>
+
+<p class="note"><strong>Note:</strong> The {@code lint} <strong>--show</strong> and <strong>--list</strong>
+flags can be used to display the available issues and explanations. </p>
- <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>
+<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>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 5.</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 6.</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 7.</strong> API Version Rendering</p>
+ <p class="img-caption"><strong>Figure 8.</strong> API Version Rendering</p>
<p>From the Design View, you can drag and drop elements from the Palette to the Preview or
@@ -341,18 +383,19 @@ the wizard updates your system image and emulation requirements, such GPU, and t
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 8.</strong> Setup Wizard</p>
+<p class="img-caption"><strong>Figure 9.</strong> Setup Wizard</p>
<h3>Expanded template and form factor support</h3>
-<p>Android Studio supports new templates for Google Services and expands the available device
+<p>Android Studio supports templates for Google Services and expands the available 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 9.</strong> New 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>
@@ -362,7 +405,7 @@ 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 10.</strong> Setup Wizard</p>
+ <p class="img-caption"><strong>Figure 11.</strong> Setup Wizard</p>
@@ -386,6 +429,120 @@ code-level preference:
+<h2 id="proxy">Proxy Settings</h2>
+<p>Proxies serve as intermediary connection points between HTTP clients and web servers that add
+security and privacy to internet connections.</p>
+
+<p>To support running Android Studio behind a firewall, set the proxy settings for the
+Android Studio IDE and the SDK Manager. Use the Android Studio IDE HTTP Proxy settings page to set
+the HTTP proxy settings for Android Studio. The SDK Manager has a separate HTTP Proxy settings
+page.</p>
+
+<p>When running the Android Plugin for Gradle from the command line or on machines where
+Android Studio is not installed, such as continuous integration servers, set the proxy settings
+in the Gradle build file.</p>
+
+<p class="note"><strong>Note:</strong> After the initial installation of the Android Studio bundle,
+Android Studio can run with internet access or off-line. However, Android Studio requires an
+internet connection for Setup Wizard synchronization, 3rd-party library access, access to remote
+repositories, Gradle initialization and synchronization, and Android Studio version updates.</p>
+
+
+<h3>Setting up the Android Studio Proxy</h3>
+<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 &gt; Settings &gt; IDE Setting -- HTTP Proxy</strong>.
+
+<li>In Android Studio, open the IDE Settings dialog.
+ <ul>
+ <li>On Windows and Linux, choose
+ <strong>File &gt; Settings &gt; IDE Setting -- HTTP Proxy</strong>. </li>
+ <li>On Mac, choose
+ <strong>Android Studio &gt; Preferences &gt; IDE Setting -- HTTP Proxy</strong>. </li>
+ </ul>
+ The HTTP Proxy page appears.</li>
+ <li>Select <strong>auto-detection</strong> to use an auto-configuration URL to configure the
+ proxy settings or <strong>manual</strong> to enter each of the settings. For a detailed explanation
+ of these settings, see
+ <a href="https://www.jetbrains.com/idea/help/http-proxy.html">HTTP Proxy</a>. </li>
+ <li>Click <strong>Apply</strong> to enable the proxy settings. </li>
+</ol>
+
+<h3>Android Plugin for Gradle HTTP proxy settings</h3>
+When running the Android Plugin from the command line or on machines where Android Studio is not
+installed, set the Android Plugin for Gradle proxy settings in the Gradle build file.</p>
+
+<p>For application-specific HTTP proxy settings, set the proxy settings in the
+<strong>build.gradle</strong> file as required for each application module.</p>
+<pre>
+apply plugin: 'com.android.application'
+
+android {
+ ...
+
+ defaultConfig {
+ ...
+ systemProp.http.proxyHost=proxy.company.com
+ systemProp.http.proxyPort=443
+ systemProp.http.proxyUser=userid
+ systemProp.http.proxyPassword=password
+ systemProp.http.auth.ntlm.domain=domain
+ }
+ ...
+}
+</pre>
+
+
+
+<p>For project-wide HTTP proxy settings, set the proxy settings in the
+<code>gradle/gradle.properties</code> file. </p>
+
+<pre>
+# Project-wide Gradle settings.
+...
+
+systemProp.http.proxyHost=proxy.company.com
+systemProp.http.proxyPort=443
+systemProp.http.proxyUser=username
+systemProp.http.proxyPassword=password
+systemProp.http.auth.ntlm.domain=domain
+
+systemProp.https.proxyHost=proxy.company.com
+systemProp.https.proxyPort=443
+systemProp.https.proxyUser=username
+systemProp.https.proxyPassword=password
+systemProp.https.auth.ntlm.domain=domain
+
+...
+</pre>
+
+
+<p>For information about using Gradle properties for proxy settings, see the
+ <a href="http://www.gradle.org/docs/current/userguide/build_environment.html">Gradle User Guide</a>.</p>
+
+<p class="note"><strong>Note:</strong> When using Android Studio, the settings in the Android
+Studio IDE HTTP proxy settings page override the HTTP proxy settings in the
+<strong>gradle.properties</strong> file.</p>
+
+
+
+<h3>SDK Manager HTTP Proxy Settings </h3>
+<p>SDK Manager proxy settings enable proxy internet access for Android package and library
+updates from SDK Manager packages. </p>
+
+<p>To set the SDK Manager settings for proxy internet access, start the SDK Manager and open the
+SDK Manager page. </p>
+
+<ul>
+ <li>On Windows, select <strong>Tools &gt; Options</strong> from the menu bar. </li>
+ <li>On Mac and Linux, choose <strong>Tools &gt; Options</strong> from the system menu bar. </li>
+ </ul>
+
+<p>The Android SDK Manager page appears. Enter the settings and click <strong>Apply</strong>. </p>
+
+
+
<h2 id="other">Other Highlights</h2>
<h3> Translation Editor</h3>
@@ -399,25 +556,26 @@ into your project. </p>
<strong>Open Editor</strong> link. </p>
<img src="{@docRoot}images/tools/studio-translationeditoropen.png" />
- <p class="img-caption"><strong>Figure 11.</strong> Translation Editor</p>
+ <p class="img-caption"><strong>Figure 12.</strong> Translation Editor</p>
<h3> Editor support for the latest Android APIs</h3>
-<p>Android Studio supports the new
+<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 new drawable XML tags and attributes, such as &lt;ripple&gt;
+UI versions). Also, the drawable XML tags and attributes, such as &lt;ripple&gt;
and &lt;animated-selector&gt;, 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 Welcome page
+<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 12.</strong> Code Sample Access</p>
+ <p class="img-caption"><strong>Figure 13.</strong> Code Sample Access</p>
<p><img src="{@docRoot}images/tools/studio-sample-in-editor.png" /></p>
- <p class="img-caption"><strong>Figure 13.</strong> Imported Code Sample</p>
+ <p class="img-caption"><strong>Figure 14.</strong> Imported Code Sample</p>
diff --git a/docs/html/tools/support-library/index.jd b/docs/html/tools/support-library/index.jd
index 8a43696..56a3954 100644
--- a/docs/html/tools/support-library/index.jd
+++ b/docs/html/tools/support-library/index.jd
@@ -62,6 +62,108 @@ page.title=Support Library
<div class="toggle-content opened">
<p id="rev21"><a href="#" onclick="return toggleContent(this)">
<img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" alt=""
+/>Android Support Library, revision 22</a> <em>(March 2015)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+ <dl>
+ <dt>Changes for <a href="features.html#v4">v4 support library:</a></dt>
+ <dd>
+ <ul>
+ <li>Updated the {@link android.support.v4.content.res.ResourcesCompat#getDrawable
+ getDrawable()} method to return a drawable object for a specified specific resource ID,
+ screen density, and theme.
+ </li>
+ <li>Added the {@link android.support.v4.view.ViewCompat#setImportantForAccessibility
+ setImportantForAccessibility()} method so you can indicate if a view should trigger
+ accessibility events.
+ </li>
+ <li>Added the {@link android.support.v4.widget.DrawerLayout#getStatusBarBackgroundDrawable
+ getStatusBarBackgroundDrawable()} method so you can get the status bar background
+ drawable.
+ </li>
+ <li>Added methods to the
+ {@link android.support.v4.app.NotificationCompat.CarExtender.UnreadConversation}
+ class so Android Auto messaging apps can retrieve additional notification data.
+ </li>
+ <li>Added the {@link android.support.v4.widget.SwipeRefreshLayout#getProgressCircleDiameter
+ getProgressCircleDiameter()} method to return the diameter of a circle layout.
+ </li>
+ <li>Changed the default {@link android.support.v4.widget.DrawerLayout DrawerLayout}
+ status bar color to {@link android.R.attr#colorPrimaryDark}.
+ </li>
+ </ul>
+ </dd>
+
+ <dt>Changes for <a href="features.html#v7-appcompat">v7 appcompat library</a>:</dt>
+ <dd>
+ <ul>
+ <li>Added the spinner style
+ {@link android.support.v7.appcompat.R.style#Base_Widget_AppCompat_Spinner_Underlined}.</li>
+ <li>Added tinted widgets styles with
+ {@link android.support.v7.appcompat.R.style#Widget_AppCompat_AutoCompleteTextView},
+ {@link android.widget.MultiAutoCompleteTextView},
+ {@link android.support.v7.appcompat.R.style#TextAppearance_AppCompat_Button}, and
+ {@link android.support.v7.appcompat.R.style#Base_Widget_AppCompat_RatingBar}.</li>
+ </ul>
+ </dd>
+
+ <dt>Changes for <a href="features.html#v17-leanback">v17 leanback library</a>:</dt>
+ <dd>
+ <ul>
+ <li>Added the {@link android.support.v17.leanback.widget.ListRowPresenter#getRecycledPoolSize
+ getRecycledPoolSize()} and
+ {@link android.support.v17.leanback.widget.ListRowPresenter#setRecycledPoolSize
+ setRecycledPoolSize()} methods to allow customized recycled pool sizes.</li>
+ <li>Added the {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT} attribute to the
+ layout width setting to support wrapped content for title icons.</li>
+ <li>Defined {@link android.support.v17.leanback.R.transition} in XML to
+ improve transition updates. </li>
+ <li>Enabled support for right to left layouts.</li>
+ <li>Added the play and pause media key events support to the
+ {@link android.support.v17.leanback.app.PlaybackOverlayFragment} class.</li>
+ <li>Added enter and return transitions to the
+ {@link android.support.v17.leanback.app.BrowseFragment} class and the
+ {@link android.support.v17.leanback.app.DetailsFragment} class.</li>
+ <li>Added the {@link android.support.v17.leanback.widget.ArrayObjectAdapter#replace
+ replace()} method to replace items in an object’s adapter array. </li>
+ </ul>
+ </dd>
+
+
+ <dt>Changes for <a href="features.html#v7-mediarouter">v7 mediarouter library</a>:</dt>
+ <dd>
+ <ul>
+ <li>Updated Google Cast icons to use the
+ <a href="{@docRoot}training/material/index.html">material design</a> style.</li>
+ <li>Updated all the icons used in the {@link android.media.MediaRouter} dialogs to use the
+ <a href="{@docRoot}training/material/index.html">material design</a> style.</li>
+ </ul>
+ </dd>
+
+
+ <dt>Changes for <a href="features.html#v7-recyclerview">v7 recyclerview library</a>:</dt>
+ <dd>
+ <ul>
+ <li>Added the {@link android.support.v7.widget.RecyclerView.ViewHolder#getLayoutPosition
+ getlayoutPosition()}
+ and {@link android.support.v7.widget.RecyclerView.ViewHolder#getAdapterPosition
+ getadapterPosition()} methods to the {@link android.support.v7.widget.RecyclerView}
+ class.</li>
+ <li>Deprecated the <code>classgetChildPosition()</code> and
+ <code>findViewHolderForPosition()</code> methods in the
+ {@link android.support.v7.widget.RecyclerView} class. </li>
+ <li>Deprecated the <code>getPosition()</code> method in the
+ {@link android.support.v7.widget.RecyclerView.ViewHolder} class. </li>
+ <li>Deprecated the <code>getViewPosition()</code> method in the
+ {@link android.support.v7.widget.RecyclerView.LayoutParams} class. </li>
+ </ul>
+ </dd>
+
+
+
+<div class="toggle-content closed">
+ <p id="rev21"><a href="#" onclick="return toggleContent(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""
/>Android Support Library, revision 21.0.3</a> <em>(December 2014)</em>
</p>
<div class="toggle-content-toggleme">
@@ -203,7 +305,7 @@ page.title=Support Library
<li>Updated common user interface widgets to allow tinting via theme
attributes when running on pre-Android 5.0 devices</li>
<li>Added {@link android.support.v7.widget.SwitchCompat}, a backport
- of the {@link android.widget.Switch} widget that was added in
+ of the {@link android.widget.Switch} widget that was added in
Android 4.0 (API level 14).</li>
</ul>
</dd>
diff --git a/docs/html/tools/testing-support-library/index.jd b/docs/html/tools/testing-support-library/index.jd
new file mode 100644
index 0000000..c8c9ef5
--- /dev/null
+++ b/docs/html/tools/testing-support-library/index.jd
@@ -0,0 +1,629 @@
+page.title=Testing Support Library
+
+@jd:body
+
+ <div id="qv-wrapper">
+ <div id="qv">
+ <h2>
+ In this document
+ </h2>
+
+ <ol>
+ <li>
+ <a href="#features">Testing Support Library Features</a>
+ <ol>
+ <li>
+ <a href="#AndroidJUnitRunner">AndroidJUnitRunner</a>
+ </li>
+
+ <li>
+ <a href="#Espresso">Espresso</a>
+ </li>
+
+ <li>
+ <a href="#UIAutomator">UI Automator</a>
+ </li>
+ </ol>
+ </li>
+
+ <li>
+ <a href="#setup">Testing Support Library Setup</a>
+ </li>
+ </ol>
+
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}reference/android/support/test/package-summary.html">
+ Testing Support Library API Reference</a></li>
+ <li><a href="https://github.com/googlesamples/android-testing" class="external-link">
+ Code Samples</a></li>
+ </ol>
+ </div>
+ </div>
+
+ <p>
+ The Android Testing Support Library provides an extensive framework for testing Android apps.
+ This library provides a set of APIs that allow you to quickly build and run test code for
+ your apps, including JUnit 4 and functional user interface (UI) tests. You can run tests
+ created using these APIs from the <a href=
+ "{@docRoot}tools/studio/index.html">Android Studio IDE</a> or from the command line.
+ </p>
+
+ <p>The Android Testing Support library is available through the Android SDK Manager.
+ For more information, see <a href="#setup">Testing Support Library Setup</a>
+ </p>
+
+ <p>
+ This page provides information about what tools are provided in the Android Testing Support
+ Library, how to use them in your testing environment, and information about library releases.
+ </p>
+
+ <h2 id="features">
+ Testing Support Library Features
+ </h2>
+
+ <p>
+ The Android Testing Support Library includes the following test automation tools:
+ </p>
+
+ <ul>
+ <li>
+ <strong><a href="#AndroidJUnitRunner">AndroidJUnitRunner</a></strong>: JUnit 4-compatible
+ test runner for Android
+ </li>
+
+ <li>
+ <strong><a href="#Espresso">Espresso</a></strong>: UI testing framework; suitable for
+ functional UI testing within an app
+ </li>
+
+ <li>
+ <strong><a href="#UIAutomator">UI Automator</a></strong>: UI testing framework; suitable
+ for cross-app functional UI testing across system and installed apps
+ </li>
+ </ul>
+
+ <h3 id="AndroidJUnitRunner">
+ AndroidJUnitRunner
+ </h3>
+
+ <p>
+ The
+ <a href="{@docRoot}reference/android/support/test/runner/AndroidJUnitRunner.html">{@code AndroidJUnitRunner}</a>
+ class is a <a href="http://junit.org/" class="external-link">JUnit</a> test runner that lets you
+ run JUnit 3 or JUnit 4-style test classes on Android devices, including those using the
+ <a href="#Espresso">Espresso</a> and <a href="#UIAutomator">UI Automator</a> testing frameworks.
+ The test runner handles loading your test package and the app under test
+ to a device, running your tests, and reporting test results. This class replaces the {@link
+ android.test.InstrumentationTestRunner} class, which only supports JUnit 3 tests.
+ </p>
+
+ <p>
+ The key features of this test runner include:
+ </p>
+
+ <ul>
+ <li><a href="#ajur-junit">JUnit support</a>
+ </li>
+
+ <li><a href="#ajur-instrumentation">Access to instrumentation information</a>
+ </li>
+
+ <li><a href="#ajur-filtering">Test filtering</a>
+ </li>
+
+ <li><a href="#ajur-sharding">Test sharding</a>
+ </li>
+ </ul>
+
+ <p>Requires Android 2.2 (API level 8) or higher.</p>
+
+ <h4 id="ajur-junit">
+ JUnit support
+ </h4>
+
+ <p>
+ The test runner is compatible with your JUnit 3 and JUnit 4 (up to JUnit
+ 4.10) tests. However, you should avoid mixing JUnit 3 and and JUnit 4 test code in the same
+ package, as this might cause unexpected results. If you are creating an instrumented JUnit 4
+ test class to run on a device or emulator, your test class must be prefixed with the
+ {@code &#64;RunWith(AndroidJUnit4.class)} annotation.
+ </p>
+
+ <p>The following code snippet shows how you might write an instrumented JUnit 4 test to validate
+ that the <em>add</em> operation in the {@code CalculatorActivity} class works correctly.
+</p>
+
+<pre>
+import android.support.test.runner.AndroidJUnit4;
+import android.support.test.runner.AndroidJUnitRunner;
+import android.test.ActivityInstrumentationTestCase2;
+
+&#64;RunWith(AndroidJUnit4.class)
+public class CalculatorInstrumentationTest
+ extends ActivityInstrumentationTestCase2&lt;CalculatorActivity&gt; {
+
+ &#64;Before
+ public void setUp() throws Exception {
+ super.setUp();
+
+ // Injecting the Instrumentation instance is required
+ // for your test to run with AndroidJUnitRunner.
+ injectInstrumentation(InstrumentationRegistry.getInstrumentation());
+ mActivity = getActivity();
+ }
+
+ &#64;Test
+ public void typeOperandsAndPerformAddOperation() {
+ // Call the CalculatorActivity add() method and pass in some operand values, then
+ // check that the expected value is returned.
+ }
+
+ &#64;After
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
+</pre>
+
+ <h4 id="ajur-instrumentation">
+ Access to instrumentation information
+ </h4>
+
+ <p>
+ You can use the
+ <a href="{@docRoot}reference/android/support/test/InstrumentationRegistry.html">{@code InstrumentationRegistry}</a>
+ class to access information related to your
+ test run. This class includes the {@link android.app.Instrumentation} object, target app {@link
+ android.content.Context} object, test app {@link android.content.Context} object, and the
+ command line arguments passed into your test. This data is useful when you are writing tests
+ using the UI Automator framework or when writing tests that have dependencies on the {@link
+ android.app.Instrumentation} or {@link android.content.Context} objects.
+ </p>
+
+ <h4 id="ajur-filtering">
+ Test filtering
+ </h4>
+
+ <p>
+ In your JUnit 4.x tests, you can use annotations to configure the test run. This feature
+ minimizes the need to add boilerplate and conditional code in your tests. In addition to the
+ standard annotations supported by JUnit 4, the test runner also supports Android-specific
+ annotations, including:
+ </p>
+
+ <ul>
+ <li><a href="{@docRoot}reference/android/support/test/filters/RequiresDevice.html">{@code &#64;RequiresDevice}</a>:
+ Specifies that the test should run only on physical devices, not on emulators.
+ </li>
+
+ <li><a href="{@docRoot}reference/android/support/test/filters/SdkSuppress.html">{@code &#64;SdkSupress}</a>:
+ Suppresses the test from running on a lower Android API level than the given level. For
+ example, to suppress tests on all API levels lower than 18 from running, use the annotation
+ {@code &#64;SDKSupress(minSdkVersion=18)}.
+ </li>
+
+ <li>{@link android.test.suitebuilder.annotation.SmallTest &#64;SmallTest},
+ {@link android.test.suitebuilder.annotation.MediumTest &#64;MediumTest},
+ and {@link android.test.suitebuilder.annotation.LargeTest &#64;LargeTest}: Classify how long
+ a test should take to run, and consequently, how frequently you can run the test.
+ </li>
+ </ul>
+
+ <h4 id="ajur-sharding">
+ Test sharding
+ </h4>
+
+ <p>
+ The test runner supports splitting a single test suite into multiple
+ <em>shards</em>, so you can easily run tests belonging to the same shard together as a group,
+ under the same {@link android.app.Instrumentation} instance. Each shard is identified by an
+ index number. When running tests, use the {@code -e numShards} option to specify the number
+ of separate shards to create and the {@code -e shardIndex} option to specify which shard to
+ run.
+ </p>
+
+ <p>
+ For example, to split the test suite into 10 shards and run only the tests grouped in the
+ second shard, use the following command:
+ </p>
+
+ <pre>
+adb shell am instrument -w -e numShards 10 -e shardIndex 2</pre>
+
+ <p>
+ To learn more about using this test runner, see the
+ <a href="{@docRoot}reference/android/support/test/package-summary.html">API reference</a>.
+ </p>
+
+ <h3 id="Espresso">
+ Espresso
+ </h3>
+
+ <p>
+ The Espresso testing framework provides a set of APIs to build UI tests to test user flows
+ within an app. These APIs let you write automated UI tests that are concise and that run
+ reliably. Espresso is well-suited for writing <em>white box</em>-style automated tests, where
+ the test code utilizes implementation code details from the app under test.
+ </p>
+
+ <p>
+ The key features of the Espresso testing framework include:
+ </p>
+
+ <ul>
+ <li>Flexible APIs for view and adapter matching in target apps.
+ For more information, see <a href="#espresso-matching">View matching</a>.
+
+ <li>An extensive set of action APIs to automate UI interactions.
+ For more information, see <a href="#espresso-actions">Action APIs</a>.
+ </li>
+
+ <li>UI thread synchronization to improve test reliability.
+ For more information, see <a href="#espresso-thread-sync">UI thread synchronization</a>.
+ </li>
+ </ul>
+
+ <p>Requires Android 2.2 (API level 8) or higher.</p>
+
+ <h4 id="espresso-matching">
+ View matching
+ </h4>
+
+ <p>
+ The <a href="{@docRoot}reference/android/support/test/espresso/Espresso.html#onView(org.hamcrest.Matcher<android.view.View>)">{@code Espresso.onView()}</a>
+ method lets you access a UI component in the target app and
+ interact with it. The method accepts a
+ <a href="http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matcher.html"
+ class="external-link">{@code Matcher}</a> argument and searches the view
+ hierarchy to locate a corresponding {@link android.view.View} instance that meets some given
+ criteria. You can refine searches by specifying such criteria as:
+ </p>
+
+ <ul>
+ <li>The class name of the view
+ </li>
+
+ <li>The content description of the view
+ </li>
+
+ <li>The {@code R.id} of the view
+ </li>
+
+ <li>Text displayed in the view
+ </li>
+ </ul>
+
+ <p>
+ For example, to target a button that has the ID value of {@code my_button}, you can specify
+ a matcher like this:
+ </p>
+
+ <pre>
+onView(withId(R.id.my_button));</pre>
+
+ <p>
+ If the search is successful, the
+ <a href="{@docRoot}reference/android/support/test/espresso/Espresso.html#onView(org.hamcrest.Matcher<android.view.View>)">{@code onView()}</a>
+ method returns a reference which lets you
+ perform user actions and test assertions against the target view.
+ </p>
+
+ <h4>
+ Adapter matching
+ </h4>
+
+ <p>
+ In an {@link android.widget.AdapterView} layout, the layout is dynamically populated with
+ children views at runtime. If the target view is inside a layout subclassed from {@link
+ android.widget.AdapterView} (such as a {@link android.widget.ListView} or {@link
+ android.widget.GridView}), the
+ <a href="{@docRoot}reference/android/support/test/espresso/Espresso.html#onView(org.hamcrest.Matcher<android.view.View>)">{@code onView()}</a>
+ method might not work because only a subset of
+ the layout’s views may be loaded in the current view hierarchy.
+ </p>
+
+ <p>
+ Instead, use the <a href="{@docRoot}reference/android/support/test/espresso/Espresso.html#onData(org.hamcrest.Matcher<java.lang.Object>)">{@code Espresso.onData()}</a>
+ method to access a target view element. The <a href="{@docRoot}reference/android/support/test/espresso/Espresso.html#onData(org.hamcrest.Matcher<java.lang.Object>)">{@code Espresso.onData()}</a>
+ method returns a reference which lets you perform user actions and test assertions against the
+ elements in an {@link android.widget.AdapterView}.
+ </p>
+
+ <h4 id="espresso-actions">
+ Action APIs
+ </h4>
+
+ <p>
+ Typically, you test an app by performing some user interactions against the app’s user
+ interface. You can easily automate these actions in your test by using the
+ <a href="{@docRoot}reference/android/support/test/espresso/action/ViewActions.html">{@code ViewActions}</a>
+ API. You can perform such UI interactions as:
+ </p>
+
+ <ul>
+ <li>View clicks
+ </li>
+
+ <li>Swipes
+ </li>
+
+ <li>Key and button presses
+ </li>
+
+ <li>Typing text
+ </li>
+
+ <li>Opening a link
+ </li>
+ </ul>
+
+ <p>
+ For example, to simulate entering a string value and pressing a button to submit the value,
+ you can write an automated test script like this. The
+ <a href="{@docRoot}reference/android/support/test/espresso/ViewInteraction.html#perform(android.support.test.espresso.ViewAction...)">{@code ViewInteraction.perform()}</a>
+ and <a href="{@docRoot}reference/android/support/test/espresso/DataInteraction.html#perform(android.support.test.espresso.ViewAction...)">{@code DataInteraction.perform()}</a>
+ methods take one or more
+ <a href="{@docRoot}reference/android/support/test/espresso/ViewAction.html">{@code ViewAction}</a>
+ arguments and run the actions in the order provided.
+ </p>
+
+ <pre>
+// Type text into an EditText view, then close the soft keyboard
+onView(withId(R.id.editTextUserInput))
+ .perform(typeText(STRING_TO_BE_TYPED), closeSoftKeyboard());
+
+// Press the button to submit the text change
+onView(withId(R.id.changeTextBt)).perform(click());</pre>
+
+ <h4 id="espresso-thread-sync">
+ UI thread synchronization
+ </h4>
+
+ <p>
+ Tests on Android devices can fail randomly because of timing issues. This testing issue is
+ referred to as <em>test flakiness</em>. Prior to Espresso, the workaround was to insert a
+ sufficiently long sleep or timeout period into a test or to add code to keep retrying the
+ failing operation. The Espresso testing framework handles synchronization between the
+ {@link android.app.Instrumentation} and the UI thread; this removes the need for the previous
+ timing workarounds and ensures that your test actions and assertions run more reliably.
+ </p>
+
+ <p>
+ To learn more about using Espresso, see the
+ <a href="{@docRoot}reference/android/support/test/package-summary.html">API reference</a> and
+ <a href="{@docRoot}training/testing/ui-testing/espresso-testing.html">
+ Testing UI for a Single App</a> training.
+ </p>
+
+ <h3 id="UIAutomator">
+ UI Automator
+ </h3>
+
+ <p>
+ The UI Automator testing framework provides a set of APIs to build UI tests that perform
+ interactions on user apps and system apps. The UI Automator APIs allows you to perform
+ operations such as opening the Settings menu or the app launcher in a test device. The UI
+ Automator testing framework is well-suited for writing <em>black box</em>-style automated
+ tests, where the test code does not rely on internal implementation details of the target
+ app.
+ </p>
+
+ <p>
+ The key features of the UI Automator testing framework include:
+ </p>
+
+ <ul>
+ <li>A viewer to inspect layout hierarchy.
+ For more information, see <a href="#uia-viewer">UI Automator Viewer</a>.
+ </li>
+ <li>An API to retrieve state information and perform operations on the target device.
+ For more information, see <a href="#uia-device-state">Access to device state</a>.
+ </li>
+ <li>APIs that support cross-app UI testing.
+ For more information, see <a href="#uia-apis">UI Automator APIs</a> .
+ </li>
+ </ul>
+
+ <p>Requires Android 4.3 (API level 18) or higher.</p>
+
+ <h4 id="uia-viewer">
+ UI Automator Viewer
+ </h4>
+
+ <p>
+ The {@code uiautomatorviewer} tool provides a convenient GUI to scan and analyze the UI
+ components currently displayed on an Android device. You can use this tool to inspect the
+ layout hierarchy and view the properties of UI components that are visible on the foreground
+ of the device. This information lets you create more fine-grained tests using UI Automator,
+ for example by creating a UI selector that matches a specific visible property.
+ </p>
+
+ <p>
+ The {@code uiautomatorviewer} tool is located in the {@code &lt;android-sdk&gt;/tools/}
+ directory.
+ </p>
+
+ <h4 id="uia-device-state">
+ Access to device state
+ </h4>
+
+ <p>
+ The UI Automator testing framework provides a
+ <a href="{@docRoot}reference/android/support/test/uiautomator/UiDevice.html">{@code UiDevice}</a>
+ class to access and perform operations on the device on which the target app is running. You
+ can call its methods to access device properties such as current orientation or display size.
+ The <a href="{@docRoot}reference/android/support/test/uiautomator/UiDevice.html">{@code UiDevice}</a>
+ class also let you perform actions such as:
+ </p>
+
+ <ul>
+ <li>Change the device rotation
+ </li>
+
+ <li>Press a D-pad button
+ </li>
+
+ <li>Press the Back, Home, or Menu buttons
+ </li>
+
+ <li>Open the notification shade
+ </li>
+
+ <li>Take a screenshot of the current window
+ </li>
+ </ul>
+
+ <p>
+ For example, to simulate a Home button press, call the {@code UiDevice.pressHome()} method.
+ </p>
+
+ <h4 id="uia-apis">
+ UI Automator APIs
+ </h4>
+
+ <p>
+ The UI Automator APIs allow you to write robust tests without needing to know about the
+ implementation details of the app that you are targeting. You can use these APIs to capture
+ and manipulate UI components across multiple apps:
+ </p>
+
+ <ul>
+ <li><a href="{@docRoot}reference/android/support/test/uiautomator/UiCollection.html">{@code UiCollection}</a>:
+ Enumerates a container's UI elements for the purpose of counting,
+ or targeting sub-elements by their visible text or content-description property.
+ </li>
+
+ <li><a href="{@docRoot}reference/android/support/test/uiautomator/UiObject.html">{@code UiObject}</a>:
+ Represents a UI element that is visible on the device.
+ </li>
+
+ <li><a href="{@docRoot}reference/android/support/test/uiautomator/UiScrollable.html">{@code UiScrollable}</a>:
+ Provides support for searching for items in a scrollable UI container.
+ </li>
+
+ <li><a href="{@docRoot}reference/android/support/test/uiautomator/UiSelector.html">{@code UiSelector}</a>:
+ Represents a query for one or more target UI elements on a device.
+ </li>
+
+ <li><a href="{@docRoot}reference/android/support/test/uiautomator/Configurator.html">{@code Configurator}</a>:
+ Allows you to set key parameters for running UI Automator tests.
+ </li>
+ </ul>
+
+ <p>
+ For example, the following code shows how you can write a test script that brings up the
+ default app launcher in the device:
+ </p>
+
+ <pre>
+// Initialize UiDevice instance
+mDevice = UiDevice.getInstance(getInstrumentation());
+
+// Perform a short press on the HOME button
+mDevice().pressHome();
+
+// Bring up the default launcher by searching for
+// a UI component that matches the content-description for the launcher button
+UiObject allAppsButton = mDevice
+ .findObject(new UiSelector().description("Apps"));
+
+// Perform a click on the button to bring up the launcher
+allAppsButton.clickAndWaitForNewWindow();</pre>
+
+ <p>
+ To learn more about using UI Automator, see the
+ <a href="{@docRoot}reference/android/support/test/package-summary.html">API reference</a> and
+ <a href="{@docRoot}training/testing/ui-testing/uiautomator-testing.html">
+ Testing UI for Multiple Apps</a> training.
+ </p>
+
+ <h2 id="setup">
+ Testing Support Library Setup
+ </h2>
+
+ <p>
+ The Android Testing Support Library package is included with the latest version of the
+ Android Support Repository, which you can obtain as a supplemental download through the
+ Android SDK Manager.
+ </p>
+
+ <p>
+ To download the Android Support Repository through the SDK Manager:
+ </p>
+
+ <ol>
+ <li>Start the <a href="{@docRoot}tools/help/sdk-manager.html">Android SDK Manager</a>.
+ </li>
+
+ <li>In the SDK Manager window, scroll to the end of the <i>Packages</i> list, find the
+ <em>Extras</em> folder and, if necessary, expand to show its contents.
+ </li>
+
+ <li>Select the <strong>Android Support Repository</strong> item.
+ </li>
+
+ <li>Click the <strong>Install packages...</strong> button.
+ </li>
+ </ol>
+
+ <p>
+ After downloading, the tool installs the Support Repository files to your existing Android
+ SDK directory. The library files are located in the following subdirectory of your SDK:
+ {@code &lt;sdk&gt;/extras/android/m2repository} directory.
+ </p>
+
+ <p>
+ The Android Testing Support Library classes are located under the
+ {@code android.support.test} package.
+ </p>
+
+ <p>
+ To use the Android Testing Support Library in your Gradle project, add these dependencies in
+ your {@code build.gradle} file:
+ </p>
+
+ <pre>
+dependencies {
+ androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
+ // Set this dependency to build and run Espresso tests
+ androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0'
+ // Set this dependency to build and run UI Automator tests
+ androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.0.0'
+}</pre>
+
+ <p>To set
+<a href="{@docRoot}reference/android/support/test/runner/AndroidJUnitRunner.html">{@code AndroidJUnitRunner}</a>
+ as the default test instrumentation runner in your Gradle project, specify this dependency in
+ your {@code build.gradle} file:</p>
+
+ <pre>
+android {
+ defaultConfig {
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+}</pre>
+
+ <p>
+ It is strongly recommended that you use the Android Testing Support Library together with the
+ Android Studio IDE. Android Studio offers capabilities that support test
+ development, such as:
+ </p>
+
+ <ul>
+ <li>Flexible Gradle-based build system that supports dependency management for your test code
+ </li>
+
+ <li>Single project structure to contain your unit and instrumented test code together with
+ your app source code
+ </li>
+
+ <li>Support for deploying and running tests on virtual or physical devices, from a
+ command line or graphical user interface
+ </li>
+ </ul>
+
+ <p>
+ For more information about Android Studio and to download it, see
+ <a href="{@docRoot}sdk/index.html">Download Android Studio and SDK Tools</a>.
+ </p> \ No newline at end of file
diff --git a/docs/html/tools/testing/testing-tools.jd b/docs/html/tools/testing/testing-tools.jd
new file mode 100644
index 0000000..5e0a5bc
--- /dev/null
+++ b/docs/html/tools/testing/testing-tools.jd
@@ -0,0 +1,56 @@
+page.title=Android Testing Tools
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}training/testing.html">Best Practices for Testing</a></li>
+ </ol>
+</div>
+</div>
+
+ <p>
+ Testing is a critical software development activity because it helps you
+ improve the quality of your apps, ensure better user satisfaction, and
+ reduce overall development time spent on fixing defects.
+ </p>
+
+ <p>The following sections describe tools that help
+ you test your mobile apps for the Android platform.</a>
+
+<dl>
+ <dt><strong><a href="{@docRoot}tools/testing-support-library/index.html">Android
+ Testing Support Library</a></strong></dt>
+ <dd>This library provides a set of APIs that allow
+ you to quickly build and run test code for your apps, including JUnit 4 and functional user
+ interface (UI) tests. The Android Testing Support Library includes the following test automation
+ tools:
+
+ <ul>
+ <li><a href="{@docRoot}tools/testing-support-library/index.html#AndroidJUnitRunner">AndroidJUnitRunner</a>:
+ JUnit 4-compatible test runner for Android
+ </li>
+
+ <li><a href="{@docRoot}tools/testing-support-library/index.html#Espresso">Espresso</a>:
+ UI testing framework; suitable for functional UI testing within an app
+ </li>
+
+ <li><a href="{@docRoot}tools/testing-support-library/index.html#UIAutomator">UI Automator</a>:
+ UI testing framework; suitable for cross-app functional UI testing across system and installed apps
+ </li>
+ </ul>
+ </dd>
+
+ <dt><strong><a href="{@docRoot}tools/help/monkey.html">Monkey</a></strong></dt>
+ <dd>This tool 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 tool to stress-test applications that you are developing, in a random yet
+repeatable manner.
+ </dd>
+
+ <dt><strong><a href="{@docRoot}tools/help/monkeyrunner_concepts.html">monkeyrunner</a></strong></dt>
+ <dd>This testing system provides an API for writing programs that control an Android device or
+emulator from outside of Android code.</dd>
+
+</dl> \ No newline at end of file
diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs
index ab6c739..9ba7a22 100644
--- a/docs/html/tools/tools_toc.cs
+++ b/docs/html/tools/tools_toc.cs
@@ -165,39 +165,11 @@ class="en">Tools Help</span></a></div>
<li><a href="<?cs var:toroot ?>tools/help/lint.html">lint</span></a></li>
<li><a href="<?cs var:toroot ?>tools/help/logcat.html">logcat</a></li>
<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>
- <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>
- </ul>
- </li>
<li><a href="<?cs var:toroot ?>tools/help/proguard.html" zh-cn-lang="ProGuard">ProGuard</a></li>
<li><a href="<?cs var:toroot ?>tools/help/sdk-manager.html">SDK Manager</a></li>
<li><a href="<?cs var:toroot ?>tools/help/systrace.html">Systrace</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>
- <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>
- <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiAutomatorTestCase.html"><span class="en">UiAutomatorTestCase</span></a></li>
- <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiCollection.html"><span class="en">UiCollection</span></a></li>
- <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiDevice.html"><span class="en">UiDevice</span></a></li>
- <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiObject.html"><span class="en">UiObject</span></a></li>
- <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiObjectNotFoundException.html"><span class="en">UiObjectNotFoundException</span></a></li>
- <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiScrollable.html"><span class="en">UiScrollable</span></a></li>
- <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiSelector.html"><span class="en">UiSelector</span></a></li>
- <li><a href="<?cs var:toroot ?>tools/help/uiautomator/UiWatcher.html"><span class="en">UiWatcher</span></a></li>
- </ul>
- </li>
<li><a href="<?cs var:toroot ?>tools/help/zipalign.html">zipalign</a></li>
</ul>
</li>
@@ -221,6 +193,34 @@ class="en">MonkeyRunner</span></a></li>
</ul>
</li><!-- end of build system -->
+ <!-- Testing Tools menu-->
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/testing/testing-tools.html""><span class="en">Testing Tools</span></a></div>
+ <ul>
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/testing-support-library/index.html"><span
+class="en">Testing Support Library</span></a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>reference/android/support/test/package-summary.html">API Reference</a></li>
+ </ul>
+ </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>
+ <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>
+ </ul>
+ </li>
+ </ul>
+ </li><!-- end of testing support library -->
+
<!-- Support Library menu-->
@@ -249,6 +249,9 @@ class="en">Support Library</span></a></div>
<li><a href="<?cs var:toroot ?>tools/revisions/build-tools.html">
<span class="en">SDK Build Tools</span>
</a></li>
+ <li><a href="<?cs var:toroot ?>tools/revisions/gradle-plugin.html">
+ <span class="en">Android Plugin for Gradle</span>
+ </a></li>
<li><a href="<?cs var:toroot ?>tools/revisions/platforms.html">
<span class="en">SDK Platforms</span></a></li>
<li><a href="<?cs var:toroot ?>tools/sdk/eclipse-adt.html">