diff options
Diffstat (limited to 'docs/html/tools')
138 files changed, 17307 insertions, 439 deletions
diff --git a/docs/html/tools/building/building-cmdline.jd b/docs/html/tools/building/building-cmdline.jd index 6154d96..e0d0d3f 100644 --- a/docs/html/tools/building/building-cmdline.jd +++ b/docs/html/tools/building/building-cmdline.jd @@ -261,8 +261,18 @@ adb -s emulator-5554 install <em>path/to/your/app</em>.apk device:</p> <ul> - <li>Enable USB Debugging on your device. You can find the setting on most Android devices by - going to <strong>Settings > Applications > Development > USB debugging</strong>.</li> + <li>Enable <strong>USB debugging</strong> on your device. + <ul> + <li>On most devices running Android 3.2 or older, you can find the option under + <strong>Settings > Applications > Development</strong>.</li> + <li>On Android 4.0 and newer, it's in <strong>Settings > Developer options</strong>. + <p class="note"><strong>Note:</strong> On Android 4.2 and newer, <strong>Developer + options</strong> is hidden by default. To make it available, go + to <strong>Settings > About phone</strong> and tap <strong>Build number</strong> + seven times. Return to the previous screen to find <strong>Developer options</strong>.</p> + </li> + </ul> + </li> <li>Ensure that your development computer can detect your device when connected via USB</li> </ul> diff --git a/docs/html/tools/building/building-eclipse.jd b/docs/html/tools/building/building-eclipse.jd index c73fe97..304aa7e 100644 --- a/docs/html/tools/building/building-eclipse.jd +++ b/docs/html/tools/building/building-eclipse.jd @@ -84,8 +84,18 @@ parent.link=index.html <code>android:debuggable</code> attribute of the <code><application></code> element to <code>true</code>. As of ADT 8.0, this is done by default when you build in debug mode.</li> - <li>Enable USB Debugging on your device. You can find the setting on most Android devices by - going to <strong>Settings > Applications > Development > USB debugging</strong>.</li> + <li>Enable <strong>USB debugging</strong> on your device. + <ul> + <li>On most devices running Android 3.2 or older, you can find the option under + <strong>Settings > Applications > Development</strong>.</li> + <li>On Android 4.0 and newer, it's in <strong>Settings > Developer options</strong>. + <p class="note"><strong>Note:</strong> On Android 4.2 and newer, <strong>Developer + options</strong> is hidden by default. To make it available, go + to <strong>Settings > About phone</strong> and tap <strong>Build number</strong> + seven times. Return to the previous screen to find <strong>Developer options</strong>.</p> + </li> + </ul> + </li> <li>Ensure that your development computer can detect your device when connected via USB</li> </ul> diff --git a/docs/html/tools/debugging/debugging-ui.jd b/docs/html/tools/debugging/debugging-ui.jd index a5991ec..8ca5192 100644 --- a/docs/html/tools/debugging/debugging-ui.jd +++ b/docs/html/tools/debugging/debugging-ui.jd @@ -36,14 +36,14 @@ parent.link=index.html <li> <iframe title="Hierarchyviewer" width="210" height="160" - src="http://www.youtube.com/embed/PAgE7saQUUY?rel=0&hd=1" + src="//www.youtube.com/embed/PAgE7saQUUY?rel=0&hd=1" frameborder="0" allowfullscreen> </iframe> </li> <li> <iframe title="Pixel Perfect" width="210" height="160" - src="http://www.youtube.com/embed/C45bMZGdN7Y?rel=0&hd=1" + src="//www.youtube.com/embed/C45bMZGdN7Y?rel=0&hd=1" frameborder="0" allowfullscreen> </iframe> diff --git a/docs/html/tools/device.jd b/docs/html/tools/device.jd index d5fd581..9bdaf47 100644 --- a/docs/html/tools/device.jd +++ b/docs/html/tools/device.jd @@ -58,11 +58,17 @@ the <code><application></code> element.</p> <p class="note"><strong>Note:</strong> If you manually enable debugging in the manifest file, be sure to disable it before you build for release (your published application should usually <em>not</em> be debuggable).</p></li> - <li>Turn on "USB Debugging" on your device. - <p>On the device, go to <strong>Settings > Applications > Development</strong> - and enable <strong>USB debugging</strong> - (on an Android 4.0 device, the setting is -located in <strong>Settings > Developer options</strong>).</p> + <li>Enable <strong>USB debugging</strong> on your device. + <ul> + <li>On most devices running Android 3.2 or older, you can find the option under + <strong>Settings > Applications > Development</strong>.</li> + <li>On Android 4.0 and newer, it's in <strong>Settings > Developer options</strong>. + <p class="note"><strong>Note:</strong> On Android 4.2 and newer, <strong>Developer + options</strong> is hidden by default. To make it available, go + to <strong>Settings > About phone</strong> and tap <strong>Build number</strong> + seven times. Return to the previous screen to find <strong>Developer options</strong>.</p> + </li> + </ul> </li> <li>Set up your system to detect your device. <ul> @@ -105,7 +111,17 @@ rules</a>.</p> </li> </ol> -<p>When plugged in over USB, can verify that your device is connected by executing <code>adb + +<p class="note"><strong>Note:</strong> When you connect a device running Android 4.2.2 or higher +to your computer, the system shows a dialog asking whether to accept an RSA key that allows +debugging through this computer. This security mechanism protects user devices because it ensures +that USB debugging and other adb commands cannot be executed unless you're able to unlock the +device and acknowledge the dialog. This requires that you have adb version 1.0.31 (available with +SDK Platform-tools r16.0.1 and higher) in order to debug on a device running Android 4.2.2 or +higher.</p> + + +<p>When plugged in over USB, you can verify that your device is connected by executing <code>adb devices</code> from your SDK {@code platform-tools/} directory. If connected, you'll see the device name listed as a "device."</p> @@ -197,6 +213,10 @@ above.</p> <td><code>22b8</code></td> </tr> <tr> + <td>MTK</td> + <td><code>0e8d</code></td> + </tr> + <tr> <td>NEC</td> <td><code>0409</code></td> </tr> diff --git a/docs/html/tools/extras/oem-usb.jd b/docs/html/tools/extras/oem-usb.jd index f7aa192..774fe87 100644 --- a/docs/html/tools/extras/oem-usb.jd +++ b/docs/html/tools/extras/oem-usb.jd @@ -211,7 +211,7 @@ 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 publisher site), a Nexus One, or a Nexus S, then you need +(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> @@ -292,16 +292,21 @@ href="http://www.kttech.co.kr/cscenter/download05.asp">http://www.kttech.co.kr/c </td> </tr> <tr> - <td>Lenevo</td> + <td>Lenovo</td> <td><a href="http://developer.lenovomm.com/developer/download.jsp" >http://developer.lenovomm.com/developer/download.jsp</a> </td> </tr> <tr><td>LGE</td> <td><a href="http://www.lg.com/us/mobile-phones/mobile-support/mobile-lg-mobile-phone-support.jsp">http://www.lg.com/us/mobile-phones/mobile-support/mobile-lg-mobile-phone-support.jsp</a></td> -</tr><tr><td>Motorola</td> <td><a +</tr> +<tr><td>Motorola</td> <td><a href="http://developer.motorola.com/docstools/USB_Drivers/">http://developer.motorola.com/docstools/USB_Drivers/</a></td> -</tr><tr><td>Pantech</td> <td><a +</tr> +<tr><td>MTK</td> <td><a +href="http://online.mediatek.com/Public%20Documents/MTK_Android_USB_Driver.zip">http://online.mediatek.com/Public%20Documents/MTK_Android_USB_Driver.zip</a></td> +</tr> +<tr><td>Pantech</td> <td><a href="http://www.isky.co.kr/cs/software/software.sky?fromUrl=index">http://www.isky.co.kr/cs/software/software.sky?fromUrl=index</a></td> </tr><tr><td>Pegatron</td> <td><a href="http://www.pegatroncorp.com/download/New_Duke_PC_Driver_0705.zip">http://www.pegatroncorp.com/download/New_Duke_PC_Driver_0705.zip</a> (ZIP download)</td> @@ -311,8 +316,8 @@ href="http://www.samsung.com/us/support/downloads">http://www.samsung.com/us/sup href="http://k-tai.sharp.co.jp/support/">http://k-tai.sharp.co.jp/support/</a></td> </tr><tr><td>SK Telesys</td> <td><a href="http://www.sk-w.com/service/wDownload/wDownload.jsp">http://www.sk-w.com/service/wDownload/wDownload.jsp</a></td></tr><tr> -<td>Sony Ericsson</td> <td><a -href="http://developer.sonyericsson.com/wportal/devworld/search-downloads/driver?cc=gb&lc=en">http://developer.sonyericsson.com/wportal/devworld/search-downloads/driver?cc=gb&lc=en</a></td></tr> +<td>Sony Mobile Communications</td> <td><a +href="http://developer.sonymobile.com/downloads/drivers/">http://developer.sonymobile.com/downloads/drivers/</a></td></tr> <tr><td>Teleepoch</td> <td><a href="http://www.teleepoch.com/android.html">http://www.teleepoch.com/android.html</a></td> diff --git a/docs/html/tools/extras/support-library.jd b/docs/html/tools/extras/support-library.jd index b1e2ea0..08ac172 100644 --- a/docs/html/tools/extras/support-library.jd +++ b/docs/html/tools/extras/support-library.jd @@ -46,52 +46,75 @@ by the directory name, such as {@code v4/} and {@code v13/}.</p> <p>The sections below provide notes about successive releases of the Support Package, as denoted by revision number.</p> -<script type="text/javascript"> -function toggleDiv(link) { - var toggleable = $(link).parent(); - if (toggleable.hasClass("closed")) { - //$(".toggleme", toggleable).slideDown("fast"); - toggleable.removeClass("closed"); - toggleable.addClass("open"); - $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + -"assets/images/triangle-opened.png")); - } else { - //$(".toggleme", toggleable).slideUp("fast"); - toggleable.removeClass("open"); - toggleable.addClass("closed"); - $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + -"assets/images/triangle-closed.png")); - } - return false; -} -</script> -<style> -.toggleable { -padding: 5px 0 0; -} -.toggleme { - padding: 10px 0 0 20px; -} -.toggleable a { - text-decoration:none; -} -.toggleme a { - text-decoration:underline; -} -.toggleable.closed .toggleme { - display:none; -} -#jd-content .toggle-img { - margin:0 5px 3px 0; -} -</style> +<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="" +/>Support Package, revision 11</a> <em>(November 2012)</em> + </p> + <div class="toggle-content-toggleme"> + <dl> + <dt>Changes for v4 support library:</dt> + <dd> + <ul> + <li>User Interface + <ul> + <li>Added support for nested {@link android.support.v4.app.Fragment} classes.</li> + <li>Added improvements to {@link android.support.v4.app.FragmentManager} debugging. + </li> + <li>Fixed problem in {@link android.support.v4.app.FragmentTabHost} where fragment + and tab interaction could result in a {@link android.widget.ListView} state loss. + </li> + <li>Fixed issue with user-visible hint in + {@link android.support.v4.app.FragmentStatePagerAdapter}.</li> + <li>Added {@link android.support.v4.view.ViewPager.PageTransformer PageTransformer} + interface to {@link android.support.v4.view.ViewPager} to allow applications to + supply a custom transition behavior for scrolling.</li> + <li>Added new features and fixes to {@link android.support.v4.app.TaskStackBuilder} + from current release.</li> + <li>Fixed {@link android.support.v4.view.PagerTitleStrip} to correctly track the + {@link android.support.v4.view.PagerAdapter} currently in use.</li> + <li>Fixed display flickering, positioning, and text clipping problems with + {@link android.support.v4.view.PagerTitleStrip}.</li> + <li>Fixed {@link android.support.v4.view.PagerTabStrip} to properly respect padding + when drawing an underline.</li> + </ul> + </li> + <li>Accessibility + <ul> + <li>Added support for new accessibility gesture and touch event types in + {@link android.support.v4.view.accessibility.AccessibilityEventCompat}.</li> + <li>Added support for new accessibility APIs in + {@link android.support.v4.view.ViewCompat}.</li> + <li>Added support for {@link android.support.v4.view.ViewCompat#performAccessibilityAction + performAccessibilityAction()} method to {@link android.support.v4.view.ViewCompat}. + </li> + </ul> + </li> + <li>Added support for gestures with {@link android.support.v4.view.GestureDetectorCompat}. + </li> + <li>Added support for performing atomic operations on files using a new + {@link android.support.v4.util.AtomicFile} class.</li> + <li>Added support for the full set of {@code make} methods in + {@link android.support.v4.content.IntentCompat}.</li> + <li>Added {@link android.support.v4.util.LruCache#trimToSize trimToSize()} method in + {@link android.support.v4.util.LruCache} utility class.</li> + <li>Updated {@link android.support.v4.net.ConnectivityManagerCompat} to get NetworkInfo + from a {@link android.net.ConnectivityManager#CONNECTIVITY_ACTION} + broadcast.</li> + </ul> + </dd> + </dl> + </div> +</div> + -<div class="toggleable opened"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" +<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="" />Support Package, revision 10</a> <em>(August 2012)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -105,11 +128,12 @@ padding: 5px 0 0; </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<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="" />Support Package, revision 9</a> <em>(June 2012)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -173,11 +197,12 @@ isActiveNetworkMetered()} method.</li> </div> </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<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="" />Support Package, revision 8</a> <em>(April 2012)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -194,11 +219,12 @@ isActiveNetworkMetered()} method.</li> </div> </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<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="" />Support Package, revision 7</a> <em>(March 2012)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -209,7 +235,7 @@ attributing shared data to the source app. This class also provides compatible i new {@link android.widget.ShareActionProvider} in Android 4.0.</li> <li>Added {@link android.support.v4.app.NavUtils} and {@link android.support.v4.app.TaskStackBuilder} to provide support for implementing the -<a href="{@docRoot}design/index.html">Android Design</a> guidelines for navigation. These +<a href="{@docRoot}design/index.html">Android Design</a> guidelines for navigation. These additions include a way to implement the action bar's <em>Up</em> button across versions. For an example implementation of this pattern, see the AppNavigation sample in ({@code <em><sdk></em>/samples/<em><platform></em>/AppNavigation}).</li> @@ -222,11 +248,12 @@ for creating standardized system notifications.</li> </div> </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<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="" />Support Package, revision 6</a> <em>(December 2011)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <p class="note"><strong>Note:</strong> Reference for support library APIs are now available with the framework references, for example: {@link android.support.v4.app}.</p> @@ -274,11 +301,12 @@ for creating standardized system notifications.</li> </div> </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<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="" />Support Package, revision 5</a> <em>(December 2011)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -332,11 +360,12 @@ for creating standardized system notifications.</li> </div> </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<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="" />Support Package, revision 4</a> <em>(October 2011)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -373,11 +402,12 @@ for creating standardized system notifications.</li> </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<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="" />Compatibility Package, revision 3</a> <em>(July 2011)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 support library:</dt> <dd> @@ -423,11 +453,12 @@ Android 3.2 and higher (all other APIs in the v4 library are already available w </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<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="" />Compatibility Package, revision 2</a> <em>(May 2011)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <dl> <dt>Changes for v4 library:</dt> <dd> @@ -442,11 +473,12 @@ Android 3.2 and higher (all other APIs in the v4 library are already available w </div> -<div class="toggleable closed"> - <a href="#" onclick="return toggleDiv(this)"> - <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" +<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="" />Compatibility Package, revision 1</a> <em>(March 2011)</em> - <div class="toggleme"> + </p> + <div class="toggle-content-toggleme"> <p>Initial release with the v4 library.</p> </div> </div> diff --git a/docs/html/tools/help/adb.jd b/docs/html/tools/help/adb.jd index d44d54b..c8afca5 100644 --- a/docs/html/tools/help/adb.jd +++ b/docs/html/tools/help/adb.jd @@ -5,32 +5,27 @@ parent.link=index.html <div id="qv-wrapper"> <div id="qv"> - <h2>ADB quickview</h2> - <ul> -<li>Manage the state of an emulator or device</li> -<li>Run shell commands on a device</li> -<li>Manage port forwarding on an emulator or device</li> -<li>Copy files to/from an emulator or device</li> - </ul> - <h2>In this document</h2> - <ol> -<li><a href="#issuingcommands">Issuing ADB Commands</a></li> -<li><a href="#devicestatus">Querying for Emulator/Device Instances</a></li> -<li><a href="#directingcommands">Directing Commands to a Specific Emulator/Device Instance</a></li> -<li><a href="#move">Installing an Application</a></li> -<li><a href="#forwardports">Forwarding Ports</a></li> -<li><a href="#copyfiles">Copying Files to or from an Emulator/Device Instance</a></li> -<li><a href="#commandsummary">Listing of adb Commands </a></li> -<li><a href="#shellcommands">Issuing Shell Commands</a></li> -<li><a href="#logcat">Enabling Logcat Logging</a></li> -<li><a href="#stopping">Stopping the adb Server</a></li> - </ol> - - <h2>See also</h2> - <ol> - <li><a href="emulator.html">Emulator</a></li> - </ol> +<ol> + <li><a href="#issuingcommands">Syntax</a></li> + <li><a href="#commandsummary">Commands</a></li> + <li><a href="#devicestatus">Querying for Emulator/Device Instances</a></li> + <li><a href="#directingcommands">Directing Commands to a Specific Emulator/Device Instance</a></li> + <li><a href="#move">Installing an Application</a></li> + <li><a href="#forwardports">Forwarding Ports</a></li> + <li><a href="#copyfiles">Copying Files to or from an Emulator/Device Instance</a></li> + <li><a href="#shellcommands">Issuing Shell Commands</a> + <ol> + <li><a href="#am">Using activity manager (am)</a></li> + <li><a href="#pm">Using package manager (pm)</a></li> + <li><a href="#sqlite">Examining sqlite3 databases from a remote shell</a></li> + <li><a href="#monkey">UI/Application Exerciser Monkey</a></li> + <li><a href="#othershellcommands">Other shell commands</a></li> + </ol> + </li> + <li><a href="#logcat">Enabling logcat logging</a></li> + <li><a href="#stopping">Stopping the adb server</a></li> +</ol> </div> </div> @@ -40,14 +35,20 @@ emulator instance or connected Android-powered device. It is a client-server pro three components: </p> <ul> - <li>A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients. </li> - <li>A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device. </li> + <li>A client, which runs on your development machine. You can invoke a client from a shell +by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create +adb clients. </li> + <li>A server, which runs as a background process on your development machine. The server +manages communication between the client and the adb daemon running on an emulator or device. </li> <li>A daemon, which runs as a background process on each emulator or device instance. </li> </ul> <p>You can find the {@code adb} tool in {@code <sdk>/platform-tools/}.</p> -<p>When you start an adb client, the client first checks whether there is an adb server process already running. If there isn't, it starts the server process. When the server starts, it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb clients use port 5037 to communicate with the adb server. </p> +<p>When you start an adb client, the client first checks whether there is an adb server +process already running. If there isn't, it starts the server process. When the server starts, +it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb +clients use port 5037 to communicate with the adb server. </p> <p>The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port. Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections. For example: </p> @@ -55,127 +56,49 @@ three components: </p> Emulator 1, console: 5554<br/> Emulator 1, adb: 5555<br> Emulator 2, console: 5556<br> -Emulator 2, adb: 5557 ... +Emulator 2, adb: 5557<br> +and so on... </p> -<p>As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554. </p> - -<p>Once the server has set up connections to all emulator instances, you can use adb commands to control and access those instances. Because the server manages connections to emulator/device instances and handles commands from multiple adb clients, you can control any emulator/device instance from any client (or from a script).</p> +<p>As shown, the emulator instance connected to adb on port 5555 is the same as the instance +whose console listens on port 5554. </p> -<p>The sections below describe the commands that you can use to access adb capabilities and manage the state of an emulator/device. Note that if you are developing Android applications in Eclipse and have installed the ADT plugin, you do not need to access adb from the command line. The ADT plugin provides a transparent integration of adb into the Eclipse IDE. However, you can still use adb directly as necessary, such as for debugging.</p> +<p>Once the server has set up connections to all emulator instances, you can use adb commands to +access those instances. Because the server manages connections to emulator/device +instances and handles commands from multiple adb clients, you can control any emulator/device +instance from any client (or from a script).</p> -<a name="issuingcommands"></a> -<h2>Issuing adb Commands</h2> +<p class="note"><strong>Note:</strong> When you connect a device running Android 4.2.2 or higher +to your computer, the system shows a dialog asking whether to accept an RSA key that allows +debugging through this computer. This security mechanism protects user devices because it ensures +that USB debugging and other adb commands cannot be executed unless you're able to unlock the +device and acknowledge the dialog. This requires that you have adb version 1.0.31 (available with +SDK Platform-tools r16.0.1 and higher) in order to debug on a device running Android 4.2.2 or +higher.</p> -<p>You can issue adb commands from a command line on your development machine or from a script. The usage is: </p> - <pre>adb [-d|-e|-s <serialNumber>] <command> </pre> +<h2 id="issuingcommands">Syntax</h2> -<p>When you issue a command, the program invokes an adb client. The client is not specifically associated with any emulator instance, so if multiple emulators/devices are running, you need to use the <code>-d</code> option to specify the target instance to which the command should be directed. For more information about using this option, see <a href="#directingcommands">Directing Commands to a Specific Emulator/Device Instance</a>. </p> +<p>You can issue adb commands from a command line on your development machine or from a script. +The usage is: </p> -<a name="devicestatus"></a> +<pre class="no-pretty-print"> +adb [-d|-e|-s <serialNumber>] <command> +</pre> -<h2>Querying for Emulator/Device Instances</h2> +<p>If there's only one emulator running or only one device connected, the adb command is +sent to that device by default. If multiple emulators are running and/or multiple devices are +attached, you need to use the <code>-d</code>, <code>-e</code>, or <code>-s</code> +option to specify the target device to which the command should be directed. </p> -<p>Before issuing adb commands, it is helpful to know what emulator/device instances are connected to the adb server. You can generate a list of attached emulators/devices using the <code>devices</code> command: </p> - - <pre>adb devices</pre> -<p>In response, adb prints this status information for each instance:</p> -<ul> - <li>Serial number — A string created by adb to uniquely identify an emulator/device instance by its - console port number. The format of the serial number is <code><type>-<consolePort></code>. - Here's an example serial number: <code>emulator-5554</code></li> - <li>State — The connection state of the instance may be one of the following: - <ul> - <li><code>offline</code> — the instance is not connected to adb or is not responding.</li> - <li><code>device</code> — the instance is now connected to the adb server. Note that this state does not - imply that the Android system is fully booted and operational, since the instance connects to adb - while the system is still booting. However, after boot-up, this is the normal operational state of - an emulator/device instance.</li> - <li><code>no device</code> — there is no emulator/device connected. - </ul> - </li> -</ul> - -<p>The output for each instance is formatted like this: </p> - - <pre>[serialNumber] [state]</pre> - -<p>Here's an example showing the <code>devices</code> command and its output:</p> - - <pre>$ adb devices -List of devices attached -emulator-5554 device -emulator-5556 device -emulator-5558 device</pre> - - - -<a name="directingcommands"></a> - -<h2>Directing Commands to a Specific Emulator/Device Instance</h2> - -<p>If multiple emulator/device instances are running, you need to specify a target instance when issuing adb commands. To so so, use the <code>-s</code> option in the commands. The usage for the <code>-s</code> option is:</p> - - <pre>adb -s <serialNumber> <command> </pre> - -<p>As shown, you specify the target instance for a command using its adb-assigned serial number. You can use the <code>devices</code> command to obtain the serial numbers of running emulator/device instances. </p> - -<p>Here is an example: </p> - - <pre>adb -s emulator-5556 install helloWorld.apk</pre> - -<p>Note that, if you issue a command without specifying a target emulator/device instance using <code>-s</code>, adb generates an error. - -<a name="move"></a> - -<h2>Installing an Application</h2> -<p>You can use adb to copy an application from your development computer and install it on an emulator/device instance. To do so, use the <code>install</code> command. With the command, you must specify the path to the .apk file that you want to install:</p> - -<pre>adb install <path_to_apk></pre> - -<p>For more information about how to create an .apk file that you can install on an emulator/device -instance, see <a href="{@docRoot}tools/building/index.html">Building and Running</a></p> - -<p>Note that, if you are using the Eclipse IDE and have the ADT plugin installed, you do not need to use adb (or aapt) directly to install your application on the emulator/device. Instead, the ADT plugin handles the packaging and installation of the application for you. </p> - - -<a name="forwardports"></a> - -<h2>Forwarding Ports</h2> - - <p>You can use the <code>forward</code> command to set up arbitrary port forwarding — forwarding of requests on a specific host port to a different port on an emulator/device instance. Here's how you would set up forwarding of host port 6100 to emulator/device port 7100:</p> -<pre>adb forward tcp:6100 tcp:7100</pre> - <p>You can also use adb to set up forwarding to named abstract UNIX domain sockets, as illustrated here:</p> -<pre>adb forward tcp:6100 local:logd </pre> - -<a name="copyfiles"></a> - -<h2>Copying Files to or from an Emulator/Device Instance</h2> - -<p>You can use the adb commands <code>pull</code> and <code>push</code> to copy files to and from an emulator/device instance's data file. Unlike the <code>install</code> command, which only copies an .apk file to a specific location, the <code>pull</code> and <code>push</code> commands let you copy arbitrary directories and files to any location in an emulator/device instance. </p> - -<p>To copy a file or directory (recursively) <em>from</em> the emulator or device, use</p> -<pre>adb pull <remote> <local></pre> - -<p>To copy a file or directory (recursively) <em>to</em> the emulator or device, use</p> - <pre>adb push <local> <remote></pre> - -<p>In the commands, <code><local></code> and <code><remote></code> refer to the paths to the target files/directory on your development machine (local) and on the emulator/device instance (remote).</p> - -<p>Here's an example: </p> -<pre>adb push foo.txt /sdcard/foo.txt</pre> - -<a name="commandsummary"></a> - -<h2>Listing of adb Commands</h2> +<h2 id="commandsummary">Commands</h2> <p>The table below lists all of the supported adb commands and explains their meaning and usage. </p> - +<p class="table-caption"><strong>Table 1.</strong> Available adb commands</p> <table> <tr> <th>Category</th> @@ -185,7 +108,7 @@ instance, see <a href="{@docRoot}tools/building/index.html">Building and Running </tr> <tr> -<td rowspan="3">Options</td> +<td rowspan="3">Target Device</td> <td><code>-d</code></td> <td>Direct an adb command to the only attached USB device.</td> <td>Returns an error if more than one USB device is attached.</td> @@ -200,7 +123,8 @@ instance, see <a href="{@docRoot}tools/building/index.html">Building and Running <tr> <td><code>-s <serialNumber></code></td> <td>Direct an adb command a specific emulator/device instance, referred to by its adb-assigned serial number (such as "emulator-5556").</td> -<td>If not specified, adb generates an error.</td> +<td>See <a href="#directingcommands">Directing +Commands to a Specific Emulator/Device Instance</a>.</td> </tr> <tr> @@ -224,7 +148,7 @@ instance, see <a href="{@docRoot}tools/building/index.html">Building and Running <tr> <td rowspan="3">Debug</td> -<td ><code>logcat [<option>] [<filter-specs>]</code></td> +<td ><code>logcat [option] [filter-specs]</code></td> <td>Prints log data to the screen. </td> <td> </td> </tr> @@ -247,7 +171,7 @@ instance, see <a href="{@docRoot}tools/building/index.html">Building and Running <tr> <td rowspan=3">Data</td> <td><code>install <path-to-apk></code></td> -<td>Pushes an Android application (specified as a full path to an .apk file) to the data file of an emulator/device. </td> +<td>Pushes an Android application (specified as a full path to an .apk file) to an emulator/device. </td> <td> </td> </tr> @@ -303,11 +227,11 @@ instance, see <a href="{@docRoot}tools/building/index.html">Building and Running <td><code>wait-for-device</code></td> <td>Blocks execution until the device is online — that is, until the instance state is <code>device</code>.</td> <td>You can prepend this command to other adb commands, in which case adb will wait until the emulator/device instance is connected before issuing the other commands. Here's an example: -<pre>adb wait-for-device shell getprop</pre> +<pre class="no-pretty-print">adb wait-for-device shell getprop</pre> Note that this command does <em>not</em> cause adb to wait until the entire system is fully booted. For that reason, you should not prepend it to other commands that require a fully booted system. As an example, the <code>install</code> requires the Android package manager, which is available only after the system is fully booted. A command such as -<pre>adb wait-for-device install <app>.apk</pre> +<pre class="no-pretty-print">adb wait-for-device install <app>.apk</pre> would issue the <code>install</code> command as soon as the emulator or device instance connected to the adb server, but before the Android system was fully booted, so it would result in an error. </td> </tr> @@ -337,40 +261,841 @@ would issue the <code>install</code> command as soon as the emulator or device i </tr> <tr> -<td><code>shell [<shellCommand>]</code></td> +<td><code>shell [shellCommand]</code></td> <td>Issues a shell command in the target emulator/device instance and then exits the remote shell.</td> </tr> </table> -<a name="shellcommands"></a> -<h2>Issuing Shell Commands</h2> -<p>Adb provides an ash shell that you can use to run a variety of commands on an emulator -or device. The command binaries are stored in the file system of the emulator or device, -in this location: </p> -<pre>/system/bin/...</pre> -<p>You can use the <code>shell</code> command to issue commands, with or without entering the adb remote shell on the emulator/device. </p> -<p>To issue a single command without entering a remote shell, use the <code>shell</code> command like this: </p> - <pre>adb [-d|-e|-s {<serialNumber>}] shell <shellCommand></pre> + + +<h2 id="devicestatus">Querying for Emulator/Device Instances</h2> + +<p>Before issuing adb commands, it is helpful to know what emulator/device instances are connected to the adb server. You can generate a list of attached emulators/devices using the <code>devices</code> command: </p> + + <pre class="no-pretty-print">adb devices</pre> + +<p>In response, adb prints this status information for each instance:</p> + +<ul> + <li>Serial number — A string created by adb to uniquely identify an emulator/device instance by its + console port number. The format of the serial number is <code><type>-<consolePort></code>. + Here's an example serial number: <code>emulator-5554</code></li> + <li>State — The connection state of the instance may be one of the following: + <ul> + <li><code>offline</code> — the instance is not connected to adb or is not responding.</li> + <li><code>device</code> — the instance is now connected to the adb server. Note that this state does not + imply that the Android system is fully booted and operational, since the instance connects to adb + while the system is still booting. However, after boot-up, this is the normal operational state of + an emulator/device instance.</li> + <li><code>no device</code> — there is no emulator/device connected. + </ul> + </li> +</ul> + +<p>The output for each instance is formatted like this: </p> + + <pre class="no-pretty-print">[serialNumber] [state]</pre> + +<p>Here's an example showing the <code>devices</code> command and its output:</p> + + <pre class="no-pretty-print">adb devices +List of devices attached +emulator-5554 device +emulator-5556 device +emulator-5558 device</pre> + + + + + + +<h2 id="directingcommands">Directing Commands to a Specific Emulator/Device Instance</h2> + +<p>If multiple emulator/device instances are running, you must specify a target instance +when issuing adb commands. To do so, use the <code>-s</code> option in the commands. The usage +for the <code>-s</code> option is:</p> + + <pre class="no-pretty-print">adb -s <serialNumber> <command> </pre> + +<p>As shown, you specify the target instance for a command using its adb-assigned serial number. +You can use the <code>devices</code> command to obtain the serial numbers of running +emulator/device instances. For example: </p> + + <pre class="no-pretty-print">adb -s emulator-5556 install helloWorld.apk</pre> + +<p>Note that, if you issue a command without specifying a target emulator/device instance +while multiple devices are available, adb generates an error. + +<p>If you have multiple devices available (hardware or emulated), but only one is an emulator, +simply use the {@code -e} option to send commands to the emulator. Likewise if there's multiple +devices but only one hardware device attached, use the {@code -d} option to send commands to +the hardware device. + + + + +<h2 id="move">Installing an Application</h2> +<p>You can use adb to copy an application from your development computer and install it on an emulator/device instance. To do so, use the <code>install</code> command. With the command, you must specify the path to the .apk file that you want to install:</p> + +<pre class="no-pretty-print">adb install <path_to_apk></pre> + +<p>For more information about how to create an .apk file that you can install on an emulator/device +instance, see <a href="{@docRoot}tools/building/index.html">Building and Running</a></p> + +<p>Note that, if you are using the Eclipse IDE and have the ADT plugin installed, you do not need to use adb (or aapt) directly to install your application on the emulator/device. Instead, the ADT plugin handles the packaging and installation of the application for you. </p> + + + + + + +<h2 id="forwardports">Forwarding Ports</h2> + + <p>You can use the <code>forward</code> command to set up arbitrary port forwarding — forwarding of requests on a specific host port to a different port on an emulator/device instance. Here's how you would set up forwarding of host port 6100 to emulator/device port 7100:</p> +<pre class="no-pretty-print">adb forward tcp:6100 tcp:7100</pre> + <p>You can also use adb to set up forwarding to named abstract UNIX domain sockets, as illustrated here:</p> +<pre class="no-pretty-print">adb forward tcp:6100 local:logd </pre> + + + + + +<h2 id="copyfiles">Copying Files to or from an Emulator/Device Instance</h2> + +<p>You can use the adb commands <code>pull</code> and <code>push</code> to copy files to +and from an emulator/device instance. Unlike the <code>install</code> command, +which only copies an APK file to a specific location, the <code>pull</code> and <code>push</code> +commands let you copy arbitrary directories and files to any location in an +emulator/device instance. </p> + +<p>To copy a file or directory (and its sub-directories) <em>from</em> the emulator or device, use</p> +<pre class="no-pretty-print">adb pull <remote> <local></pre> + +<p>To copy a file or directory (and its sub-directories) <em>to</em> the emulator or device, use</p> + <pre class="no-pretty-print">adb push <local> <remote></pre> + +<p>In the commands, <code><local></code> and <code><remote></code> refer to the +paths to the target files/directory on your development machine (local) and on the +emulator/device instance (remote). For example: </p> +<pre class="no-pretty-print">adb push foo.txt /sdcard/foo.txt</pre> + + + + + + + + + +<h2 id="shellcommands">Issuing Shell Commands</h2> + +<p>Adb provides a Unix shell that you can use to run a variety of commands on an emulator +or connected device. The command binaries are stored in the file system of the emulator or device, +at <code>/system/bin/...</code> + +<p>Two of the most common command tools are <a href="#am">activity manager</a> ({@code am}) and +<a href="#pm">package manager</a> ({@code pm}).</p> + +<p>You can use the <code>shell</code> command to issue commands, with or without entering +the adb remote shell on the emulator/device. To issue a single command without entering a +remote shell, use the <code>shell</code> command like this: </p> + + <pre class="no-pretty-print">adb [-d|-e|-s <serialNumber>] shell <shell_command></pre> -<p>To drop into a remote shell on a emulator/device instance, use the <code>shell</code> command like this:</p> +<p>Or enter a remote shell on an emulator/device like this:</p> + + <pre class="no-pretty-print">adb [-d|-e|-s <serialNumber>] shell</pre> + +<p>When you are ready to exit the remote shell, press CTRL+D or type +<code>exit</code>. </p> + + + + + +<h3 id="am">Using activity manager (am)</h3> + +<p>Within an adb shell, you can issue commands with the activity manager ({@code am}) tool to +perform various system actions, such as start an activity, force-stop a process, +broadcast an intent, modify the device screen properties, and more. While in a shell, +the syntax is:</p> +<pre class="no-pretty-print"> +am <command> +</pre> + +<p>You can also issue an activity manager command directly from adb +without entering a remote shell. For example:</p> +<pre class="no-pretty-print"> +adb shell am start -a android.intent.action.VIEW +</pre> + + +<p class="table-caption"><strong>Table 2.</strong> Available activity manager commands</p> +<table> +<tr> + <th>Command</th> + <th>Description</th> +</tr> + +<tr> +<td><code> +start [options] <INTENT> +</code></td> +<td>Start an {@link android.app.Activity} specified by {@code <INTENT>}. <p>See the +<a href="#IntentSpec">Specification for <INTENT> arguments</a>. +<p>Options are: +<ul> + <li>{@code -D}: Enable debugging. + <li>{@code -W}: Wait for launch to complete. + <li>{@code --start-profiler <FILE>}: Start profiler and send results to {@code <FILE>}. + <li>{@code -P <FILE>}: Like <code>--start-profiler</code>, + but profiling stops when the app goes idle. + <li>{@code -R}: Repeat the activity launch {@code <COUNT>} times. Prior to each repeat, + the top activity will be finished. + <li>{@code -S}: Force stop the target app before starting the activity. + <li>{@code --opengl-trace}: Enable tracing of OpenGL functions. + <li>{@code --user <USER_ID> | current}: Specify which user to run as; if not + specified, then run as the current user. +</ul> +</td> +</tr> + +<tr> +<td><code> +startservice [options] <INTENT> +</code></td> +<td>Start the {@link android.app.Service} specified by {@code <INTENT>}. <p>See the +<a href="#IntentSpec">Specification for <INTENT> arguments</a>. +<p>Options are: +<ul> + <li>{@code --user <USER_ID> | current}: Specify which user to run as; if not + specified, then run as the current user. +</ul> +</td> +</tr> + +<tr> +<td><code> +force-stop <PACKAGE> +</code></td> +<td>Force stop everything associated with {@code <PACKAGE>} (the app's package name). +</td> +</tr> + +<tr> +<td><code> +kill [options] <PACKAGE> +</code></td> +<td> Kill all processes associated with {@code <PACKAGE>} + (the app's package name). This command kills only + processes that are safe to kill and that will not impact the user + experience. + <p>Options are: + <ul> + <li>{@code --user <USER_ID> | all | current}: Specify user whose processes to kill; + all users if not specified. + </ul> +</td> +</tr> + +<tr> +<td><code> +kill-all +</code></td> +<td>Kill all background processes. +</td> +</tr> + +<tr> +<td><code> +broadcast [options] <INTENT> +</code></td> +<td>Issue a broadcast intent. <p>See the +<a href="#IntentSpec">Specification for <INTENT> arguments</a>. +<p>Options are: +<ul> + <li>{@code [--user <USER_ID> | all | current]}: Specify which user to send to; if not + specified then send to all users. +</ul> +</td> +</tr> + +<tr> +<td><code> +instrument [options] <COMPONENT> +</code></td> +<td>Start monitoring with an {@link android.app.Instrumentation} instance. + Typically the target {@code <COMPONENT>} + is the form {@code <TEST_PACKAGE>/<RUNNER_CLASS>}. <p>Options are: +<ul> + <li>{@code -r}: Print raw results (otherwise decode + {@code <REPORT_KEY_STREAMRESULT>}). Use with + {@code [-e perf true]} to generate raw output for performance measurements. + + <li>{@code -e <NAME> <VALUE>}: Set argument {@code <NAME>} to {@code <VALUE>}. + For test runners a common form is {@code + -e <testrunner_flag> <value>[,<value>...]}. + + <li>{@code -p <FILE>}: Write profiling data to {@code <FILE>}. + + <li>{@code -w}: Wait for instrumentation to finish before returning. Required for + test runners. + + <li>{@code --no-window-animation}: Turn off window animations while running. + <li>{@code --user <USER_ID> | current}: Specify which user instrumentation runs in; + current user if not specified. +</ul> + +</td> +</tr> + +<tr> +<td><code> +profile start <PROCESS> <FILE> +</code></td> +<td>Start profiler on {@code <PROCESS>}, write results to {@code <FILE>}. +</td> +</tr> + +<tr> +<td><code> +profile stop <PROCESS> +</code></td> +<td>Stop profiler on {@code <PROCESS>}. +</td> +</tr> + +<tr> +<td style="white-space:nowrap"><code> +dumpheap [options] <PROCESS> <FILE> +</code></td> +<td>Dump the heap of {@code <PROCESS>}, write to {@code <FILE>}. <p>Options are: +<ul> + <li>{@code --user [<USER_ID>|current]}: When supplying a process name, + specify user of process to dump; uses current user if not specified. + <li>{@code -n}: Dump native heap instead of managed heap. +</ul> +</td> +</tr> + +<tr> +<td><code> +set-debug-app [options] <PACKAGE> +</code></td> +<td>Set application {@code <PACKAGE>} to debug. <p>Options are: +<ul> + <li>{@code -w}: Wait for debugger when application starts. + <li>{@code --persistent}: Retain this value. +</ul> +</td> +</tr> + +<tr> +<td><code> +clear-debug-app +</code></td> +<td>Clear the package previous set for debugging with {@code set-debug-app}. +</td> +</tr> + +<tr> +<td><code> +monitor [options] +</code></td> +<td>Start monitoring for crashes or ANRs. <p>Options are: +<ul> + <li>{@code --gdb}: Start gdbserv on the given port at crash/ANR. +</ul> +</td> +</tr> + +<tr> +<td><code> +screen-compat [on|off] <PACKAGE> +</code></td> +<td>Control <a href="{@docRoot}guide/practices/screen-compat-mode.html">screen +compatibility</a> mode of {@code <PACKAGE>}.</p> +</td> +</tr> + +<tr> +<td><code> +display-size [reset|<WxH>] +</code></td> +<td>Override emulator/device display size. +This command is helpful for testing your app across different screen sizes by mimicking a small +screen resolution using a device with a large screen, and vice versa. +<p>Example:<br><code>am display-size 1280x800</code> +</td> +</tr> + +<tr> +<td><code> +display-density <dpi> +</code></td> +<td>Override emulator/device display density. +This command is helpful for testing your app across different screen densities on high-density +screen environment using a low density screen, and vice versa. +<p>Example:<br><code>am display-density 480</code> +</td> +</tr> + +<tr> +<td><code> +to-uri <INTENT> +</code></td> +<td>Print the given intent specification as a URI. <p>See the +<a href="#IntentSpec">Specification for <INTENT> arguments</a>. +</td> +</tr> + +<tr> +<td><code> +to-intent-uri <INTENT> +</code></td> +<td>Print the given intent specification as an {@code intent:} URI. <p>See the +<a href="#IntentSpec">Specification for <INTENT> arguments</a>. +</td> +</tr> +</table> + + + + + +<h4 id="IntentSpec"> + <a href="" class="expandable" onclick="toggleExpandable(this,'.intents'); +return false">Specification for <INTENT> arguments</a></h4> + +<div class="intents" style="display:none"> + +<p>For activity manager commands that take a {@code <INTENT>} argument, you can +specify the intent with the following options:</p> + +<dl> + <dt>{@code -a <ACTION>}</dt> + <dd>Specify the intent action, such as "android.intent.action.VIEW". + You can declare this only once. + + <dt>{@code -d <DATA_URI>}</dt> + <dd>Specify the intent data URI, such as "content://contacts/people/1". + You can declare this only once. + + <dt>{@code -t <MIME_TYPE>}</dt> + <dd>Specify the intent MIME type, such as "image/png". + You can declare this only once. + + <dt>{@code -c <CATEGORY>}</dt> + <dd>Specify an intent category, such as "android.intent.category.APP_CONTACTS". + + <dt>{@code -n <COMPONENT>}</dt> + <dd>Specify the component name with package name prefix to create an explicit intent, such + as "com.example.app/.ExampleActivity". + + <dt>{@code -f <FLAGS>}</dt> + <dd>Add flags to the intent, as supported by {@link + android.content.Intent#setFlags setFlags()}. + + <dt>{@code --esn <EXTRA_KEY>}</dt> + <dd>Add a null extra. This option is not supported for URI intents. + + <dt>{@code -e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE>}</dt> + <dd>Add string data as a key-value pair. + + <dt>{@code --ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE>}</dt> + <dd>Add boolean data as a key-value pair. + + <dt>{@code --ei <EXTRA_KEY> <EXTRA_INT_VALUE>}</dt> + <dd>Add integer data as a key-value pair. + + <dt>{@code --el <EXTRA_KEY> <EXTRA_LONG_VALUE>}</dt> + <dd>Add long data as a key-value pair. + + <dt>{@code --ef <EXTRA_KEY> <EXTRA_FLOAT_VALUE>}</dt> + <dd>Add float data as a key-value pair. + + <dt>{@code --eu <EXTRA_KEY> <EXTRA_URI_VALUE>}</dt> + <dd>Add URI data as a key-value pair. + + <dt>{@code --ecn <EXTRA_KEY> <EXTRA_COMPONENT_NAME_VALUE>}</dt> + <dd>Add a component name, which is converted and passed as + a {@link android.content.ComponentName} object. + + <dt>{@code --eia <EXTRA_KEY> <EXTRA_INT_VALUE>[,<EXTRA_INT_VALUE...]}</dt> + <dd>Add an array of integers. + + <dt>{@code --ela <EXTRA_KEY> <EXTRA_LONG_VALUE>[,<EXTRA_LONG_VALUE...]}</dt> + <dd>Add an array of longs. + + <dt>{@code --efa <EXTRA_KEY> <EXTRA_FLOAT_VALUE>[,<EXTRA_FLOAT_VALUE...]}</dt> + <dd>Add an array of floats. + + <dt>{@code --grant-read-uri-permission}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_GRANT_READ_URI_PERMISSION}. + + <dt>{@code --grant-write-uri-permission}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_GRANT_WRITE_URI_PERMISSION}. + + <dt>{@code --debug-log-resolution}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_DEBUG_LOG_RESOLUTION}. + + <dt>{@code --exclude-stopped-packages}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_EXCLUDE_STOPPED_PACKAGES}. + + <dt>{@code --include-stopped-packages}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_INCLUDE_STOPPED_PACKAGES}. + + <dt>{@code --activity-brought-to-front}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_BROUGHT_TO_FRONT}. + + <dt>{@code --activity-clear-top}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}. + + <dt>{@code --activity-clear-when-task-reset}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET}. + + <dt>{@code --activity-exclude-from-recents}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS}. + + <dt>{@code --activity-launched-from-history}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY}. + + <dt>{@code --activity-multiple-task}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK}. + + <dt>{@code --activity-no-animation}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_NO_ANIMATION}. + + <dt>{@code --activity-no-history}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_NO_HISTORY}. + + <dt>{@code --activity-no-user-action}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_NO_USER_ACTION}. + + <dt>{@code --activity-previous-is-top}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_PREVIOUS_IS_TOP}. + + <dt>{@code --activity-reorder-to-front}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_REORDER_TO_FRONT}. + + <dt>{@code --activity-reset-task-if-needed}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_RESET_TASK_IF_NEEDED}. + + <dt>{@code --activity-single-top}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_SINGLE_TOP}. + + <dt>{@code --activity-clear-task}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TASK}. + + <dt>{@code --activity-task-on-home}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_ACTIVITY_TASK_ON_HOME}. + + <dt>{@code --receiver-registered-only}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_RECEIVER_REGISTERED_ONLY}. + + <dt>{@code --receiver-replace-pending}</dt> + <dd>Include the flag {@link android.content.Intent#FLAG_RECEIVER_REPLACE_PENDING}. + + <dt>{@code --selector}</dt> + <dd>Requires the use of {@code -d} and {@code -t} options to set the intent data and type. + + <dt>{@code <URI> <COMPONENT> <PACKAGE>}</dt> + <dd>You can directly specify a URI, package name, and component name when not qualified + by one of the above options. When an argument is unqualified, the tool assumes the argument + is a URI if it contains a ":" (colon); it assumes the argument is a component name if it + contains a "/" (forward-slash); otherwise it assumes the argument is a package name. + +</dl> +</div><!-- end 'intents' --> +<script> + $(window).hashchange( function(){ + if ((location.hash == "#IntentSpec") && !($("#IntentSpec a").hasClass("expanded"))) { + $("#IntentSpec a").click(); + } + }); +</script> + + + +<h3 id="pm">Using package manager (pm)</h3> + +<p>Within an adb shell, you can issue commands with the package manager ({@code pm}) tool to +perform actions and queries on application packages installed on the device. While in a shell, +the syntax is:</p> +<pre class="no-pretty-print"> +pm <command> +</pre> + +<p>You can also issue a package manager command directly from adb +without entering a remote shell. For example:</p> +<pre class="no-pretty-print"> +adb shell pm uninstall com.example.MyApp +</pre> + +<p class="table-caption"><strong>Table 3.</strong> Available package manager commands.</p> +<table> +<tr> + <th>Command</th> + <th>Description</th> +</tr> + +<tr> +<td><code> +list packages [options] <FILTER> +</code></td> +<td>Prints all packages, optionally only + those whose package name contains the text in {@code <FILTER>}. <p>Options: +<ul> + <li>{@code -f}: See their associated file. + <li>{@code -d}: Filter to only show disabled packages. + <li>{@code -e}: Filter to only show enabled packages. + <li>{@code -s}: Filter to only show system packages. + <li>{@code -3}: Filter to only show third party packages. + <li>{@code -i}: See the installer for the packages. + <li>{@code -u}: Also include uninstalled packages. + <li>{@code --user <USER_ID>}: The user space to query. +</ul> +</td> +</tr> + +<tr> +<td><code> +list permission-groups +</code></td> +<td>Prints all known permission groups. +</td> +</tr> + +<tr> +<td><code> +list permissions [options] <GROUP> +</code></td> +<td>Prints all known permissions, optionally only + those in {@code <GROUP>}. <p>Options: +<ul> + <li>{@code -g}: Organize by group. + <li>{@code -f}: Print all information. + <li>{@code -s}: Short summary. + <li>{@code -d}: Only list dangerous permissions. + <li>{@code -u}: List only the permissions users will see. +</ul> +</td> +</tr> - <pre>adb [-d|-e|-s {<serialNumber>}] shell</pre> +<tr> +<td><code> +list instrumentation +</code></td> +<td>List all test packages. <p>Options: + <ul> + <li>{@code -f}: List the APK file for the test package. + <li>{@code <TARGET_PACKAGE>}: List test packages for only this app. + </ul> +</td> +</tr> -<p>When you are ready to exit the remote shell, use <code>CTRL+D</code> or <code>exit</code> to end the shell session. </p> +<tr> +<td><code> +list features +</code></td> +<td>Prints all features of the system. +</td> +</tr> -<p>The sections below provide more information about shell commands that you can use.</p> - -<a name="sqlite" id="sqlite"></a> +<tr> +<td><code> +list libraries +</code></td> +<td>Prints all the libraries supported by the current device. +</td> +</tr> -<h3>Examining sqlite3 Databases from a Remote Shell</h3> +<tr> +<td><code> +list users +</code></td> +<td>Prints all users on the system. +</td> +</tr> + +<tr> +<td><code> +path <PACKAGE> +</code></td> +<td>Print the path to the APK of the given {@code <PACKAGE>}. +</td> +</tr> + +<tr> +<td><code> +install [options] <PATH> +</code></td> +<td>Installs a package (specified by {@code <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 <INSTALLER_PACKAGE_NAME>}: Specify the installer package name. + <li>{@code -s}: Install package on the shared mass storage (such as sdcard). + <li>{@code -f}: Install package on the internal system memory. + <li>{@code -d}: Allow version code downgrade. + </ul> +</td> +</tr> + +<tr> +<td><code> +uninstall [options] <PACKAGE> +</code></td> +<td>Removes a package from the system. <p>Options: + <ul> + <li>{@code -k}: Keep the data and cache directories around after package removal. + </ul> +</td> +</tr> + +<tr> +<td><code> +clear <PACKAGE> +</code></td> +<td>Deletes all data associated with a package. +</td> +</tr> + +<tr> +<td><code> +enable <PACKAGE_OR_COMPONENT> +</code></td> +<td>Enable the given package or component (written as "package/class"). +</td> +</tr> + +<tr> +<td><code> +disable <PACKAGE_OR_COMPONENT> +</code></td> +<td>Disable the given package or component (written as "package/class"). +</td> +</tr> + +<tr> +<td style="white-space:nowrap"><code> +disable-user [options] <PACKAGE_OR_COMPONENT> +</code></td> +<td><p>Options: + <ul> + <li>{@code --user <USER_ID>}: The user to disable. + </ul> +</td> +</tr> + +<tr> +<td><code> +grant <PACKAGE_PERMISSION> +</code></td> +<td>Grant permissions + to applications. Only optional permissions the application has + declared can be granted. +</td> +</tr> + +<tr> +<td><code> +revoke <PACKAGE_PERMISSION> +</code></td> +<td>Revoke permissions + to applications. Only optional permissions the application has + declared can be revoked. +</td> +</tr> + +<tr> +<td><code> +set-install-location <LOCATION> +</code></td> +<td>Changes the default install location. Location values: +<ul> + <li>{@code 0}: Auto—Let system decide the best location. + <li>{@code 1}: Internal—install on internal device storage. + <li>{@code 2}: External—install on external media. +</ul> +<p class="note"><strong>Note:</strong> This is only intended for debugging; using this can cause + applications to break and other undesireable behavior.</p> +</td> +</tr> + +<tr> +<td><code> +get-install-location +</code></td> +<td>Returns the current install location. Return values: +<ul> + <li>{@code 0 [auto]}: Lets system decide the best location + <li>{@code 1 [internal]}: Installs on internal device storage + <li>{@code 2 [external]}: Installs on external media +</ul> +</td> +</tr> + +<tr> +<td><code> +set-permission-enforced <PERMISSION> [true|false] +</code></td> +<td>Specifies whether the given permission should be enforced. +</td> +</tr> + +<tr> +<td><code> +trim-caches <DESIRED_FREE_SPACE> +</code></td> +<td>Trim cache files to reach the given free space. +</td> +</tr> + +<tr> +<td><code> +create-user <USER_NAME> +</code></td> +<td>Create a new user with the given {@code <USER_NAME>}, + printing the new user identifier of the user. +</td> +</tr> + +<tr> +<td><code> +remove-user <USER_ID> +</code></td> +<td>Remove the user with the given {@code <USER_IDENTIFIER>}, + deleting all data associated with that user +</td> +</tr> + +<tr> +<td><code> +get-max-users +</code></td> +<td>Prints the maximum number of users supported by the device. +</td> +</tr> + +</table> + + + + + + + +<h3 id="sqlite">Examining sqlite3 databases from a remote shell</h3> <p>From an adb remote shell, you can use the <a href="http://www.sqlite.org/sqlite.html">sqlite3</a> command-line program to @@ -384,7 +1109,7 @@ The tool also gives you the ability to execute SQLite commands on the fly.</p> <p>Here's an example: </p> -<pre>$ adb -s emulator-5554 shell +<pre class="no-pretty-print">adb -s emulator-5554 shell # sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db SQLite version 3.3.12 Enter ".help" for instructions @@ -394,34 +1119,40 @@ sqlite> .exit </pre> <p>Once you've invoked <code>sqlite3</code>, you can issue <code>sqlite3</code> commands in the shell. To exit and return to the adb remote shell, use <code>exit</code> or <code>CTRL+D</code>. -<a name="monkey"></a> -<h3>UI/Application Exerciser Monkey</h3> + + + +<h3 id="monkey">UI/Application Exerciser Monkey</h3> <p>The Monkey is a program that 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.</p> -<p>The simplest way to use the monkey is with the following command, which will launch your -application and send 500 pseudo-random events to it.</p> +<p>The simplest way to use the monkey is with the following command, which launches your +application and sends 500 pseudo-random events to it.</p> -<pre>$ adb shell monkey -v -p your.package.name 500</pre> +<pre class="no-pretty-print">adb shell monkey -v -p your.package.name 500</pre> <p>For more information about command options for Monkey, see the complete <a href="{@docRoot}tools/help/monkey.html" title="monkey">UI/Application Exerciser Monkey</a> documentation page.</p> -<a name="othershellcommands"></a> -<h3>Other Shell Commands</h3> -<p>The table below lists several of the adb shell commands available. For a complete list of commands and programs, start an emulator instance and use the <code>adb -help</code> command. </p> -<pre>adb shell ls /system/bin</pre> +<h3 id="othershellcommands">Other shell commands</h3> + +<p>For a list of all the available shell programs, use the following command:</p> + +<pre class="no-pretty-print">adb shell ls /system/bin</pre> <p>Help is available for most of the commands. </p> +<p>Table 4 lists some of the more common adb shell commands.</p> + +<p class="table-caption"><strong>Table 4.</strong> Some other adb shell commands</p> <table> <tr> <th>Shell Command</th> @@ -442,8 +1173,8 @@ application and send 500 pseudo-random events to it.</p> </tr> <tr> -<td><code>logcat [<option>]... [<filter-spec>]...</code></td> -<td>Enables radio logging and prints output to the screen. </td> +<td><code>logcat [option]... [filter-spec]...</code></td> +<td>Enables system and app logging and prints output to the screen. </td> </tr> <tr> @@ -464,39 +1195,47 @@ application and send 500 pseudo-random events to it.</p> </tr> </table> + + + + + + + <a name="stdout"></a> <a name="usinglogcat"></a> <a name="outputformat"></a> <a name="filteringoutput"></a> <a name="stdout"></a> <a name="logcatoptions"></a> -<a name="logcat"></a> -<h2>Enabling logcat Logging</h2> +<h2 id="logcat">Enabling logcat logging</h2> <p>The Android logging system provides a mechanism for collecting and viewing system debug output. Logs from various applications and portions of the system are collected in a series of circular buffers, which then can be viewed and filtered by the <code>logcat</code> command.</p> <p>You can use the <code>logcat</code> command to view and follow the contents of the system's log buffers. The general usage is:</p> -<pre>[adb] logcat [<option>] ... [<filter-spec>] ...</pre> +<pre class="no-pretty-print">[adb] logcat [option] ... [filter-spec] ...</pre> <p>You can use the <code>logcat</code> command from your development computer or from a remote adb shell in an emulator/device instance. To view log output in your development computer, you use</p> -<pre>$ adb logcat</pre> +<pre class="no-pretty-print">adb logcat</pre> <p>and from a remote adb shell you use</p> -<pre># logcat</pre> +<pre class="no-pretty-print">logcat</pre> <p>See <a href="{@docRoot}tools/debugging/debugging-log.html">Reading and Writing Logs</a> for complete information about logcat commend options and filter specifications.</p> -<a name="stopping"></a> -<h2>Stopping the adb Server</h2> + + +<h2 id="stopping">Stopping the adb server</h2> <p>In some cases, you might need to terminate the adb server process and then restart it. For example, if adb does not respond to a command, you can terminate the server and restart it and that may resolve the problem. </p> -<p>To stop the adb server, use the <code>kill-server</code>. You can then restart the server by issuing any adb command. </p> +<p>To stop the adb server, use the <code>kill-server</code> command. +You can then restart the server by issuing any other adb command. </p> diff --git a/docs/html/tools/help/android.jd b/docs/html/tools/help/android.jd index 282c791..19891e8 100644 --- a/docs/html/tools/help/android.jd +++ b/docs/html/tools/help/android.jd @@ -280,7 +280,7 @@ and may be out of date. For the most current list of options, execute <code>andr </tr> <tr> - <td rowspan="3"><code>create-test-project</code></td> + <td rowspan="3"><code>create test-project</code></td> <td><code>-n <name></code></td> @@ -306,7 +306,7 @@ and may be out of date. For the most current list of options, execute <code>andr </tr> <tr> - <td rowspan="2"><code>update-test-project</code></td> + <td rowspan="2"><code>update test-project</code></td> <td><code>-p <path></code></td> @@ -324,7 +324,7 @@ and may be out of date. For the most current list of options, execute <code>andr </tr> <tr> - <td rowspan="4"><code>create-lib-project</code></td> + <td rowspan="4"><code>create lib-project</code></td> <td><code>-k <packageName></code></td> @@ -358,7 +358,7 @@ and may be out of date. For the most current list of options, execute <code>andr </tr> <tr> - <td rowspan="3"><code>update-lib-project</code></td> + <td rowspan="3"><code>update lib-project</code></td> <td><code>-p <path></code></td> @@ -382,6 +382,30 @@ and may be out of date. For the most current list of options, execute <code>andr <td></td> </tr> + + <tr> + <td rowspan="3"><code>create uitest-project</code></td> + <td><code>-n <name></code></td> + <td>The name of the UI test project</td> + <td></td> + </tr> + + <tr> + <td><code>-t <name></code></td> + + <td>Target ID of the UI test project</td> + + <td>Required</td> + </tr> + + <tr> + <td><code>-p <path></code></td> + + <td>Location path of the UI test project</td> + + <td>Required</td> + </tr> + </table> <h3>Update actions</h3> diff --git a/docs/html/tools/help/jobb.jd b/docs/html/tools/help/jobb.jd index d390ac9..97f0942 100644 --- a/docs/html/tools/help/jobb.jd +++ b/docs/html/tools/help/jobb.jd @@ -8,7 +8,7 @@ page.title=JOBB Level 9) or higher. OBB files are used to provide additional file assets for Android applications (such as graphics, sounds and video), separate from an application's APK file. For more information on using expansion files, see - <a href="{@docRoot}guide/google/play/expansion-files.html">APK Expansion Files</a>.</p> + <a href="{@docRoot}google/play/expansion-files.html">APK Expansion Files</a>.</p> <h2 id="usage">Usage</h2> diff --git a/docs/html/tools/help/proguard.jd b/docs/html/tools/help/proguard.jd index 1da94ba..be0b8dc 100644 --- a/docs/html/tools/help/proguard.jd +++ b/docs/html/tools/help/proguard.jd @@ -39,7 +39,7 @@ parent.link=index.html 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 when your application utilizes features that are sensitive to security like when you are - <a href="{@docRoot}guide/google/play/licensing/index.html">Licensing Your Applications</a>.</p> + <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 diff --git a/docs/html/tools/help/sdk-manager.jd b/docs/html/tools/help/sdk-manager.jd index 4852b21..215ce6f 100644 --- a/docs/html/tools/help/sdk-manager.jd +++ b/docs/html/tools/help/sdk-manager.jd @@ -7,6 +7,8 @@ page.title=SDK Manager <p>You can launch the SDK Manager in one of the following ways:</p> <ul> + <li>From Eclipse (with <a href="{@docRoot}tools/help/adt.html">ADT</a>), + select <strong>Window</strong> > <strong>Android SDK Manager</strong>.</li> <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 diff --git a/docs/html/tools/help/uiautomator/IAutomationSupport.jd b/docs/html/tools/help/uiautomator/IAutomationSupport.jd new file mode 100644 index 0000000..4120f2b --- /dev/null +++ b/docs/html/tools/help/uiautomator/IAutomationSupport.jd @@ -0,0 +1,168 @@ +page.title=IAutomationSupport +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> + +<h2>Class Overview</h2> +<p>Provides auxiliary support for running test cases + +</p> + + + + + +</div><!-- jd-descr --> + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + abstract + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#sendStatus(int, android.os.Bundle)">sendStatus</a></span>(int resultCode, Bundle status) + + <div class="jd-descrdiv">Allows the running test cases to send out interim status</div> + + </td></tr> + + + +</table> + + + + + + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="sendStatus(int, android.os.Bundle)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + abstract + + void + </span> + <span class="sympad">sendStatus</span> + <span class="normal">(int resultCode, Bundle status)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Allows the running test cases to send out interim status</p></div> + + </div> +</div> + + + diff --git a/docs/html/tools/help/uiautomator/UiAutomatorTestCase.jd b/docs/html/tools/help/uiautomator/UiAutomatorTestCase.jd new file mode 100644 index 0000000..48c63ba --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiAutomatorTestCase.jd @@ -0,0 +1,1402 @@ +page.title=UiAutomatorTestCase +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<h2>Class Overview</h2> +<p>UI automation tests should extend this class. This class provides access + to the following: +<ul> +<li><code><a href="UiDevice.html">UiDevice</a></code> instance</li> +<li>Bundle for command line parameters</li> +</ul> +</p> + + + + + +</div><!-- jd-descr --> + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiAutomatorTestCase()">UiAutomatorTestCase</a></span>() + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="IAutomationSupport.html">IAutomationSupport</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getAutomationSupport()">getAutomationSupport</a></span>() + + <div class="jd-descrdiv">Provides support for running tests to report interim status</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Bundle + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getParams()">getParams</a></span>() + + <div class="jd-descrdiv">Get command line parameters.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiDevice.html">UiDevice</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getUiDevice()">getUiDevice</a></span>() + + <div class="jd-descrdiv">Get current instance of <code><a href="UiDevice.html">UiDevice</a></code>.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#sleep(long)">sleep</a></span>(long ms) + + <div class="jd-descrdiv">Calls <code><a href="null#sleep(long)">sleep(long)</a></code> to sleep</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-junit.framework.TestCase" class="jd-expando-trigger closed" + ><img id="inherited-methods-junit.framework.TestCase-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + junit.framework.TestCase + +<div id="inherited-methods-junit.framework.TestCase"> + <div id="inherited-methods-junit.framework.TestCase-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-junit.framework.TestCase-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">countTestCases</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getName</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + TestResult + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">run</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">run</span>(TestResult arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">runBare</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">setName</span>(String arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-junit.framework.Assert" class="jd-expando-trigger closed" + ><img id="inherited-methods-junit.framework.Assert-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + junit.framework.Assert + +<div id="inherited-methods-junit.framework.Assert"> + <div id="inherited-methods-junit.framework.Assert-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-junit.framework.Assert-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(short arg0, short arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, int arg1, int arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, short arg1, short arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(char arg0, char arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, String arg1, String arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(int arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, double arg1, double arg2, double arg3) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, long arg1, long arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(byte arg0, byte arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(Object arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(boolean arg0, boolean arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, float arg1, float arg2, float arg3) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, boolean arg1, boolean arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, String arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(float arg0, float arg1, float arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, byte arg1, byte arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(double arg0, double arg1, double arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, char arg1, char arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertEquals</span>(long arg0, long arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertFalse</span>(String arg0, boolean arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertFalse</span>(boolean arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNotNull</span>(String arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNotNull</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNotSame</span>(Object arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNotSame</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNull</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertNull</span>(String arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertSame</span>(Object arg0, Object arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertSame</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertTrue</span>(String arg0, boolean arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">assertTrue</span>(boolean arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">fail</span>(String arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">fail</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">failNotEquals</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">failNotSame</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">failSame</span>(String arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + static + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">format</span>(String arg0, Object arg1, Object arg2) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-junit.framework.Test" class="jd-expando-trigger closed" + ><img id="inherited-methods-junit.framework.Test-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From interface + + junit.framework.Test + +<div id="inherited-methods-junit.framework.Test"> + <div id="inherited-methods-junit.framework.Test-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-junit.framework.Test-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + abstract + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">countTestCases</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + abstract + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">run</span>(TestResult arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiAutomatorTestCase()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiAutomatorTestCase</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="getAutomationSupport()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="IAutomationSupport.html">IAutomationSupport</a> + </span> + <span class="sympad">getAutomationSupport</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Provides support for running tests to report interim status</p></div> + + </div> +</div> + + +<a id="getParams()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + Bundle + </span> + <span class="sympad">getParams</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Get command line parameters. On the command line when passing <code>-e key value</code> + pairs, the Bundle will have the key value pairs conveniently available to the + tests. +</p></div> + + </div> +</div> + + +<a id="getUiDevice()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiDevice.html">UiDevice</a> + </span> + <span class="sympad">getUiDevice</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Get current instance of <code><a href="UiDevice.html">UiDevice</a></code>. Works similar to calling the static + <code><a href="UiDevice.html#getInstance()">getInstance()</a></code> from anywhere in the test classes. +</p></div> + + </div> +</div> + + +<a id="sleep(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">sleep</span> + <span class="normal">(long ms)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Calls <code><a href="null#sleep(long)">sleep(long)</a></code> to sleep</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>ms</th> + <td>is in milliseconds. +</td> + </tr> + </table> + </div> + + </div> +</div> + diff --git a/docs/html/tools/help/uiautomator/UiCollection.jd b/docs/html/tools/help/uiautomator/UiCollection.jd new file mode 100644 index 0000000..ed92ca7 --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiCollection.jd @@ -0,0 +1,1271 @@ +page.title=UiCollection +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<p>Used to enumerate a container's user interface (UI) elements for the purpose of counting, + or targeting a sub elements by a child's text or description. +</p> + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiCollection(com.android.uiautomator.core.UiSelector)">UiCollection</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByInstance(com.android.uiautomator.core.UiSelector, int)">getChildByInstance</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, int instance) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code>.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code>.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildCount(com.android.uiautomator.core.UiSelector)">getChildCount</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern) + + <div class="jd-descrdiv">Counts child UI element instances matching the <code>childPattern</code> + argument.</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-com.android.uiautomator.core.UiObject" class="jd-expando-trigger closed" + ><img id="inherited-methods-com.android.uiautomator.core.UiObject-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + <a href="UiObject.html">com.android.uiautomator.core.UiObject</a> + +<div id="inherited-methods-com.android.uiautomator.core.UiObject"> + <div id="inherited-methods-com.android.uiautomator.core.UiObject-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-com.android.uiautomator.core.UiObject-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clearTextField()">clearTextField</a></span>() + + <div class="jd-descrdiv">Clears the existing text contents in an editable field.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#click()">click</a></span>() + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow</a></span>(long timeout) + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow()">clickAndWaitForNewWindow</a></span>() + + <div class="jd-descrdiv">See <code><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow(long)</a></code> + This method is intended to reliably wait for window transitions that would typically take + longer than the usual default timeouts.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickBottomRight()">clickBottomRight</a></span>() + + <div class="jd-descrdiv">Clicks the bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickTopLeft()">clickTopLeft</a></span>() + + <div class="jd-descrdiv">Clicks the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#exists()">exists</a></span>() + + <div class="jd-descrdiv">Check if UI element exists.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getBounds()">getBounds</a></span>() + + <div class="jd-descrdiv">Returns the UI element's <code>bounds</code> property.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getChild(com.android.uiautomator.core.UiSelector)">getChild</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element of the element currently represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getChildCount()">getChildCount</a></span>() + + <div class="jd-descrdiv">Counts the child UI elements immediately under the UI element currently represented by + this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getContentDescription()">getContentDescription</a></span>() + + <div class="jd-descrdiv">Reads the <code>content_desc</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getFromParent(com.android.uiautomator.core.UiSelector)">getFromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element from the parent element currently + represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getPackageName()">getPackageName</a></span>() + + <div class="jd-descrdiv">Reads the UI element's <code>package</code> property</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getSelector()">getSelector</a></span>() + + <div class="jd-descrdiv">Debugging helper.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getText()">getText</a></span>() + + <div class="jd-descrdiv">Reads the <code>text</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getVisibleBounds()">getVisibleBounds</a></span>() + + <div class="jd-descrdiv">Returns the visible bounds of the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isCheckable()">isCheckable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checkable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isChecked()">isChecked</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checked</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isClickable()">isClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isEnabled()">isEnabled</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>enabled</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isFocusable()">isFocusable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focusable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isFocused()">isFocused</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focused</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isLongClickable()">isLongClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>long-clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isScrollable()">isScrollable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>scrollable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isSelected()">isSelected</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>selected</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClick()">longClick</a></span>() + + <div class="jd-descrdiv">Long clicks the center of the visible bounds of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClickBottomRight()">longClickBottomRight</a></span>() + + <div class="jd-descrdiv">Long clicks bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClickTopLeft()">longClickTopLeft</a></span>() + + <div class="jd-descrdiv">Long clicks on the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#setText(java.lang.String)">setText</a></span>(String text) + + <div class="jd-descrdiv">Sets the text in an editable field, after clearing the field's content.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeDown(int)">swipeDown</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object, Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward().</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeLeft(int)">swipeLeft</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeRight(int)">swipeRight</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeUp(int)">swipeUp</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#waitForExists(long)">waitForExists</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become visible.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#waitUntilGone(long)">waitUntilGone</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become undetectable.</div> + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + +<a id="UiCollection(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiCollection</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + +<a id="getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByDescription</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code> + selector. + + It looks for any child matching the <code>childPattern</code> argument that has + a child UI element anywhere within its sub hierarchy that has content-description text. + The returned UiObject will point at the <code>childPattern</code> instance that matched the + search and not at the identifying child element that matched the content description.</p></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByInstance(com.android.uiautomator.core.UiSelector, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByInstance</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, int instance)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code>. + + It looks for any child matching the <code>childPattern</code> argument that has + a child UI element anywhere within its sub hierarchy that is at the <code>instance</code> + specified. The operation is performed only on the visible items and no scrolling is performed + in this case.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>instance</th> + <td>int the desired matched instance of this <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code> +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByText</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this <code><a href="UiSelector.html">UiSelector</a></code> + selector. + + It looks for any child matching the <code>childPattern</code> argument that has + a child UI element anywhere within its sub hierarchy that has a text attribute equal to + <code>text</code>. The returned UiObject will point at the <code>childPattern</code> + instance that matched the search and not at the identifying child element that matched the + text attribute.</p></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildCount(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + int + </span> + <span class="sympad">getChildCount</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern)</span> + </h4> + <div class="api-level"> + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Counts child UI element instances matching the <code>childPattern</code> + argument. The method returns the number of matching UI elements that are + currently visible. The count does not include items of a scrollable list + that are off-screen.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td>a <code><a href="UiSelector.html">UiSelector</a></code> that represents the matching child UI + elements to count</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>the number of matched childPattern under the current <code><a href="UiCollection.html">UiCollection</a></code> +</li></ul> + </div> + + </div> +</div> + diff --git a/docs/html/tools/help/uiautomator/UiDevice.jd b/docs/html/tools/help/uiautomator/UiDevice.jd new file mode 100644 index 0000000..1c8805b --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiDevice.jd @@ -0,0 +1,3073 @@ +page.title=UiDevice +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> + +<h2>Class Overview</h2> +<p>UiDevice provides access to state information about the device. + You can also use this class to simulate user actions on the device, + such as pressing the d-pad or pressing the Home and Menu buttons.</p> + + + + + +</div><!-- jd-descr --> + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clearLastTraversedText()">clearLastTraversedText</a></span>() + + <div class="jd-descrdiv">Clears the text from the last UI traversal event.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#click(int, int)">click</a></span>(int x, int y) + + <div class="jd-descrdiv">Perform a click at arbitrary coordinates specified by the user</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#dumpWindowHierarchy(java.lang.String)">dumpWindowHierarchy</a></span>(String fileName) + + <div class="jd-descrdiv">Helper method used for debugging to dump the current window's layout hierarchy.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#freezeRotation()">freezeRotation</a></span>() + + <div class="jd-descrdiv">Disables the sensors and freezes the device rotation at its + current rotation state.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getCurrentActivityName()">getCurrentActivityName</a></span>() + + <div class="jd-descrdiv"> + <em> + This method is deprecated. + The results returned should be considered unreliable</em></div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getCurrentPackageName()">getCurrentPackageName</a></span>() + + <div class="jd-descrdiv">Retrieves the name of the last package to report accessibility events.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getDisplayHeight()">getDisplayHeight</a></span>() + + <div class="jd-descrdiv">Gets the height of the display, in pixels.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getDisplayRotation()">getDisplayRotation</a></span>() + + <div class="jd-descrdiv">Returns the current rotation of the display, as defined in Surface@return</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getDisplayWidth()">getDisplayWidth</a></span>() + + <div class="jd-descrdiv">Gets the width of the display, in pixels.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + static + + <a href="UiDevice.html">UiDevice</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getInstance()">getInstance</a></span>() + + <div class="jd-descrdiv">Retrieves a singleton instance of UiDevice</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getLastTraversedText()">getLastTraversedText</a></span>() + + <div class="jd-descrdiv">Retrieves the text from the last UI traversal event received.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getProductName()">getProductName</a></span>() + + <div class="jd-descrdiv">Retrieves the product name of the device.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#hasAnyWatcherTriggered()">hasAnyWatcherTriggered</a></span>() + + <div class="jd-descrdiv">Checks if any registered <code><a href="UiWatcher.html">UiWatcher</a></code> have triggered.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#hasWatcherTriggered(java.lang.String)">hasWatcherTriggered</a></span>(String watcherName) + + <div class="jd-descrdiv">Checks if a specific registered <code><a href="UiWatcher.html">UiWatcher</a></code> has triggered.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isNaturalOrientation()">isNaturalOrientation</a></span>() + + <div class="jd-descrdiv">Check if the device is in its natural orientation.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isScreenOn()">isScreenOn</a></span>() + + <div class="jd-descrdiv">Checks the power manager if the screen is ON.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressBack()">pressBack</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the BACK button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadCenter()">pressDPadCenter</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the CENTER button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadDown()">pressDPadDown</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the DOWN button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadLeft()">pressDPadLeft</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the LEFT button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadRight()">pressDPadRight</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the RIGHT button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDPadUp()">pressDPadUp</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the UP button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressDelete()">pressDelete</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the DELETE key.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressEnter()">pressEnter</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the ENTER key.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressHome()">pressHome</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the HOME button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressKeyCode(int)">pressKeyCode</a></span>(int keyCode) + + <div class="jd-descrdiv">Simulates a short press using a key code.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressKeyCode(int, int)">pressKeyCode</a></span>(int keyCode, int metaState) + + <div class="jd-descrdiv">Simulates a short press using a key code.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressMenu()">pressMenu</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the MENU button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressRecentApps()">pressRecentApps</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the Recent Apps button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#pressSearch()">pressSearch</a></span>() + + <div class="jd-descrdiv">Simulates a short press on the SEARCH button.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher</a></span>(String name, <a href="UiWatcher.html">UiWatcher</a> watcher) + + <div class="jd-descrdiv">Registers a <code><a href="UiWatcher.html">UiWatcher</a></code> to run automatically when the testing framework is unable to + find a match using a <code><a href="UiSelector.html">UiSelector</a></code>.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#removeWatcher(java.lang.String)">removeWatcher</a></span>(String name) + + <div class="jd-descrdiv">Removes a previously registered <code><a href="UiWatcher.html">UiWatcher</a></code>.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#resetWatcherTriggers()">resetWatcherTriggers</a></span>() + + <div class="jd-descrdiv">Resets a <code><a href="UiWatcher.html">UiWatcher</a></code> that has been triggered.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#runWatchers()">runWatchers</a></span>() + + <div class="jd-descrdiv">This method forces all registered watchers to run.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setOrientationLeft()">setOrientationLeft</a></span>() + + <div class="jd-descrdiv">Simulates orienting the device to the left and also freezes rotation + by disabling the sensors.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setOrientationNatural()">setOrientationNatural</a></span>() + + <div class="jd-descrdiv">Simulates orienting the device into its natural orientation and also freezes rotation + by disabling the sensors.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setOrientationRight()">setOrientationRight</a></span>() + + <div class="jd-descrdiv">Simulates orienting the device to the right and also freezes rotation + by disabling the sensors.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#sleep()">sleep</a></span>() + + <div class="jd-descrdiv">This method simply presses the power button if the screen is ON else + it does nothing if the screen is already OFF.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipe(android.graphics.Point[], int)">swipe</a></span>(Point[] segments, int segmentSteps) + + <div class="jd-descrdiv">Performs a swipe between points in the Point array.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipe(int, int, int, int, int)">swipe</a></span>(int startX, int startY, int endX, int endY, int steps) + + <div class="jd-descrdiv">Performs a swipe from one coordinate to another using the number of steps + to determine smoothness and speed.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#takeScreenshot(java.io.File, float, int)">takeScreenshot</a></span>(File storePath, float scale, int quality) + + <div class="jd-descrdiv">Take a screenshot of current window and store it as PNG + + The screenshot is adjusted per screen rotation</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#takeScreenshot(java.io.File)">takeScreenshot</a></span>(File storePath) + + <div class="jd-descrdiv">Take a screenshot of current window and store it as PNG + + Default scale of 1.0f (original size) and 90% quality is used + The screenshot is adjusted per screen rotation</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#unfreezeRotation()">unfreezeRotation</a></span>() + + <div class="jd-descrdiv">Re-enables the sensors and un-freezes the device rotation allowing its contents + to rotate with the device physical rotation.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitForIdle(long)">waitForIdle</a></span>(long time) + + <div class="jd-descrdiv">Waits for the current application to idle.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitForIdle()">waitForIdle</a></span>() + + <div class="jd-descrdiv">Waits for the current application to idle.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitForWindowUpdate(java.lang.String, long)">waitForWindowUpdate</a></span>(String packageName, long timeout) + + <div class="jd-descrdiv">Waits for a window content update event to occur.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#wakeUp()">wakeUp</a></span>() + + <div class="jd-descrdiv">This method simulates pressing the power button if the screen is OFF else + it does nothing if the screen is already ON.</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="clearLastTraversedText()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">clearLastTraversedText</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Clears the text from the last UI traversal event. + See <code><a href="#getLastTraversedText()">getLastTraversedText()</a></code>.</p></div> + + </div> +</div> + + +<a id="click(int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">click</span> + <span class="normal">(int x, int y)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform a click at arbitrary coordinates specified by the user</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>x</th> + <td>coordinate</td> + </tr> + <tr> + <th>y</th> + <td>coordinate</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the click succeeded else false</li></ul> + </div> + + </div> +</div> + + +<a id="dumpWindowHierarchy(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">dumpWindowHierarchy</span> + <span class="normal">(String fileName)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Helper method used for debugging to dump the current window's layout hierarchy. + The file root location is /data/local/tmp</p></div> + + </div> +</div> + + +<a id="freezeRotation()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">freezeRotation</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Disables the sensors and freezes the device rotation at its + current rotation state.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getCurrentActivityName()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getCurrentActivityName</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + <p> + <p class="caution"> + <strong> + This method is deprecated.</strong><br/> The results returned should be considered unreliable + </p> + <div class="jd-tagdata jd-tagdescr"><p>Retrieves the last activity to report accessibility events.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>String name of activity</li></ul> + </div> + + </div> +</div> + + +<a id="getCurrentPackageName()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getCurrentPackageName</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Retrieves the name of the last package to report accessibility events.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>String name of package</li></ul> + </div> + + </div> +</div> + + +<a id="getDisplayHeight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getDisplayHeight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Gets the height of the display, in pixels. The size is adjusted based + on the current orientation of the display.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>height in pixels or zero on failure</li></ul> + </div> + + </div> +</div> + + +<a id="getDisplayRotation()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getDisplayRotation</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Returns the current rotation of the display, as defined in Surface@return</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="getDisplayWidth()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getDisplayWidth</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Gets the width of the display, in pixels. The width and height details + are reported based on the current orientation of the display.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>width in pixels or zero on failure</li></ul> + </div> + + </div> +</div> + + +<a id="getInstance()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + static + + + + <a href="UiDevice.html">UiDevice</a> + </span> + <span class="sympad">getInstance</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Retrieves a singleton instance of UiDevice</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiDevice instance</li></ul> + </div> + + </div> +</div> + + +<a id="getLastTraversedText()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getLastTraversedText</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Retrieves the text from the last UI traversal event received. + + You can use this method to read the contents in a WebView container + because the accessibility framework fires events + as each text is highlighted. You can write a test to perform + directional arrow presses to focus on different elements inside a WebView, + and call this method to get the text from each traversed element. + If you are testing a view container that can return a reference to a + Document Object Model (DOM) object, your test should use the view's + DOM instead.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>text of the last traversal event, else return an empty string</li></ul> + </div> + + </div> +</div> + + +<a id="getProductName()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getProductName</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Retrieves the product name of the device. + + This method provides information on what type of device the test is running on. This value is + the same as returned by invoking #adb shell getprop ro.product.name.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>product name of the device</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="hasAnyWatcherTriggered()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">hasAnyWatcherTriggered</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Checks if any registered <code><a href="UiWatcher.html">UiWatcher</a></code> have triggered. + + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code> + See <code><a href="#hasWatcherTriggered(java.lang.String)">hasWatcherTriggered(String)</a></code></p></div> + + </div> +</div> + + +<a id="hasWatcherTriggered(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">hasWatcherTriggered</span> + <span class="normal">(String watcherName)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Checks if a specific registered <code><a href="UiWatcher.html">UiWatcher</a></code> has triggered. + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code>. If a UiWatcher runs and its + <code><a href="UiWatcher.html#checkForCondition()">checkForCondition()</a></code> call returned <code>true</code>, then + the UiWatcher is considered triggered. This is helpful if a watcher is detecting errors + from ANR or crash dialogs and the test needs to know if a UiWatcher has been triggered.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if triggered else false</li></ul> + </div> + + </div> +</div> + + +<a id="isNaturalOrientation()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isNaturalOrientation</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the device is in its natural orientation. This is determined by checking if the + orientation is at 0 or 180 degrees.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is in natural orientation</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="isScreenOn()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isScreenOn</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Checks the power manager if the screen is ON.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the screen is ON else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="pressBack()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressBack</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the BACK button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadCenter()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadCenter</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the CENTER button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadDown()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadDown</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the DOWN button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadLeft()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadLeft</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the LEFT button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadRight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadRight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the RIGHT button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDPadUp()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDPadUp</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the UP button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressDelete()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressDelete</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the DELETE key.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressEnter()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressEnter</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the ENTER key.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressHome()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressHome</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the HOME button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressKeyCode(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressKeyCode</span> + <span class="normal">(int keyCode)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press using a key code. + + See KeyEvent</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressKeyCode(int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressKeyCode</span> + <span class="normal">(int keyCode, int metaState)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press using a key code. + + See KeyEvent.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>keyCode</th> + <td>the key code of the event.</td> + </tr> + <tr> + <th>metaState</th> + <td>an integer in which each bit set to 1 represents a pressed meta key</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressMenu()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressMenu</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the MENU button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="pressRecentApps()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressRecentApps</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the Recent Apps button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="pressSearch()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">pressSearch</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates a short press on the SEARCH button.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful, else return false</li></ul> + </div> + + </div> +</div> + + +<a id="registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">registerWatcher</span> + <span class="normal">(String name, <a href="UiWatcher.html">UiWatcher</a> watcher)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Registers a <code><a href="UiWatcher.html">UiWatcher</a></code> to run automatically when the testing framework is unable to + find a match using a <code><a href="UiSelector.html">UiSelector</a></code>. See <code><a href="#runWatchers()">runWatchers()</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>name</th> + <td>to register the UiWatcher</td> + </tr> + <tr> + <th>watcher</th> + <td><code><a href="UiWatcher.html">UiWatcher</a></code></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="removeWatcher(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">removeWatcher</span> + <span class="normal">(String name)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Removes a previously registered <code><a href="UiWatcher.html">UiWatcher</a></code>. + + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>name</th> + <td>used to register the UiWatcher</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>UiAutomationException</td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="resetWatcherTriggers()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">resetWatcherTriggers</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Resets a <code><a href="UiWatcher.html">UiWatcher</a></code> that has been triggered. + If a UiWatcher runs and its <code><a href="UiWatcher.html#checkForCondition()">checkForCondition()</a></code> call + returned <code>true</code>, then the UiWatcher is considered triggered. + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code></p></div> + + </div> +</div> + + +<a id="runWatchers()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">runWatchers</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>This method forces all registered watchers to run. + See <code><a href="#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">registerWatcher(String, UiWatcher)</a></code></p></div> + + </div> +</div> + + +<a id="setOrientationLeft()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setOrientationLeft</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates orienting the device to the left and also freezes rotation + by disabling the sensors. + + If you want to un-freeze the rotation and re-enable the sensors + see <code><a href="#unfreezeRotation()">unfreezeRotation()</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="setOrientationNatural()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setOrientationNatural</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates orienting the device into its natural orientation and also freezes rotation + by disabling the sensors. + + If you want to un-freeze the rotation and re-enable the sensors + see <code><a href="#unfreezeRotation()">unfreezeRotation()</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="setOrientationRight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setOrientationRight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Simulates orienting the device to the right and also freezes rotation + by disabling the sensors. + + If you want to un-freeze the rotation and re-enable the sensors + see <code><a href="#unfreezeRotation()">unfreezeRotation()</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="sleep()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">sleep</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>This method simply presses the power button if the screen is ON else + it does nothing if the screen is already OFF.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipe(android.graphics.Point[], int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipe</span> + <span class="normal">(Point[] segments, int segmentSteps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe between points in the Point array. Each step execution is throttled + to 5ms per step. So for a 100 steps, the swipe will take about 1/2 second to complete</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>segments</th> + <td>is Point array containing at least one Point object</td> + </tr> + <tr> + <th>segmentSteps</th> + <td>steps to inject between two Points</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on success</li></ul> + </div> + + </div> +</div> + + +<a id="swipe(int, int, int, int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipe</span> + <span class="normal">(int startX, int startY, int endX, int endY, int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe from one coordinate to another using the number of steps + to determine smoothness and speed. Each step execution is throttled to 5ms + per step. So for a 100 steps, the swipe will take about 1/2 second to complete.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>is the number of move steps sent to the system</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>false if the operation fails or the coordinates are invalid</li></ul> + </div> + + </div> +</div> + + +<a id="takeScreenshot(java.io.File, float, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">takeScreenshot</span> + <span class="normal">(File storePath, float scale, int quality)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Take a screenshot of current window and store it as PNG + + The screenshot is adjusted per screen rotation</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>storePath</th> + <td>where the PNG should be written to</td> + </tr> + <tr> + <th>scale</th> + <td>scale the screenshot down if needed; 1.0f for original size</td> + </tr> + <tr> + <th>quality</th> + <td>quality of the PNG compression; range: 0-100</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if screen shot is created successfully, false otherwise</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="takeScreenshot(java.io.File)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">takeScreenshot</span> + <span class="normal">(File storePath)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Take a screenshot of current window and store it as PNG + + Default scale of 1.0f (original size) and 90% quality is used + The screenshot is adjusted per screen rotation</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>storePath</th> + <td>where the PNG should be written to</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if screen shot is created successfully, false otherwise</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="unfreezeRotation()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">unfreezeRotation</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Re-enables the sensors and un-freezes the device rotation allowing its contents + to rotate with the device physical rotation. During a test execution, it is best to + keep the device frozen in a specific orientation until the test case execution has completed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="waitForIdle(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">waitForIdle</span> + <span class="normal">(long time)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits for the current application to idle.</p></div> + + </div> +</div> + + +<a id="waitForIdle()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">waitForIdle</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits for the current application to idle. + Default wait timeout is 10 seconds</p></div> + + </div> +</div> + + +<a id="waitForWindowUpdate(java.lang.String, long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">waitForWindowUpdate</span> + <span class="normal">(String packageName, long timeout)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits for a window content update event to occur. + + If a package name for the window is specified, but the current window + does not have the same package name, the function returns immediately.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>packageName</th> + <td>the specified window package name (can be <code>null</code>). + If <code>null</code>, a window update from any front-end window will end the wait</td> + </tr> + <tr> + <th>timeout</th> + <td>the timeout for the wait</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if a window update occurred, false if timeout has elapsed or if the current + window does not have the specified package name</li></ul> + </div> + + </div> +</div> + + +<a id="wakeUp()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">wakeUp</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>This method simulates pressing the power button if the screen is OFF else + it does nothing if the screen is already ON. + + If the screen was OFF and it just got turned ON, this method will insert a 500ms delay + to allow the device time to wake up and accept input.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>RemoteException</td> + </tr> + <tr> + <th>RemoteException</td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + + + + +<!-- ========= METHOD DETAIL ======== --> + + + +<!-- ========= END OF CLASS DATA ========= --> + diff --git a/docs/html/tools/help/uiautomator/UiObject.jd b/docs/html/tools/help/uiautomator/UiObject.jd new file mode 100644 index 0000000..a22df50 --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiObject.jd @@ -0,0 +1,2687 @@ +page.title=UiObject +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<p>A UiObject is a representation of a user interface (UI) element. It is not in any way directly bound to a + UI element as an object reference. A UiObject holds information to help it + locate a matching UI element at runtime based on the <code><a href="UiSelector.html">UiSelector</a></code> properties specified in + its constructor. Since a UiObject is a representative for a UI element, it can + be reused for different views with matching UI elements. +</p> + + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiObject(com.android.uiautomator.core.UiSelector)">UiObject</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Constructs a UiObject to represent a specific UI element matched by the specified + <code><a href="UiSelector.html">UiSelector</a></code> selector properties.</div> + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clearTextField()">clearTextField</a></span>() + + <div class="jd-descrdiv">Clears the existing text contents in an editable field.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#click()">click</a></span>() + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow</a></span>(long timeout) + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickAndWaitForNewWindow()">clickAndWaitForNewWindow</a></span>() + + <div class="jd-descrdiv">See <code><a href="#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow(long)</a></code> + This method is intended to reliably wait for window transitions that would typically take + longer than the usual default timeouts.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickBottomRight()">clickBottomRight</a></span>() + + <div class="jd-descrdiv">Clicks the bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickTopLeft()">clickTopLeft</a></span>() + + <div class="jd-descrdiv">Clicks the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#exists()">exists</a></span>() + + <div class="jd-descrdiv">Check if UI element exists.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getBounds()">getBounds</a></span>() + + <div class="jd-descrdiv">Returns the UI element's <code>bounds</code> property.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChild(com.android.uiautomator.core.UiSelector)">getChild</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element of the element currently represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildCount()">getChildCount</a></span>() + + <div class="jd-descrdiv">Counts the child UI elements immediately under the UI element currently represented by + this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getContentDescription()">getContentDescription</a></span>() + + <div class="jd-descrdiv">Reads the <code>content_desc</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getFromParent(com.android.uiautomator.core.UiSelector)">getFromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element from the parent element currently + represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getPackageName()">getPackageName</a></span>() + + <div class="jd-descrdiv">Reads the UI element's <code>package</code> property</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getSelector()">getSelector</a></span>() + + <div class="jd-descrdiv">Debugging helper.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getText()">getText</a></span>() + + <div class="jd-descrdiv">Reads the <code>text</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getVisibleBounds()">getVisibleBounds</a></span>() + + <div class="jd-descrdiv">Returns the visible bounds of the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isCheckable()">isCheckable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checkable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isChecked()">isChecked</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checked</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isClickable()">isClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isEnabled()">isEnabled</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>enabled</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isFocusable()">isFocusable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focusable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isFocused()">isFocused</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focused</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isLongClickable()">isLongClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>long-clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isScrollable()">isScrollable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>scrollable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#isSelected()">isSelected</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>selected</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#longClick()">longClick</a></span>() + + <div class="jd-descrdiv">Long clicks the center of the visible bounds of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#longClickBottomRight()">longClickBottomRight</a></span>() + + <div class="jd-descrdiv">Long clicks bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#longClickTopLeft()">longClickTopLeft</a></span>() + + <div class="jd-descrdiv">Long clicks on the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setText(java.lang.String)">setText</a></span>(String text) + + <div class="jd-descrdiv">Sets the text in an editable field, after clearing the field's content.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipeDown(int)">swipeDown</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object, Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward().</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipeLeft(int)">swipeLeft</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipeRight(int)">swipeRight</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#swipeUp(int)">swipeUp</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitForExists(long)">waitForExists</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become visible.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#waitUntilGone(long)">waitUntilGone</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become undetectable.</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiObject(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiObject</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Constructs a UiObject to represent a specific UI element matched by the specified + <code><a href="UiSelector.html">UiSelector</a></code> selector properties.</p></div> + + </div> +</div> + + + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="clearTextField()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">clearTextField</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Clears the existing text contents in an editable field. + + The <code><a href="UiSelector.html">UiSelector</a></code> of this object must reference a UI element that is editable. + + When you call this method, the method first sets focus at the start edge of the field. + The method then simulates a long-press to select the existing text, and deletes the + selected text. + + If a "Select-All" option is displayed, the method will automatically attempt to use it + to ensure full text selection. + + Note that it is possible that not all the text in the field is selected; for example, + if the text contains separators such as spaces, slashes, at symbol etc. + Also, not all editable fields support the long-press functionality.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="click()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">click</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a click at the center of the visible bounds of the UI element represented + by this UiObject.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true id successful else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="clickAndWaitForNewWindow(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">clickAndWaitForNewWindow</span> + <span class="normal">(long timeout)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions. + + This method differ from <code><a href="#click()">click()</a></code> only in that this method waits for a + a new window transition as a result of the click. Some examples of a window transition: + <li>launching a new activity</li> + <li>bringing up a pop-up menu</li> + <li>bringing up a dialog</li></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>timeout</th> + <td>timeout before giving up on waiting for a new window</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the event was triggered, else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="clickAndWaitForNewWindow()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">clickAndWaitForNewWindow</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow(long)</a></code> + This method is intended to reliably wait for window transitions that would typically take + longer than the usual default timeouts.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the event was triggered, else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="clickBottomRight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">clickBottomRight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Clicks the bottom and right corner of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on success</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th>Exception</td> + <td></td> + </tr> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="clickTopLeft()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">clickTopLeft</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Clicks the top and left corner of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on success</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th>Exception</td> + <td></td> + </tr> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="exists()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">exists</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if UI element exists. + + This methods performs a <code><a href="#waitForExists(long)">waitForExists(long)</a></code> with zero timeout. This + basically returns immediately whether the UI element represented by this UiObject + exists or not. If you need to wait longer for this UI element, then see + <code><a href="#waitForExists(long)">waitForExists(long)</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the UI element represented by this UiObject does exist +</li></ul> + </div> + + </div> +</div> + + +<a id="getBounds()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + Rect + </span> + <span class="sympad">getBounds</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Returns the UI element's <code>bounds</code> property. See <code><a href="#getVisibleBounds()">getVisibleBounds()</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>Rect</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + </div> +</div> + + +<a id="getChild(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChild</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Creates a new UiObject representing a child UI element of the element currently represented + by this UiObject.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>selector</th> + <td>for UI element to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>a new UiObject representing the matched UI element +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildCount()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getChildCount</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Counts the child UI elements immediately under the UI element currently represented by + this UiObject.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>the count of child UI elements.</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getContentDescription()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getContentDescription</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Reads the <code>content_desc</code> property of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>value of node attribute "content_desc"</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getFromParent(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getFromParent</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Creates a new UiObject representing a child UI element from the parent element currently + represented by this object. Essentially this is starting the search from the parent + element and can also be used to find sibling UI elements to the one currently represented + by this UiObject.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>selector</th> + <td>for the UI element to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>a new UiObject representing the matched UI element</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getPackageName()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getPackageName</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Reads the UI element's <code>package</code> property</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getSelector()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + final + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">getSelector</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Debugging helper. A test can dump the properties of a selector as a string + to its logs if needed. <code>getSelector().toString();</code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiSelector.html">UiSelector</a></code> +</li></ul> + </div> + + </div> +</div> + + +<a id="getText()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">getText</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Reads the <code>text</code> property of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>text value of the current node represented by this UiObject</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td>if no match could be found +</td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getVisibleBounds()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + Rect + </span> + <span class="sympad">getVisibleBounds</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Returns the visible bounds of the UI element. + + If a portion of the UI element is visible, only the bounds of the visible portion are + reported.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>Rect</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th></td> + <td>UiObjectNotFoundException</td> + </tr> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="isCheckable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isCheckable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>checkable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isChecked()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isChecked</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>checked</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isClickable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isClickable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>clickable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isEnabled()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isEnabled</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>enabled</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isFocusable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isFocusable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>focusable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isFocused()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isFocused</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>focused</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isLongClickable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isLongClickable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>long-clickable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isScrollable()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isScrollable</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>scrollable</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="isSelected()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">isSelected</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Check if the UI element's <code>selected</code> property is currently true</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if it is else false</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="longClick()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">longClick</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Long clicks the center of the visible bounds of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if operation was successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="longClickBottomRight()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">longClickBottomRight</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Long clicks bottom and right corner of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if operation was successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="longClickTopLeft()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">longClickTopLeft</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Long clicks on the top and left corner of the UI element</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if operation was successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="setText(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">setText</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Sets the text in an editable field, after clearing the field's content. + + The <code><a href="UiSelector.html">UiSelector</a></code> selector of this object must reference a UI element that is editable. + + When you call this method, the method first simulates a <code><a href="#click()">click()</a></code> on + editable field to set focus. The method then clears the field's contents + and injects your specified text into the field. + + If you want to capture the original contents of the field, call <code><a href="#getText()">getText()</a></code> first. + You can then modify the text and use this method to update the field.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>string to set</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if operation is successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipeDown(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipeDown</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform the action on the UI element that is represented by this object, Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward(). This method will perform the swipe gesture over any + surface. The targeted UI element does not need to have the attribute + <code>scrollable</code> set to <code>true</code> for this operation to be performed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipeLeft(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipeLeft</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform the action on the UI element that is represented by this object. Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward(). This method will perform the swipe gesture over any + surface. The targeted UI element does not need to have the attribute + <code>scrollable</code> set to <code>true</code> for this operation to be performed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipeRight(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipeRight</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform the action on the UI element that is represented by this object. Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward(). This method will perform the swipe gesture over any + surface. The targeted UI element does not need to have the attribute + <code>scrollable</code> set to <code>true</code> for this operation to be performed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="swipeUp(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">swipeUp</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform the action on the UI element that is represented by this UiObject. Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward().</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>indicates the number of injected move steps into the system. Steps are + injected about 5ms apart. So a 100 steps may take about 1/2 second to complete.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true of successful</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="waitForExists(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">waitForExists</span> + <span class="normal">(long timeout)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits a specified length of time for a UI element to become visible. + + This method waits until the UI element becomes visible on the display, or + until the timeout has elapsed. You can use this method in situations where + the content that you want to select is not immediately displayed.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>timeout</th> + <td>the amount of time to wait (in milliseconds)</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the UI element is displayed, else false if timeout elapsed while waiting +</li></ul> + </div> + + </div> +</div> + + +<a id="waitUntilGone(long)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">waitUntilGone</span> + <span class="normal">(long timeout)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Waits a specified length of time for a UI element to become undetectable. + + This method waits until a UI element is no longer matchable, or until the + timeout has elapsed. + + A UI element becomes undetectable when the <code><a href="UiSelector.html">UiSelector</a></code> of the object is + unable to find a match because the element has either changed its state or is no + longer displayed. + + You can use this method when attempting to wait for some long operation + to compete, such as downloading a large file or connecting to a remote server.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>timeout</th> + <td>time to wait (in milliseconds)</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the element is gone before timeout elapsed, else false if timeout elapsed + but a matching element is still found. +</li></ul> + </div> + + </div> +</div> + diff --git a/docs/html/tools/help/uiautomator/UiObjectNotFoundException.jd b/docs/html/tools/help/uiautomator/UiObjectNotFoundException.jd new file mode 100644 index 0000000..02c607d --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiObjectNotFoundException.jd @@ -0,0 +1,630 @@ +page.title=UiObjectNotFoundException +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<p>Generated in test runs when a <code><a href="UiSelector.html">UiSelector</a></code> selector could not be matched + to any UI element displayed. +</p> + + + + + + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiObjectNotFoundException(java.lang.String)">UiObjectNotFoundException</a></span>(String msg) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiObjectNotFoundException(java.lang.String, java.lang.Throwable)">UiObjectNotFoundException</a></span>(String detailMessage, Throwable throwable) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiObjectNotFoundException(java.lang.Throwable)">UiObjectNotFoundException</a></span>(Throwable throwable) + + </td></tr> + + + +</table> + + + + + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Throwable" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Throwable-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Throwable + +<div id="inherited-methods-java.lang.Throwable"> + <div id="inherited-methods-java.lang.Throwable-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Throwable-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + synchronized + + + + Throwable + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">fillInStackTrace</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Throwable + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getCause</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getLocalizedMessage</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getMessage</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + StackTraceElement[] + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getStackTrace</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + synchronized + + + + Throwable + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">initCause</span>(Throwable arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">printStackTrace</span>(PrintWriter arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">printStackTrace</span>(PrintStream arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">printStackTrace</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">setStackTrace</span>(StackTraceElement[] arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiObjectNotFoundException(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiObjectNotFoundException</span> + <span class="normal">(String msg)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + +<a id="UiObjectNotFoundException(java.lang.String, java.lang.Throwable)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiObjectNotFoundException</span> + <span class="normal">(String detailMessage, Throwable throwable)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + +<a id="UiObjectNotFoundException(java.lang.Throwable)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiObjectNotFoundException</span> + <span class="normal">(Throwable throwable)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> diff --git a/docs/html/tools/help/uiautomator/UiScrollable.jd b/docs/html/tools/help/uiautomator/UiScrollable.jd new file mode 100644 index 0000000..33566a2 --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiScrollable.jd @@ -0,0 +1,2914 @@ +page.title=UiScrollable +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> +<p>UiScrollable is a <code><a href="UiCollection.html">UiCollection</a></code> and provides support for searching for items in a + scrollable user interface (UI) elements. This class can be used with horizontally or vertically scrollable controls.. +</p> + + + + + + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiScrollable(com.android.uiautomator.core.UiSelector)">UiScrollable</a></span>(<a href="UiSelector.html">UiSelector</a> container) + + <div class="jd-descrdiv">UiScrollable is a <code><a href="UiCollection.html">UiCollection</a></code> and as such requires a <code><a href="UiSelector.html">UiSelector</a></code> to + identify the container UI element of the scrollable collection.</div> + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#flingBackward()">flingBackward</a></span>() + + <div class="jd-descrdiv">See <code><a href="#scrollBackward(int)">scrollBackward(int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#flingForward()">flingForward</a></span>() + + <div class="jd-descrdiv">A convenience version of <code><a href="#scrollForward(int)">scrollForward(int)</a></code>, performs a fling</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#flingToBeginning(int)">flingToBeginning</a></span>(int maxSwipes) + + <div class="jd-descrdiv">See <code><a href="#scrollToBeginning(int, int)">scrollToBeginning(int, int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#flingToEnd(int)">flingToEnd</a></span>(int maxSwipes) + + <div class="jd-descrdiv">See <code><a href="#scrollToEnd(int, int)">scrollToEnd(int, int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)">getChildByDescription</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch) + + <div class="jd-descrdiv">See <code><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription(UiSelector, String)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + container.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByInstance(com.android.uiautomator.core.UiSelector, int)">getChildByInstance</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, int instance) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)">getChildByText</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch) + + <div class="jd-descrdiv">See <code><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText(UiSelector, String)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + container.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getMaxSearchSwipes()">getMaxSearchSwipes</a></span>() + + <div class="jd-descrdiv">#getChildByDescription(String, boolean) and #getChildByText(String, boolean) + use an arguments that specifies if scrolling is allowed while searching for the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + double + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#getSwipeDeadZonePercentage()">getSwipeDeadZonePercentage</a></span>() + + <div class="jd-descrdiv">Returns the percentage of a widget's size that's considered as a no touch zone when swiping.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollBackward(int)">scrollBackward</a></span>(int steps) + + <div class="jd-descrdiv">Perform a scroll backward.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollBackward()">scrollBackward</a></span>() + + <div class="jd-descrdiv">See <code><a href="#scrollBackward(int)">scrollBackward(int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollDescriptionIntoView(java.lang.String)">scrollDescriptionIntoView</a></span>(String text) + + <div class="jd-descrdiv">Performs a swipe Up on the UI element until the requested content-description + is visible or until swipe attempts have been exhausted.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollForward()">scrollForward</a></span>() + + <div class="jd-descrdiv">A convenience version of <code><a href="#scrollForward(int)">scrollForward(int)</a></code>, performs a regular scroll</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollForward(int)">scrollForward</a></span>(int steps) + + <div class="jd-descrdiv">Perform a scroll forward.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollIntoView(com.android.uiautomator.core.UiSelector)">scrollIntoView</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Perform a scroll search for a UI element matching the <code><a href="UiSelector.html">UiSelector</a></code> selector argument.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollTextIntoView(java.lang.String)">scrollTextIntoView</a></span>(String text) + + <div class="jd-descrdiv">Performs a swipe up on the UI element until the requested text is visible + or until swipe attempts have been exhausted.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollToBeginning(int)">scrollToBeginning</a></span>(int maxSwipes) + + <div class="jd-descrdiv">See <code><a href="#scrollToBeginning(int, int)">scrollToBeginning(int, int)</a></code></div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollToBeginning(int, int)">scrollToBeginning</a></span>(int maxSwipes, int steps) + + <div class="jd-descrdiv">Scrolls to the beginning of a scrollable UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollToEnd(int, int)">scrollToEnd</a></span>(int maxSwipes, int steps) + + <div class="jd-descrdiv">Scrolls to the end of a scrollable UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollToEnd(int)">scrollToEnd</a></span>(int maxSwipes) + + <div class="jd-descrdiv">See {@link UiScrollable#scrollToEnd(int, int)</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setAsHorizontalList()">setAsHorizontalList</a></span>() + + <div class="jd-descrdiv">Set the direction of swipes when performing scroll search +</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setAsVerticalList()">setAsVerticalList</a></span>() + + <div class="jd-descrdiv">Set the direction of swipes when performing scroll search +</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setMaxSearchSwipes(int)">setMaxSearchSwipes</a></span>(int swipes) + + <div class="jd-descrdiv">#getChildByDescription(String, boolean) and #getChildByText(String, boolean) + use an arguments that specifies if scrolling is allowed while searching for the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#setSwipeDeadZonePercentage(double)">setSwipeDeadZonePercentage</a></span>(double swipeDeadZonePercentage) + + <div class="jd-descrdiv">Sets the percentage of a widget's size that's considered as a no touch zone when swiping.</div> + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-com.android.uiautomator.core.UiCollection" class="jd-expando-trigger closed" + ><img id="inherited-methods-com.android.uiautomator.core.UiCollection-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + <a href="UiCollection.html">com.android.uiautomator.core.UiCollection</a> + +<div id="inherited-methods-com.android.uiautomator.core.UiCollection"> + <div id="inherited-methods-com.android.uiautomator.core.UiCollection-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-com.android.uiautomator.core.UiCollection-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiCollection.html#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiCollection <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiCollection.html#getChildByInstance(com.android.uiautomator.core.UiSelector, int)">getChildByInstance</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, int instance) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiCollection <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiCollection.html#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern, String text) + + <div class="jd-descrdiv">Searches for child UI element within the constraints of this UiCollection <code><a href="UiSelector.html">UiSelector</a></code> + selector.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiCollection.html#getChildCount(com.android.uiautomator.core.UiSelector)">getChildCount</a></span>(<a href="UiSelector.html">UiSelector</a> childPattern) + + <div class="jd-descrdiv">Counts child UI element instances matching the <code>childPattern</code> + argument.</div> + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-com.android.uiautomator.core.UiObject" class="jd-expando-trigger closed" + ><img id="inherited-methods-com.android.uiautomator.core.UiObject-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + <a href="UiObject.html">com.android.uiautomator.core.UiObject</a> + +<div id="inherited-methods-com.android.uiautomator.core.UiObject"> + <div id="inherited-methods-com.android.uiautomator.core.UiObject-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-com.android.uiautomator.core.UiObject-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clearTextField()">clearTextField</a></span>() + + <div class="jd-descrdiv">Clears the existing text contents in an editable field.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#click()">click</a></span>() + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow</a></span>(long timeout) + + <div class="jd-descrdiv">Performs a click at the center of the visible bounds of the UI element represented + by this UiObject and waits for window transitions.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickAndWaitForNewWindow()">clickAndWaitForNewWindow</a></span>() + + <div class="jd-descrdiv">See <code><a href="UiObject.html#clickAndWaitForNewWindow(long)">clickAndWaitForNewWindow(long)</a></code> + This method is intended to reliably wait for window transitions that would typically take + longer than the usual default timeouts.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickBottomRight()">clickBottomRight</a></span>() + + <div class="jd-descrdiv">Clicks the bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#clickTopLeft()">clickTopLeft</a></span>() + + <div class="jd-descrdiv">Clicks the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#exists()">exists</a></span>() + + <div class="jd-descrdiv">Check if UI element exists.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getBounds()">getBounds</a></span>() + + <div class="jd-descrdiv">Returns the UI element's <code>bounds</code> property.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getChild(com.android.uiautomator.core.UiSelector)">getChild</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element of the element currently represented + by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getChildCount()">getChildCount</a></span>() + + <div class="jd-descrdiv">Counts the child UI elements immediately under the UI element currently represented by + this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getContentDescription()">getContentDescription</a></span>() + + <div class="jd-descrdiv">Reads the <code>content_desc</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + <a href="UiObject.html">UiObject</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getFromParent(com.android.uiautomator.core.UiSelector)">getFromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Creates a new UiObject representing a child UI element from the parent element currently + represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getPackageName()">getPackageName</a></span>() + + <div class="jd-descrdiv">Reads the UI element's <code>package</code> property</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getSelector()">getSelector</a></span>() + + <div class="jd-descrdiv">Debugging helper.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getText()">getText</a></span>() + + <div class="jd-descrdiv">Reads the <code>text</code> property of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + Rect + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#getVisibleBounds()">getVisibleBounds</a></span>() + + <div class="jd-descrdiv">Returns the visible bounds of the UI element.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isCheckable()">isCheckable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checkable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isChecked()">isChecked</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>checked</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isClickable()">isClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isEnabled()">isEnabled</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>enabled</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isFocusable()">isFocusable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focusable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isFocused()">isFocused</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>focused</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isLongClickable()">isLongClickable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>long-clickable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isScrollable()">isScrollable</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>scrollable</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#isSelected()">isSelected</a></span>() + + <div class="jd-descrdiv">Check if the UI element's <code>selected</code> property is currently true</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClick()">longClick</a></span>() + + <div class="jd-descrdiv">Long clicks the center of the visible bounds of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClickBottomRight()">longClickBottomRight</a></span>() + + <div class="jd-descrdiv">Long clicks bottom and right corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#longClickTopLeft()">longClickTopLeft</a></span>() + + <div class="jd-descrdiv">Long clicks on the top and left corner of the UI element</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#setText(java.lang.String)">setText</a></span>(String text) + + <div class="jd-descrdiv">Sets the text in an editable field, after clearing the field's content.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeDown(int)">swipeDown</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object, Also see + #scrollToBeginning(int), #scrollToEnd(int), #scrollBackward(), + #scrollForward().</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeLeft(int)">swipeLeft</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeRight(int)">swipeRight</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this object.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#swipeUp(int)">swipeUp</a></span>(int steps) + + <div class="jd-descrdiv">Perform the action on the UI element that is represented by this UiObject.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#waitForExists(long)">waitForExists</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become visible.</div> + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="UiObject.html#waitUntilGone(long)">waitUntilGone</a></span>(long timeout) + + <div class="jd-descrdiv">Waits a specified length of time for a UI element to become undetectable.</div> + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api" > + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiScrollable(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiScrollable</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> container)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>UiScrollable is a <code><a href="UiCollection.html">UiCollection</a></code> and as such requires a <code><a href="UiSelector.html">UiSelector</a></code> to + identify the container UI element of the scrollable collection. Further operations on + the items in the container will require specifying UiSelector as an item selector.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>container</th> + <td>a <code><a href="UiSelector.html">UiSelector</a></code> selector +</td> + </tr> + </table> + </div> + + </div> +</div> + + + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="flingBackward()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">flingBackward</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollBackward(int)">scrollBackward(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="flingForward()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">flingForward</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>A convenience version of <code><a href="#scrollForward(int)">scrollForward(int)</a></code>, performs a fling</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="flingToBeginning(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">flingToBeginning</span> + <span class="normal">(int maxSwipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollToBeginning(int, int)">scrollToBeginning(int, int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="flingToEnd(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">flingToEnd</span> + <span class="normal">(int maxSwipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollToEnd(int, int)">scrollToEnd(int, int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByDescription</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByDescription(UiSelector, String)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String may be a partial match for the content-description of a child element.</td> + </tr> + <tr> + <th>allowScrollSearch</th> + <td>set to true if scrolling is allowed</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByDescription</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + container. It looks for any child matching the <code>childPattern</code> argument within its + hierarchy with a matching content-description text. The returned UiObject will represent the + UI element matching the <code>childPattern</code> and not the sub element that matched the + content description.</p> + By default this operation will perform scroll search while attempting to find the UI element + See <code><a href="#getChildByDescription(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)">getChildByDescription(UiSelector, String, boolean)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByInstance(com.android.uiautomator.core.UiSelector, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByInstance</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, int instance)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + selector. It looks for any child matching the <code>childPattern</code> argument and + return the <code>instance</code> specified. The operation is performed only on the visible + items and no scrolling is performed in this case.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>instance</th> + <td>int the desired matched instance of this <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code> +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByText</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text, boolean allowScrollSearch)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)">getChildByText(UiSelector, String)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + <tr> + <th>allowScrollSearch</th> + <td>set to true if scrolling is allowed</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiObject.html">UiObject</a> + </span> + <span class="sympad">getChildByText</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> childPattern, String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Searches for child UI element within the constraints of this UiScrollable <code><a href="UiSelector.html">UiSelector</a></code> + container. It looks for any child matching the <code>childPattern</code> argument that has + a sub UI element anywhere within its sub hierarchy that has text attribute + <code>text</code>. The returned UiObject will point at the <code>childPattern</code> + instance that matched the search and not at the text matched sub element</p> + By default this operation will perform scroll search while attempting to find the UI + element. + See <code><a href="#getChildByText(com.android.uiautomator.core.UiSelector, java.lang.String, boolean)">getChildByText(UiSelector, String, boolean)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>childPattern</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector of the child pattern to match and return</td> + </tr> + <tr> + <th>text</th> + <td>String of the identifying child contents of of the <code>childPattern</code></td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li><code><a href="UiObject.html">UiObject</a></code> pointing at and instance of <code>childPattern</code></li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="getMaxSearchSwipes()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + int + </span> + <span class="sympad">getMaxSearchSwipes</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>#getChildByDescription(String, boolean) and #getChildByText(String, boolean) + use an arguments that specifies if scrolling is allowed while searching for the UI element. + The number of scrolls currently allowed to perform a search can be read by this method. + See <code><a href="#setMaxSearchSwipes(int)">setMaxSearchSwipes(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>max value of the number of swipes currently allowed during a scroll search +</li></ul> + </div> + + </div> +</div> + + +<a id="getSwipeDeadZonePercentage()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + double + </span> + <span class="sympad">getSwipeDeadZonePercentage</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Returns the percentage of a widget's size that's considered as a no touch zone when swiping. + + Dead zones are set as percentage of a widget's total width or height, denoting a margin + around the swipable area of the widget. Swipes must start and + end inside this margin. + + This is important when the widget being swiped may not respond to the swipe if + started at a point too near to the edge. The default is 10% from either edge.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>a value between 0 and 1 +</li></ul> + </div> + + </div> +</div> + + +<a id="scrollBackward(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollBackward</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform a scroll backward. If this list is set to vertical (see <code><a href="#setAsVerticalList()">setAsVerticalList()</a></code> + default) then the swipes will be executed from the top to bottom. If this list is set + to horizontal (see <code><a href="#setAsHorizontalList()">setAsHorizontalList()</a></code>) then the swipes will be executed from + the left to right. Caution is required on devices configured with right to left languages + like Arabic and Hebrew.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>use steps to control the speed, so that it may be a scroll, or fling</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollBackward()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollBackward</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollBackward(int)">scrollBackward(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollDescriptionIntoView(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollDescriptionIntoView</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe Up on the UI element until the requested content-description + is visible or until swipe attempts have been exhausted. See <code><a href="#setMaxSearchSwipes(int)">setMaxSearchSwipes(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>to look for anywhere within the contents of this scrollable.</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if item us found else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollForward()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollForward</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>A convenience version of <code><a href="#scrollForward(int)">scrollForward(int)</a></code>, performs a regular scroll</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollForward(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollForward</span> + <span class="normal">(int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform a scroll forward. If this list is set to vertical (see <code><a href="#setAsVerticalList()">setAsVerticalList()</a></code> + default) then the swipes will be executed from the bottom to top. If this list is set + to horizontal (see <code><a href="#setAsHorizontalList()">setAsHorizontalList()</a></code>) then the swipes will be executed from + the right to left. Caution is required on devices configured with right to left languages + like Arabic and Hebrew.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>use steps to control the speed, so that it may be a scroll, or fling</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if scrolled and false if the control can't scroll anymore +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollIntoView(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollIntoView</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Perform a scroll search for a UI element matching the <code><a href="UiSelector.html">UiSelector</a></code> selector argument. + See <code><a href="#scrollDescriptionIntoView(java.lang.String)">scrollDescriptionIntoView(String)</a></code> and <code><a href="#scrollTextIntoView(java.lang.String)">scrollTextIntoView(String)</a></code>.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>selector</th> + <td><code><a href="UiSelector.html">UiSelector</a></code> selector</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if the item was found and now is in view else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollTextIntoView(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollTextIntoView</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Performs a swipe up on the UI element until the requested text is visible + or until swipe attempts have been exhausted. See <code><a href="#setMaxSearchSwipes(int)">setMaxSearchSwipes(int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>to look for</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true if item us found else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollToBeginning(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollToBeginning</span> + <span class="normal">(int maxSwipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See <code><a href="#scrollToBeginning(int, int)">scrollToBeginning(int, int)</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollToBeginning(int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollToBeginning</span> + <span class="normal">(int maxSwipes, int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Scrolls to the beginning of a scrollable UI element. The beginning could be the top most + in case of vertical lists or the left most in case of horizontal lists. Caution is required + on devices configured with right to left languages like Arabic and Hebrew.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>use steps to control the speed, so that it may be a scroll, or fling</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollToEnd(int, int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollToEnd</span> + <span class="normal">(int maxSwipes, int steps)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Scrolls to the end of a scrollable UI element. The end could be the bottom most + in case of vertical controls or the right most for horizontal controls. Caution + is required on devices configured with right to left languages like Arabic and Hebrew.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>steps</th> + <td>use steps to control the speed, so that it may be a scroll, or fling</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="scrollToEnd(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + boolean + </span> + <span class="sympad">scrollToEnd</span> + <span class="normal">(int maxSwipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>See {@link UiScrollable#scrollToEnd(int, int)</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true on scrolled else false +</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Throws</h5> + <table class="jd-tagtable"> + <tr> + <th><a href="UiObjectNotFoundException.html">UiObjectNotFoundException</a></td> + <td></td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="setAsHorizontalList()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setAsHorizontalList</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the direction of swipes when performing scroll search +</p></div> + + </div> +</div> + + +<a id="setAsVerticalList()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setAsVerticalList</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the direction of swipes when performing scroll search +</p></div> + + </div> +</div> + + +<a id="setMaxSearchSwipes(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setMaxSearchSwipes</span> + <span class="normal">(int swipes)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>#getChildByDescription(String, boolean) and #getChildByText(String, boolean) + use an arguments that specifies if scrolling is allowed while searching for the UI element. + The number of scrolls allowed to perform a search can be modified by this method. + The current value can be read by calling <code><a href="#getMaxSearchSwipes()">getMaxSearchSwipes()</a></code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>swipes</th> + <td>is the number of search swipes until abort +</td> + </tr> + </table> + </div> + + </div> +</div> + + +<a id="setSwipeDeadZonePercentage(double)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + void + </span> + <span class="sympad">setSwipeDeadZonePercentage</span> + <span class="normal">(double swipeDeadZonePercentage)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Sets the percentage of a widget's size that's considered as a no touch zone when swiping. + + Dead zones are set as percentage of a widget's total width or height, denoting a margin + around the swipable area of the widget. Swipes must always start and + end inside this margin. + + This is important when the widget being swiped may not respond to the swipe if + started at a point too near to the edge. The default is 10% from either edge</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>swipeDeadZonePercentage</th> + <td>is a value between 0 and 1 +</td> + </tr> + </table> + </div> + + </div> +</div> diff --git a/docs/html/tools/help/uiautomator/UiSelector.jd b/docs/html/tools/help/uiautomator/UiSelector.jd new file mode 100644 index 0000000..96d3fd8 --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiSelector.jd @@ -0,0 +1,2088 @@ +page.title=UiSelector +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> + + +<h2>Class Overview</h2> +<p>This class provides the mechanism for tests to describe the UI elements they + intend to target. A UI element has many properties associated with it such as + text value, content-description, class name and multiple state information like + selected, enabled, checked etc. Additionally UiSelector allows targeting of UI + elements within a specific display hierarchies to distinguish similar elements + based in the hierarchies they're in.</p> + + + + + +</div><!-- jd-descr --> + + + + + + + + + + + + + + + + +<div class="jd-descr"> + + +<h2>Summary</h2> + + + + + + + + + + + + + + + + + + + + + + + +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#UiSelector()">UiSelector</a></span>() + + </td></tr> + + + +</table> + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#checked(boolean)">checked</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that + are currently checked (usually for checkboxes).</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#childSelector(com.android.uiautomator.core.UiSelector)">childSelector</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Adds a child UiSelector criteria to this selector.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#className(java.lang.String)">className</a></span>(String className) + + <div class="jd-descrdiv">Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + <T> + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#className(java.lang.Class<T>)">className</a></span>(Class<T> type) + + <div class="jd-descrdiv">Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#classNameMatches(java.lang.String)">classNameMatches</a></span>(String regex) + + <div class="jd-descrdiv">Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#clickable(boolean)">clickable</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are clickable.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#description(java.lang.String)">description</a></span>(String desc) + + <div class="jd-descrdiv">Set the search criteria to match the content-description + property for a widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#descriptionContains(java.lang.String)">descriptionContains</a></span>(String desc) + + <div class="jd-descrdiv">Set the search criteria to match the content-description + property for a widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#descriptionMatches(java.lang.String)">descriptionMatches</a></span>(String regex) + + <div class="jd-descrdiv">Set the search criteria to match the content-description + property for a widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#descriptionStartsWith(java.lang.String)">descriptionStartsWith</a></span>(String desc) + + <div class="jd-descrdiv">Set the search criteria to match the content-description + property for a widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#enabled(boolean)">enabled</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are enabled.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#focusable(boolean)">focusable</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are focusable.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#focused(boolean)">focused</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that have focus.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#fromParent(com.android.uiautomator.core.UiSelector)">fromParent</a></span>(<a href="UiSelector.html">UiSelector</a> selector) + + <div class="jd-descrdiv">Adds a child UiSelector criteria to this selector which is used to + start search from the parent widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#index(int)">index</a></span>(int index) + + <div class="jd-descrdiv">Set the search criteria to match the widget by its node + index in the layout hierarchy.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#instance(int)">instance</a></span>(int instance) + + <div class="jd-descrdiv">Set the search criteria to match the + widget by its instance number.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#longClickable(boolean)">longClickable</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are long-clickable.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#packageName(java.lang.String)">packageName</a></span>(String name) + + <div class="jd-descrdiv">Set the search criteria to match the package name + of the application that contains the widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#packageNameMatches(java.lang.String)">packageNameMatches</a></span>(String regex) + + <div class="jd-descrdiv">Set the search criteria to match the package name + of the application that contains the widget.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#scrollable(boolean)">scrollable</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that are scrollable.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#selected(boolean)">selected</a></span>(boolean val) + + <div class="jd-descrdiv">Set the search criteria to match widgets that + are currently selected.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#text(java.lang.String)">text</a></span>(String text) + + <div class="jd-descrdiv">Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app).</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#textContains(java.lang.String)">textContains</a></span>(String text) + + <div class="jd-descrdiv">Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app).</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#textMatches(java.lang.String)">textMatches</a></span>(String regex) + + <div class="jd-descrdiv">Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app).</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + <a href="UiSelector.html">UiSelector</a> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#textStartsWith(java.lang.String)">textStartsWith</a></span>(String text) + + <div class="jd-descrdiv">Text property is usually the widget's visible text on the display.</div> + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#toString()">toString</a></span>() + + </td></tr> + + + +</table> + + + + + + + +<!-- ========== METHOD SUMMARY =========== --> +<table id="inhmethods" class="jd-sumtable"><tr><th> + <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a> + <div style="clear:left;">Inherited Methods</div></th></tr> + + +<tr class="api apilevel-" > +<td colspan="12"> + <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed" + ><img id="inherited-methods-java.lang.Object-trigger" + src="../../../../../assets/images/triangle-closed.png" + class="jd-expando-trigger-img" /></a> +From class + + java.lang.Object + +<div id="inherited-methods-java.lang.Object"> + <div id="inherited-methods-java.lang.Object-list" + class="jd-inheritedlinks"> + </div> + <div id="inherited-methods-java.lang.Object-summary" style="display: none;"> + <table class="jd-sumtable-expando"> + + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">equals</span>(Object arg0) + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + Class<?> + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">getClass</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + int + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">hashCode</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notify</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">notifyAll</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + + + + String + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">toString</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>() + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0, int arg1) + + </td></tr> + + + + <tr class="api"> + <td class="jd-typecol"> + + + final + + + void + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad">wait</span>(long arg0) + + </td></tr> + + +</table> + </div> +</div> +</td></tr> + + +</table> + + +</div><!-- jd-descr (summary) --> + +<!-- Details --> + + + + + + + + +<!-- XML Attributes --> + + +<!-- Enum Values --> + + +<!-- Constants --> + + +<!-- Fields --> + + +<!-- Public ctors --> + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<h2>Public Constructors</h2> + + + +<a id="UiSelector()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + + </span> + <span class="sympad">UiSelector</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + + + + +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<!-- Protected ctors --> + + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + + + +<a id="checked(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">checked</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that + are currently checked (usually for checkboxes). + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="childSelector(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">childSelector</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Adds a child UiSelector criteria to this selector. + + Use this selector to narrow the search scope to + child widgets under a specific parent widget.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with this added search criterion</li></ul> + </div> + + </div> +</div> + + +<a id="className(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">className</span> + <span class="normal">(String className)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>className</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="className(java.lang.Class<T>)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">className</span> + <span class="normal">(Class<T> type)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="classNameMatches(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">classNameMatches</span> + <span class="normal">(String regex)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the class property + for a widget (for example, "android.widget.Button").</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="clickable(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">clickable</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are clickable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="description(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">description</span> + <span class="normal">(String desc)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must match exactly + with the string in your input argument. + + Matching is case-sensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>desc</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="descriptionContains(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">descriptionContains</span> + <span class="normal">(String desc)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must contain + the string in your input argument. + + Matching is case-insensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>desc</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="descriptionMatches(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">descriptionMatches</span> + <span class="normal">(String regex)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must match exactly + with the string in your input argument.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="descriptionStartsWith(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">descriptionStartsWith</span> + <span class="normal">(String desc)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the content-description + property for a widget. + + The content-description is typically used + by the Android Accessibility framework to + provide an audio prompt for the widget when + the widget is selected. The content-description + for the widget must start + with the string in your input argument. + + Matching is case-insensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>desc</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="enabled(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">enabled</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are enabled. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="focusable(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">focusable</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are focusable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="focused(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">focused</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that have focus. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="fromParent(com.android.uiautomator.core.UiSelector)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">fromParent</span> + <span class="normal">(<a href="UiSelector.html">UiSelector</a> selector)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Adds a child UiSelector criteria to this selector which is used to + start search from the parent widget. + + Use this selector to narrow the search scope to + sibling widgets as well all child widgets under a parent.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with this added search criterion</li></ul> + </div> + + </div> +</div> + + +<a id="index(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">index</span> + <span class="normal">(int index)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the widget by its node + index in the layout hierarchy. + + The index value must be 0 or greater. + + Using the index can be unreliable and should only + be used as a last resort for matching. Instead, + consider using the <code><a href="#instance(int)">instance(int)</a></code> method.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>index</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="instance(int)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">instance</span> + <span class="normal">(int instance)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the + widget by its instance number. + + The instance value must be 0 or greater, where + the first instance is 0. + + For example, to simulate a user click on + the third image that is enabled in a UI screen, you + could specify a a search criteria where the instance is + 2, the <code><a href="#className(java.lang.String)">className(String)</a></code> matches the image + widget class, and <code><a href="#enabled(boolean)">enabled(boolean)</a></code> is true. + The code would look like this: + <code> + new UiSelector().className("android.widget.ImageView") + .enabled(true).instance(2); + </code></p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>instance</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="longClickable(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">longClickable</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are long-clickable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="packageName(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">packageName</span> + <span class="normal">(String name)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the package name + of the application that contains the widget.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>name</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="packageNameMatches(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">packageNameMatches</span> + <span class="normal">(String regex)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the package name + of the application that contains the widget.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="scrollable(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">scrollable</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that are scrollable. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="selected(boolean)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">selected</span> + <span class="normal">(boolean val)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match widgets that + are currently selected. + + Typically, using this search criteria alone is not useful. + You should also include additional criteria, such as text, + content-description, or the class name for a widget. + + If no other search criteria is specified, and there is more + than one matching widget, the first widget in the tree + is selected.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>val</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="text(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">text</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app). + + The text for the widget must match exactly + with the string in your input argument. + Matching is case-sensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="textContains(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">textContains</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app). + + The text for the widget must contain the string in + your input argument. Matching is case-sensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Parameters</h5> + <table class="jd-tagtable"> + <tr> + <th>text</th> + <td>Value to match</td> + </tr> + </table> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + + </div> +</div> + + +<a id="textMatches(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">textMatches</span> + <span class="normal">(String regex)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Set the search criteria to match the visible text displayed + for a widget (for example, the text label to launch an app). + + The text for the widget must match exactly + with the string in your input argument.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with the specified search criteria</li></ul> + </div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Since</h5> + <ul class="nolist"><li>Android API Level 17</li></ul> +</div> + </div> +</div> + + +<a id="textStartsWith(java.lang.String)"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + <a href="UiSelector.html">UiSelector</a> + </span> + <span class="sympad">textStartsWith</span> + <span class="normal">(String text)</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>Text property is usually the widget's visible text on the display. + + Adding this to the search criteria indicates that the search performed + should match a widget with text value starting with the text parameter. + + The matching will be case-insensitive.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>UiSelector with this added search criterion</li></ul> + </div> + + </div> +</div> + + +<a id="toString()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + + + String + </span> + <span class="sympad">toString</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + <div> + +</div> + + + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p></p></div> + + </div> +</div> + + + + + +<!-- ========= METHOD DETAIL ======== --> + + + +<!-- ========= END OF CLASS DATA ========= --> + diff --git a/docs/html/tools/help/uiautomator/UiWatcher.jd b/docs/html/tools/help/uiautomator/UiWatcher.jd new file mode 100644 index 0000000..b416fad --- /dev/null +++ b/docs/html/tools/help/uiautomator/UiWatcher.jd @@ -0,0 +1,78 @@ +page.title=UiWatcher +parent.title=uiautomator +parent.link=index.html +@jd:body +<style> + h4.jd-details-title {background-color: #DEE8F1;} +</style> + +<p>Represents a conditional watcher on the target device. To learn how to register a conditional + watcher, see <code><a href="UiDevice.html#registerWatcher(java.lang.String, com.android.uiautomator.core.UiWatcher)">UiDevice.registerWatcher()</a></code>. +</p> + +<div class="jd-descr"> + +<h2>Summary</h2> + +<!-- ========== METHOD SUMMARY =========== --> +<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr> + + + + + <tr class="api" > + <td class="jd-typecol"> + abstract + + + + + boolean + </td> + <td class="jd-linkcol" width="100%"> + <span class="sympad"><a href="#checkForCondition()">checkForCondition</a></span>() + + <div class="jd-descrdiv">The testing framework calls this handler method automatically when the framework + is unable to find a match using the <code><a href="UiSelector.html">UiSelector</a></code>.</div> + + </td></tr> + +</table> + +</div><!-- jd-descr (summary) --> + + +<!-- ========= METHOD DETAIL ======== --> +<!-- Public methdos --> + +<h2>Public Methods</h2> + +<a id="checkForCondition()"></a> + +<div class="jd-details api "> + <h4 class="jd-details-title"> + <span class="normal"> + public + + + abstract + + boolean + </span> + <span class="sympad">checkForCondition</span> + <span class="normal">()</span> + </h4> + <div class="api-level"> + + </div> + <div class="jd-details-descr"> + + <div class="jd-tagdata jd-tagdescr"><p>The testing framework calls this handler method automatically when the framework is unable to find a match using the <code><a href="UiSelector.html">UiSelector</a></code>. When a match is not found after a predetermined time has elapsed, the framework calls the checkForCondition() method of all registered watchers on the device. You can use this method to handle known blocking issues that are preventing the test from proceeding. For example, you can check if a dialog appeared that is blocking the the test, then close the dialog or perform some other appropriate action to allow the test to continue.</p></div> + <div class="jd-tagdata"> + <h5 class="jd-tagtitle">Returns</h5> + <ul class="nolist"><li>true to indicate a matched condition, or false if no matching condition is found +</li></ul> + </div> + + </div> +</div> diff --git a/docs/html/tools/help/uiautomator/index.jd b/docs/html/tools/help/uiautomator/index.jd new file mode 100644 index 0000000..e3899d6 --- /dev/null +++ b/docs/html/tools/help/uiautomator/index.jd @@ -0,0 +1,172 @@ +page.title=uiautomator +parent.title=Tools +parent.link=index.html +@jd:body + +<div id="qv-wrapper"> + <div id="qv"> + <h2>In this document</h2> + <ul> + <li><a href="#syntax">Syntax</a></li> + <li><a href="#options">Options</a></li> + <lI><a href="#api">uiautomator API</a> + <ul> + <li><a href="#classes">Classes</a></li> + <li><a href="#interfaces">Interfaces</a></li> + <li><a href="#exceptions">Exceptions</a></li> + </ul> + </lI> + </ul> + </div> +</div> + +<p>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.</p> +<p>For more information on testing with the {@code uiautomator} framework, see <a href="{@docRoot}tools/testing/testing_ui.html">UI Testing</a>.</p> + +<h2 id="syntax">Syntax</h2> +<p>To run your testcases on the target device, you can use the {@code adb shell} command to invoke the {@code uiautomator} tool. The syntax is: +<pre> +adb shell uiautomator runtest <jar> -c <test_class_or_method> [options] +</pre> +</p> +<p>Here’s an example:</p> +<pre>adb shell uiautomator runtest LaunchSettings.jar -c com.uia.example.my.LaunchSettings</pre> + +<h2 id="options">Command-line Options</h2> +<p>The following table describes the subcommands and options for {@code uiautomator}.</p> + +<p class="table-caption" id="table1"> +<strong>Table 1.</strong> Command-line options for {@code uiautomator}</p> +<table> +<tr> + <th>Subcommand</th> + <th>Option</th> + <th>Description</th> +</tr> + +<tr> +<td rowspan="6"><code>runtest</code></td> +<td><nobr>{@code <jar>}</nobr></td> +<td><strong>Required</strong>. The {@code <jar>} argument is the name of one or more JAR files that you deployed to the target device which contain your uiautomator testcases. You can list more than one JAR file by using a space as a separator.</td> +</tr> + +<tr> +<td><nobr><code>-c <test_class_or_method> </code></nobr></td> +<td><strong>Required</strong>. The {@code <test_class_or_method>} argument is a list of one or more specific test classes or test methods from the JARs that you want {@code uiautomator} to run. <p>Each class or method must be fully qualified with the package name, in one of these formats: +<ul> +<li>{@code package_name.class_name}</li> +<li>{@code package_name.class_name#method_name}</li> +</ul> +You can list multiple classes or methods by using a space as a separator.</p></td> +</tr> + +<tr> +<td><nobr><code>--nohup</code></nobr></td> +<td>Runs the test to completion on the device even if its parent process is terminated (for example, if the device is disconnected).</td> +</tr> + +<tr> +<td><nobr><code>-e <NAME> <VALUE></code></nobr></td> +<td><p>Specify other name-value pairs to be passed to test classes. May be repeated.</p><p class="note"><strong>Note: </strong>The {@code -e} options cannot be combined; you must prefix each option with a separate {@code -e} flag. </p></td> +</tr> + +<tr> +<td><nobr><code>-e debug [true|false]</code></nobr></td> +<td>Wait for debugger to connect before starting.</td> +</tr> + +<tr> +<td><code>dump</code></td> +<td><code>[file]</code></td> +<td>Generate an XML file with a dump of the current UI hierarchy. If a filepath is not specified, by default, the generated dump file is stored on the device in this location {@code /storage/sdcard0/window_dump.xml}.</td> +</tr> + +<tr> +<td><code>events</code></td> +<td> </td> +<td>Prints out accessibility events to the console until the connection to the device is terminated</td> +</tr> +</table> + +<h2 id="api">uiautomator API</h2> +<p>The {@code uiautomator} API is bundled in the {@code uiautomator.jar} file under the {@code <android-sdk>/platforms/} directory. The API includes these key classes, interfaces, and exceptions that allow you to capture and manipulate UI components on the target app:</p> + +<h3 id="classes">Classes</h3> +<table> +<tr> + <th>Class</th> + <th>Description</th> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiCollection.html">{@code com.android.uiautomator.core.UiCollection}</a></nobr></td> +<td>Used to enumerate a container's user interface (UI) elements for the purpose of counting, or targeting a sub elements by a child's text or description.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiDevice.html">{@code com.android.uiautomator.core.UiDevice}</a></nobr></td> +<td>Provides access to state information about the device. You can also use this class to simulate user actions on the device, such as pressing the d-pad hardware button or pressing the Home and Menu buttons.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code com.android.uiautomator.core.UiObject}</a></nobr></td> +<td>Represents a user interface (UI) element.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiScrollable.html">{@code com.android.uiautomator.core.UiScrollable}</a></nobr></td> +<td>Provides support for searching for items in a scrollable UI container.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code com.android.uiautomator.core.UiSelector}</a></nobr></td> +<td>Represents a query for one or more target UI elements on a device screen. </td> +</tr> + +</table> + +<h3 id="interfaces">Interfaces</h3> + +<table> +<tr> + <th>Interface</th> + <th>Description</th> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiWatcher.html">{@code com.android.uiautomator.core.UiWatcher}</a></nobr></td> +<td>Represents a conditional watcher on the target device.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/IAutomationSupport.html">{@code com.android.uiautomator.testrunner.IAutomationSupport}</a></nobr></td> +<td>Provides auxiliary support for running test cases.</td> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiAutomatorTestCase.html">{@code com.android.uiautomator.testrunner.UiAutomatorTestCase}</a></nobr></td> +<td>Defines an environment for running multiple tests. All {@code uiautomator} test cases should extend this class.</td> +</tr> + +</table> + +<h3 id="exceptions">Exceptions</h3> + +<table> +<tr> + <th>Exception</th> + <th>Description</th> +</tr> + +<tr> +<td><nobr><a href="{@docRoot}tools/help/uiautomator/UiObjectNotFoundException.html">{@code com.android.uiautomator.core.UiObjectNotFoundException}</a></nobr></td> +<td>Indicates when a a <a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code UiSelector}</a> could not be matched to any UI element displayed.</td> +</tr> + +</table> + + + + + + diff --git a/docs/html/tools/index.jd b/docs/html/tools/index.jd index 04e0d3b..f9d452c 100644 --- a/docs/html/tools/index.jd +++ b/docs/html/tools/index.jd @@ -17,68 +17,88 @@ page.title=Developer Tools <div style="margin-top:20px;"></div> -<div class="col-6"> +<div class="col-7" style="margin-left:0"> <h3>Full Java IDE</h3> <ul> - <li>Android-specific refactoring, quick fixes, integrated navigation between Java and Android XML resources.</li> - <li>Enhanced XML editors for Android XML resources</li> - <li>Static analysis tools to catch performance, usability, and correctness problems</li> + <li>Android-specific refactoring, quick fixes, integrated navigation between Java and XML resources.</li> + <li>Enhanced XML editors for Android XML resources.</li> + <li>Static analysis tools to catch performance, usability, and correctness problems.</li> <li>Build support for complex projects, command-line support for CI through Ant. Includes ProGuard and app-signing. </li> <li>Template-based wizard to create standard Android projects and components.</li> </ul> </div> -<div class="col-6"> + +<div class="col-6" style="margin-right:0"> + <h3>Graphical UI Builders</h3> - <ul> <li>Build rich Android UI with drag and drop. <li>Visualize your UI on tablets, phones, and other devices. Switch themes, locales, even platform versions instantly, without building.</li> - <li>Visual refactoring lets you extracts layout for inclusion, convert layouts, extract styles</li> - <li>Editor support for working with custom UI components</li> + <li>Visual refactoring lets you extracts layout for inclusion, convert layouts, extract styles.</li> + <li>Editor support for working with custom UI components.</li> </ul> + +</div> + + +<div class="col-7" style="clear:both;margin-left:0;"> + +<h3>On-device Developer Options</h3> +<ul> + <li>Enable debugging over USB.</li> + <li>Quickly capture bug reports onto the device.</li> + <li>Show CPU usage on screen.</li> + <li>Draw debugging information on screen such as layout bounds, + updates on GPU views and hardware layers, and other information.</li> + <li>Plus many more options to simulate app stresses or enable debugging options.</li> +</ul> +<p>To access these settings, open the <em>Developer options</em> in the +system Settings. On Android 4.2 and higher, the Developer options screen is +hidden by default. To make it available, go to +<b>Settings > About phone</b> and tap <b>Build number</b> seven times. Return to the previous +screen to find Developer options.</p> + </div> -<div class="col-6" style="clear:both"> +<div class="col-6" style="margin-right:0"> + <img src="{@docRoot}images/tools/dev-options-inmilk.png" alt="" style="margin:-10px 0 0;"> +</div> + + +<div class="col-7" style="clear:both;margin-left:0;"> <h3>Develop on Hardware Devices</h3> <ul> <li>Use any commercial Android hardware device or multiple devices.</li> - <li>Deploy your app to connected devices directy from the IDE</li> - <li>Live, on-device debugging, testing, and profiling</li> + <li>Deploy your app to connected devices directy from the IDE.</li> + <li>Live, on-device debugging, testing, and profiling.</li> </ul> </div> -<div class="col-6"> +<div class="col-6" style="margin-right:0"> <h3>Develop on Virtual Devices</h3> <ul> <li>Emulate any device. Use custom screen sizes, keyboards, and other hardware components. </li> <li>Advanced hardware emulation, including camera, sensors, multitouch, telephony.</li> - <li>Develop and test for broadest compatibility at lowest cost.</li> + <li>Develop and test for broad device compatibility.</li> </ul> </div> <div style="margin-top:20px;"></div> -<div class="col-5"> +<div class="col-7" style="margin-left:0"> <h3>Powerful Debugging</h3> <ul> - <li>Full Java debugger with on-device debugging and Android-specific tools</li> + <li>Full Java debugger with on-device debugging and Android-specific tools.</li> <li>Built-in memory analysis, performance/CPU profiling, OpenGL ES tracing.</li> <li>Graphical tools for debugging and optimizing UI, runtime inspecton of UI structure and performance.</li> - <li>Runtime graphical analysis of your app's network bandwidth usage.</li> + <li>Runtime graphical analysis of your app's network bandwidth usage.</li> </ul> -</div> - -<div style="float:right;width:360px;padding-top:1em;"> - <img src="{@docRoot}images/debugging-tall.png" align="left"> -</div> - -<div class="col-6"> <h3>Testing</h3> <ul> @@ -95,3 +115,8 @@ page.title=Developer Tools </ul> </div> +<div class="col-6" style="margin-right:0"> + <img src="{@docRoot}images/debugging-tall.png" align="left" style="margin-top:10px"> +</div> + + diff --git a/docs/html/tools/projects/projects-eclipse.jd b/docs/html/tools/projects/projects-eclipse.jd index f1972bc..af85015 100644 --- a/docs/html/tools/projects/projects-eclipse.jd +++ b/docs/html/tools/projects/projects-eclipse.jd @@ -27,7 +27,7 @@ parent.link=index.html <p>Eclipse and the ADT plugin provide GUIs and wizards to create all three types of projects (Android project, Library project, and Test project): - + <ul> <li>An Android project contains all of the files and resources that are needed to build a project into an .apk file for installation. You need to create an Android project for any application that you @@ -44,99 +44,132 @@ parent.link=index.html <h2 id="CreatingAProject">Creating an Android Project</h2> - <p>The ADT plugin provides a <em>New Project Wizard</em> that you can use to quickly create a new Android - project (or a project from existing code). To create a new project:</p> + <p>The ADT plugin provides a <em>New Project Wizard</em> that you can use to quickly create a new + Android project (or a project from existing code). To create a new project:</p> <ol> <li>Select <strong>File</strong> > <strong>New</strong> > <strong>Project</strong>.</li> - <li>Select <strong>Android</strong> > <strong>Android Project</strong>, and click + <li>Select <strong>Android</strong> > <strong>Android Application Project</strong>, and click <strong>Next</strong>.</li> - <li>Select the contents for the project: + <li>Enter the basic settings for the project: <ul> - <li>Enter a <em>Project Name</em>. This will be the name of the folder where your project - is created.</li> - - <li>Under Contents, select <strong>Create new project in workspace</strong>. Select your - project workspace location.</li> - - <li>Under Target, select an Android target to be used as the project's Build Target. The - Build Target specifies which Android platform you'd like your application built against. - - <p>Select the lowest platform with which your application is compatible.</p> - - <p class="note"><strong>Note:</strong> You can change your the Build Target for your + <li>Enter an <strong>Application Name</strong>. This name is used as the title of your + application launcher icon when it is installed on a device.</li> + + <li>Enter a <strong>Project Name</strong>. This text is used as the name of the folder where + your project is created.</li> + + <li>Enter a <strong>Package Name</strong>. This class package namespace creates the initial + package structure for your applications code files and is added as the + <a href="{@docRoot}guide/topics/manifest/manifest-element.html#package">{@code package}</a> + attribute in your application's + <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">Android manifest file</a>. + This manifest value serves as the unique identifier for your application app when you + distribute it to users. The package name must follow the same rules as packages in the Java + programming language.</li> + + <li>Select a <strong>Minimum Required SDK</strong>. This setting indicates the lowest + version of the Android platform that your application supports. This value sets the + <code>minSdkVersion</code> attribute in the + <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a> + element of your manifest file.</li> + + <li>Select a <strong>Target SDK</strong>. This setting indicates the highest version of + Android with which you have tested with your application and sets the + <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code + targetSdkVersion}</a> attribute in your application's' manifest file. + + <p class="note"><strong>Note:</strong> You can change the target SDK for your project at any time: Right-click the project in the Package Explorer, select <strong>Properties</strong>, select <strong>Android</strong> and then check the desired - Project Target.</p> + <strong>Project Build Target</strong>.</p> </li> - <li>Under Properties, fill in all necessary fields. + <li>Select a <strong>Compile With</strong> API version. This setting specifies what version + of the SDK to compile your project against. We strongly recommend using the most recent + version of the API.</li> - <ul> - <li>Enter an <em>Application name</em>. This is the human-readable title for your - application — the name that will appear on the Android device.</li> + <li>Select a <strong>Theme</strong>. This setting specifies which standard Android + <a href="{@docRoot}design/style/themes.html">visual style</a> is applied to your + application.</li> - <li>Enter a <em>Package name</em>. This is the package namespace (following the same - rules as for packages in the Java programming language) where all your source code will - reside.</li> - - <li>Select <em>Create Activity</em> (optional, of course, but common) and enter a name - for your main Activity class.</li> - - <li>Enter a <em>Min SDK Version</em>. This is an integer that indicates the minimum API - Level required to properly run your application. Entering this here automatically sets - the <code>minSdkVersion</code> attribute in the <a href= - "{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a> of your - Android Manifest file. If you're unsure of the appropriate <a href= - "{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API Level</a> to use, copy the API Level - listed for the Build Target you selected in the Target tab.</li> - </ul> - </li> + <li>Click <strong>Next</strong>.</li> </ul> </li> - <li>Click <strong>Finish</strong>.</li> + <li>In the <strong>Configure Project</strong> page, select the desired settings and click + <strong>Next</strong>. Leave the <strong>Create activity</strong> option checked so you can + start your application with some essential components.</li> + + <li>In the <strong>Configure Launcher Icon</strong> page, create an icon and click + <strong>Next</strong>.</li> + + <li>In the <strong>Create Activity</strong> page, select activity template and click + <strong>Next</strong>. For more information about Android code templates, see + <a href="{@docRoot}tools/projects/templates.html">Using Code Templates</a>. + </li> + + <li>Click <strong>Finish</strong> and the wizard creates a new project according to the options + you have chosen.</li> </ol> - <p class="note"><strong>Tip:</strong> You can also start the New Project Wizard from the - <em>New</em> icon in the toolbar.</p> + <p class="note"><strong>Tip:</strong> You can also start the New Project Wizard by clicking the + <strong>New</strong> <img src="/images/tools/eclipse-new.png" + style="vertical-align:baseline;margin:0"> icon in the toolbar.</p> + <h2 id="SettingUpLibraryProject">Setting up a Library Project</h2> <p>A library project is a standard Android project, so you can create a new one in the same way as you would a new application project.</p> - <p>When you are creating the library project, you can select any application name, package, and - set other fields as needed, as shown in figure 1.</p> + <p>To create a new library project:</p> + + <ol> + <li>Select <strong>File</strong> > <strong>New</strong> > <strong>Project</strong>.</li> + + <li>Select <strong>Android</strong> > <strong>Android Application Project</strong>, and click + <strong>Next</strong>.</li> - <p>Next, set the project's properties to indicate that it is a library project:</p> + <li>Enter the basic settings for the project, including <strong>Application Name</strong>, + <strong>Project Name</strong>, <strong>Package Name</strong>, and SDK settings.</li> + + <li>In the <strong>Configure Project</strong> page, select the <strong>Mark this project as a + library</strong> option to flag the project as a library.</li> + + <li>Set the other options as desired and click <strong>Next</strong>.</li> + + <li>Follow the instructions to complete the wizard and create a new library project.</li> + </ol> + + <p>You can also convert an existing application project into a library. To do so, simply open the + Properties for the project and select the <strong>is Library</strong> checkbox, as shown in + the figure below.</p> + + <img src= "{@docRoot}images/developing/adt-props-isLib.png"> + <p class="img-caption"><strong>Figure 1.</strong> Marking a project as an Android library.</p> + + <p>To set the a project's properties to indicate that it is a library project:</p> <ol> <li>In the <strong>Package Explorer</strong>, right-click the library project and select <strong>Properties</strong>.</li> - <li>In the <strong>Properties</strong> window, select the "Android" properties group at left - and locate the <strong>Library</strong> properties at right.</li> + <li>In the <strong>Properties</strong> window, select the <strong>Android</strong> properties + group in the left pane and locate the <strong>Library</strong> properties in the right pane.</li> - <li>Select the "is Library" checkbox and click <strong>Apply</strong>.</li> + <li>Select the <strong>is Library</strong> check box and click <strong>Apply</strong>.</li> - <li>Click <strong>OK</strong> to close the <em>Properties</em> window.</li> + <li>Click <strong>OK</strong> to close the <strong>Properties</strong> window.</li> </ol> - <p>The new project is now marked as a library project. You can begin moving source code and - resources into it, as described in the sections below.</p> + <p>Once you create a library project or mark an existing project as a library, you can reference + the library project in other Android application projects. For more information, see the + <a href="#ReferencingLibraryProject">Referencing a library project</a> section. - <p>You can also convert an existing application project into a library. To do so, simply open the - Properties for the project and select the "is Library" checkbox. Other application projects can - now reference the existing project as a library project.</p> - - <img src= "{@docRoot}images/developing/adt-props-isLib.png"> - - <p class="img-caption"><strong>Figure 1.</strong> Marking a project as an - Android library project.</p> <h3>Creating the manifest file</h3> @@ -146,7 +179,7 @@ parent.link=index.html <p>For example, the <a href= "{@docRoot}resources/samples/TicTacToeLib/AndroidManifest.html">TicTacToeLib</a> example library - project declares the Activity <code>GameActivity</code>:</p> + project declares the activity <code>GameActivity</code>:</p> <pre> <manifest> ... @@ -167,6 +200,9 @@ parent.link=index.html <p>To add a reference to a library project, follow these steps:</p> <ol> + <li>Make sure that both the project library and the application project that depends on it are + in your workspace. If one of the projects is missing, import it into your workspace.</li> + <li>In the <strong>Package Explorer</strong>, right-click the dependent project and select <strong>Properties</strong>.</li> @@ -214,7 +250,7 @@ parent.link=index.html <p>For example, the <a href= "{@docRoot}resources/samples/TicTacToeMain/AndroidManifest.html">TicTacToeMain</a> example - application declares the library Activity <code>GameActivity</code> like this:</p> + application declares the library activity <code>GameActivity</code> like this:</p> <pre> <manifest> ... diff --git a/docs/html/tools/projects/templates.jd b/docs/html/tools/projects/templates.jd new file mode 100644 index 0000000..fce24fd --- /dev/null +++ b/docs/html/tools/projects/templates.jd @@ -0,0 +1,347 @@ +page.title=Using Code Templates +@jd:body + + <div id="qv-wrapper"> + <div id="qv"> + <h2>In this document</h2> + + <ol> + <li><a href="#app-templates">Application Templates</a> + <ol> + <li><a href="#blank-activity">BlankActivity Template</a></li> + <li><a href="#full-screen-activity">Full Screen Activity Template</a></li> + <li><a href="#master-detail-activity">Master Detail Flow Template</a></li> + </ol> + </li> + + <li><a href="#activity-templates">Activity Templates</a> + <ol> + <li><a href="#login-activity">Login Activity Template</a></li> + <li><a href="#settings-activity">Settings Activity Template</a></li> + </ol> + </li> + <li><a href="#object-templates">Other Templates</a></li> + </ol> + + </div> + </div> + + +<p>The SDK tools provide templates for quickly creating Android application projects with the basic + structure or for adding components to your existing projects. The code templates + provided by the Android SDK follow the Android design and development guidelines to get you on the + right track to creating a beautiful, functional application.</p> + +<p>There are several types of Android code templates, which can create anything from an entire + application down to specific application components. The main categories of code templates are as + follows:</p> + +<ul> + <li><a href="#app-templates">Application Templates</a></li> + <li><a href="#activity-templates">Activity Templates</a></li> + <li><a href="#object-templates">Other Templates</a></li> +</ul> + + +<h2 id="app-templates">Application Templates</h2> + +<p>Application templates create basic Android applications that you can immediately run and test + on your Android device. These templates are available when you create a new Android project, + though you can also use these templates to <a href="#activity-templates">add new activities</a> + to an existing project.</p> + +<p>To use Android application templates:</p> + +<ol> + <li>In Eclipse, with the Android Development Tools (ADT) plugin installed, select <strong>File + > New > Android</strong>.</li> + <li>Select <strong>Android > Android Application Project</strong>, and click + <strong>Next</strong>.</li> + <li>Enter the settings for your application, including <strong>Application Name</strong>, + <strong>Project Name</strong>, <strong>Package Name</strong>, API level settings and + presentation <strong>Theme</strong>, and click <strong>Next</strong>.</li> + <li>Enter the project configuration options, and click <strong>Next</strong>.</li> + <li>Optionally enter launcher icon settings, and click <strong>Next</strong>.</li> + <li>In the <strong>Create Activity</strong> page, select an application template to use. + <ul> + <li><a href="#blank-activity">BlankActivity</a></li> + <li><a href="#full-screen-activity">FullScreenActivity</a></li> + <li><a href="#master-detail-activity">MasterDetailFlow</a></li> + </ul> + </li> +</ol> + +<p class="note"> + <strong>Note:</strong> The other activity template options also create applications, however these + applications require further modification before they can be launched on an Android device. +</p> + + +<h3 id="blank-activity">Blank Activity Template</h3> + +<table> + <tr> + <th width="206px">Example</th> + + <th>Description</th> + </tr> + + <tr> + <td><img src="{@docRoot}images/code_templates/ba-no-navigation.png" alt="" /> + </td> + + <td><p>The <strong>BlankActivity</strong> template with the <strong>Navigation Type: + None</strong> option creates a simple application that follows the + <a href="{@docRoot}design/index.html">Android Design</a> guidelines. Use this template to + create a basic, minimal app as a starting point for your project.</p> + + <p>This template includes:</p> + + <ul> + <li>Title bar ({@link android.app.ActionBar} on Android 3.0 and later)</li> + <li>Options menu (action overflow on Android 3.0 and later) </li> + <li>Basic layout</li> + </ul> + </td> + </tr> + + <tr> + <td><img src="{@docRoot}images/code_templates/ba-tabs.png" alt="" /> + </td> + + <td><p>The <strong>BlankActivity</strong> template with the <strong>Navigation Type: + Tabs</strong> or <strong>Tabs + Swipe</strong> option creates an application with + three sections based on the {@link android.app.Fragment} class and a tabbed user + interface.</p> + + <p>This template includes:</p> + + <ul> + <li>{@link android.app.ActionBar} for tab controls</li> + <li>{@link android.app.Fragment} objects for section content</li> + <li>Optional swipe gesture support based on the + <a href="{@docRoot}design/patterns/swipe-views.html">swipe view</a> design pattern, + which extends {@link android.support.v4.app.FragmentPagerAdapter} to manage section + fragments</li> + </ul> + </td> + </tr> + + <tr> + <td><img src="{@docRoot}images/code_templates/ba-title-strip.png" alt="" /> + </td> + + <td><p>The <strong>BlankActivity</strong> template with the <strong>Navigation Type: + Swipe Views + Title Strip</strong> option creates an application with three + {@link android.app.Fragment} sections, a compact title strip header (known as + <a href="{@docRoot}design/building-blocks/tabs.html#scrollable">Scrollable Tabs</a> in the + <a href="{@docRoot}design/index.html">Android Design</a> guide) and swipe navigation between + the sections, based on the <a href="{@docRoot}design/patterns/swipe-views.html">swipe + view</a> design pattern.</p> + + <p>This template includes:</p> + + <ul> + <li>{@link android.support.v4.view.PagerTitleStrip} for section titles</li> + <li>{@link android.app.Fragment} objects for section content</li> + <li>{@link android.support.v4.app.FragmentPagerAdapter} to manage section fragments</li> + </ul> + </td> + </tr> + + <tr> + <td><img src="{@docRoot}images/code_templates/ba-dropdown.png" alt="" /> + </td> + + <td><p>The <strong>BlankActivity</strong> template with the <strong>Navigation Type: + Dropdown</strong> option creates an application that extends + {@link android.support.v4.app.FragmentActivity}, containing three + {@link android.app.Fragment} sections, with an {@link android.app.ActionBar} using list mode + navigation.</p> + + <p>This template includes:</p> + + <ul> + <li>{@link android.app.ActionBar} for list mode navigation</li> + <li>{@link android.app.Fragment} objects for section content</li> + </ul> + </td> + </tr> +</table> + + +<h3 id="full-screen-activity">Full Screen Activity Template</h3> + +<table> + <tr> + <th width="240px">Example</th> + + <th>Description</th> + </tr> + + <tr> + <td><img src="{@docRoot}images/code_templates/full-screen-activity.png" alt="" /> + </td> + + <td><p>This template provides an implementation of an activity which alternates between a + primary, full screen view and a view with standard user interface controls, including the + notification bar and application title bar. The full screen view is the default and a user + can activate the standard view by touching the device screen.</p> + + <p>This template includes:</p> + + <ul> + <li>{@code SystemUiHider} implementation that manages hiding of the system user interface + using a version-compatible approach</li> + <li>Basic layout</li> + </ul> + </td> + </tr> +</table> + + +<h3 id="master-detail-activity">Master Detail Flow Template</h3> + +<table> + <tr> + <th width="350px">Example</th> + + <th>Description</th> + </tr> + + <tr> + <td><img src="{@docRoot}images/code_templates/master-detail-flow.png" alt=""/> + </td> + + <td><p>This template creates an adaptive layout for a set of items and associated details. On a + tablet device, the item list and item details are displayed on the same screen. On a smaller + device, the list and details are displayed on separate screens.</p> + + <p class="note"> + <strong>Note:</strong> This template follows the recommendations of the + <a href="{@docRoot}training/multiscreen/index.html">Designing for Multiple Screens</a> + Android training. + </p> + + <p>This template includes:</p> + + <ul> + <li>Adaptive layout using + <a href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources" + >alternative resource</a> XML files</li> + <li>{@link android.support.v4.app.FragmentActivity}, {@link android.app.Fragment} and + {@link android.support.v4.app.ListFragment} implementations</li> + </ul></td> + </tr> +</table> + + +<h2 id="activity-templates">Activity Templates</h2> + +<p>Android activity templates provide options to add new activities to your existing + application.</p> + +<p>To use Android activity templates:</p> + +<ol> + <li>Right click the project folder of the Android application where you want to add an + activity.</li> + <li>Select <strong>New > Other...</strong></li> + <li>Select <strong>Android > Android Activity</strong>, and click <strong>Next</strong>.</li> + <li>Select an activity template, then follow the instructions to add it to your existing + application. + <ul> + <li><a href="#login-activity">LoginActivity</a></li> + <li><a href="#settings-activity">SettingsActivity</a></li> + <li><a href="#blank-activity">BlankActivity</a></li> + <li><a href="#full-screen-activity">FullScreenActivity</a></li> + <li><a href="#master-detail-activity">MasterDetailFlow</a></li> + </ul> + </li> +</ol> + +<p>These templates create the same type of activity as they do when used as an application template, +however the following templates create activities which are specifically intended to be used as part +of an existing application.</p> + + +<h3 id="login-activity">Login Activity Template</h3> + +<table> + <tr> + <th width="206px">Example</th> + + <th>Description</th> + </tr> + + <tr> + <td><img src="{@docRoot}images/code_templates/login-activity.png" alt="" /> + </td> + + <td><p>This activity template provides input fields and a sample implementation of + an {@link android.os.AsyncTask} that asks users to login or register with their credentials.</p> + + <p>This template includes:</p> + + <ul> + <li>Recommended user interface for requesting login information</li> + <li>{@link android.os.AsyncTask} implementation for handing network operations separately + from the main user interface thread</li> + <li>Progress indicator during network operations</li> + </ul> + </td> + </tr> +</table> + + +<h3 id="settings-activity">Settings Activity Template</h3> + +<table> + <tr> + <th width="206px">Example</th> + + <th>Description</th> + </tr> + + <tr> + <td><img src="{@docRoot}images/code_templates/settings-activity.png" alt="" /> + </td> + + <td><p>This template extends the {@link android.preference.PreferenceActivity} class and uses an + XML file to create preference settings. This template also demonstrates how to implement + several data types for settings.</p> + + <p>This template includes:</p> + + <ul> + <li>Activity extending {@link android.preference.PreferenceActivity}</li> + <li>Preference values defined using XML files added to the {@code res/xml/} directory of + your project.</li> + </ul> + </td> + </tr> +</table> + + +<h2 id="object-templates">Other Templates</h2> + +<p>Android object templates provide options to add new components to your existing application, +including the previously mentioned activities as well as the following additional items:</p> + +<p>To use Android object templates:</p> + +<ol> + <li>Right click the project folder of the Android application where you want to add a code + component.</li> + <li>Select <strong>New > Other...</strong></li> + <li>Select <strong>Android > Android Object</strong>, and click <strong>Next</strong>.</li> + <li>Select an object template, then follow the instructions to add it to your existing + application. + <ul> + <li>{@link android.content.BroadcastReceiver}</li> + <li>{@link android.content.ContentProvider}</li> + <li><a href="{@docRoot}guide/topics/ui/custom-components.html">Custom View</a></li> + <li>{@link android.app.Service}</li> + </ul> + </li> +</ol> diff --git a/docs/html/tools/publishing/app-signing.jd b/docs/html/tools/publishing/app-signing.jd index ac45242..608780e 100644 --- a/docs/html/tools/publishing/app-signing.jd +++ b/docs/html/tools/publishing/app-signing.jd @@ -96,8 +96,7 @@ you compile.</p> you don't have a private key, you can use the Keytool utility to create one for you. When you compile your application in release mode, the build tools use your private key along with the Jarsigner utility to sign your application's <code>.apk</code> file. Because the certificate and -private key you use are your own, you will have to provide the password for the keystore and key -alias.</p> +private key you use are your own, you must provide the password for the keystore and key alias.</p> <p>The debug signing process happens automatically when you run or debug your application using Eclipse with the ADT plugin. Debug signing also happens automatically when you use the Ant build @@ -117,13 +116,13 @@ lifespan of your applications. There are several reasons why you should do so: < <ul> <li>Application upgrade – As you release updates to your application, you -will want to continue to sign the updates with the same certificate or set of -certificates, if you want users to upgrade seamlessly to the new version. When +must continue to sign the updates with the same certificate or set of certificates, +if you want users to be able to upgrade seamlessly to the new version. When the system is installing an update to an application, it compares the certificate(s) in the new version with those in the existing version. If the certificates match exactly, including both the certificate data and order, then the system allows the update. If you sign the new version without using matching -certificates, you will also need to assign a different package name to the +certificates, you must also assign a different package name to the application — in this case, the user installs the new version as a completely new application. </li> @@ -314,6 +313,13 @@ your key secure and why doing so is critically important to you and to users. In particular, when you are generating your key, you should select strong passwords for both the keystore and key.</p> +<p class="warning"><strong>Warning:</strong> Keep the keystore file you generate with Keytool +in a safe, secure place. You must use the same key to sign future versions of your application. If +you republish your app with a new key, Google Play will consider it a new app. For more information +on settings that must remain constant over the life of your app, see the Android Developer Blog post +<a href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">Things +That Cannot Change</a>.</p> + <table> <tr> <th>Keytool Option</th> @@ -597,6 +603,10 @@ replace your authentic applications or corrupt them. Such a person could also sign and distribute applications under your identity that attack other applications or the system itself, or corrupt or steal user data. </p> +<p>Your private key is required for signing all future versions of your application. If you lose or +misplace your key, you will not be able to publish updates to your existing application. You cannot +regenerate a previously generated key.</p> + <p>Your reputation as a developer entity depends on your securing your private key properly, at all times, until the key is expired. Here are some tips for keeping your key secure: </p> @@ -612,7 +622,9 @@ which any user on your computer could access.</li> options at the command line. </li> <li>Do not give or lend anyone your private key, and do not let unauthorized persons know your keystore and key passwords.</li> +<li>Keep the keystore file containing your private key that you <a href="#cert">generate with the +Keytool</a> in a safe, secure place.</li> </ul> <p>In general, if you follow common-sense precautions when generating, using, -and storing your key, it will remain secure. </p>
\ No newline at end of file +and storing your key, it will remain secure. </p> diff --git a/docs/html/tools/publishing/preparing.jd b/docs/html/tools/publishing/preparing.jd index 3ebf3f7..b1585f0 100644 --- a/docs/html/tools/publishing/preparing.jd +++ b/docs/html/tools/publishing/preparing.jd @@ -246,7 +246,7 @@ application on Google Play. For example, the <code>android:minSdkVersion</code> <code>android:targetSdkVersion</code> attributes, which are located in the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"> <uses-sdk></a> element. For more information about these and other Google Play settings, see <a -href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a>.</p> +href="{@docRoot}google/play/filters.html">Filters on Google Play</a>.</p> <h4>Address compatibility issues</h4> @@ -291,7 +291,7 @@ current user has purchased it. Using Google Play Licensing is optional even if y releasing your app through Google Play.</p> <p>For more information about Google Play Licensing Service and how to use it in your -application, see <a href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a>.</p> +application, see <a href="{@docRoot}google/play/licensing/index.html">Application Licensing</a>.</p> <h2 id="publishing-build">Building Your Application for Release</h2> @@ -333,7 +333,7 @@ information about the signing process and signing guidelines.</p> <p>If your application relies on a remote server, make sure the server is secure and that it is configured for production use. This is particularly important if you are implementing <a -href="{@docRoot}guide/google/play/billing/index.html">in-app billing</a> in your application and you are +href="{@docRoot}google/play/billing/index.html">in-app billing</a> in your application and you are performing the signature verification step on a remote server.</p> <p>Also, if your application fetches content from a remote server or a real-time service (such as a diff --git a/docs/html/tools/publishing/publishing_overview.jd b/docs/html/tools/publishing/publishing_overview.jd index 572766c..ea01e20 100755 --- a/docs/html/tools/publishing/publishing_overview.jd +++ b/docs/html/tools/publishing/publishing_overview.jd @@ -127,8 +127,8 @@ your Android applications to users around the world. When you release your appli Google Play you have access to a suite of developer tools that let you analyze your sales, identify market trends, and control who your applications are being distributed to. You also have access to several revenue-enhancing features such as <a -href="{@docRoot}guide/google/play/billing/index.html">in-app billing</a> and <a -href="{@docRoot}guide/google/play/licensing/index.html">application licensing</a>. The rich array of tools +href="{@docRoot}google/play/billing/index.html">in-app billing</a> and <a +href="{@docRoot}google/play/licensing/index.html">application licensing</a>. The rich array of tools and features, coupled with numerous end-user community features, makes Google Play the premier marketplace for selling and buying Android applications.</p> @@ -207,9 +207,9 @@ the user has configured their Settings to allow the installation of apps from website, it can be inefficient. For example, if you want to monetize your application you will have to process and track all financial transactions yourself and you will not be able to use Google Play's <a -href="{@docRoot}guide/google/play/billing/index.html">In-app Billing service</a> +href="{@docRoot}google/play/billing/index.html">In-app Billing service</a> to sell in-app products. In addition, you will not be able to use the <a -href="{@docRoot}guide/google/play/licensing/index.html">Licensing service</a> to +href="{@docRoot}google/play/licensing/index.html">Licensing service</a> to help prevent unauthorized installation and use of your application.</p> diff --git a/docs/html/tools/revisions/platforms.jd b/docs/html/tools/revisions/platforms.jd index 178ab90..c1bc185 100644 --- a/docs/html/tools/revisions/platforms.jd +++ b/docs/html/tools/revisions/platforms.jd @@ -7,6 +7,8 @@ page.title=Platforms <h2>See Also</h2> <ol> + <li><a href="{@docRoot}about/versions/jelly-bean.html">Jelly Bean +Highlights and APIs</a></li> <li><a href="{@docRoot}about/versions/android-4.0-highlights.html">Ice Cream Sandwich Highlights and APIs</a></li> <li><a href="{@docRoot}about/versions/android-3.0-highlights.html">Honeycomb @@ -34,6 +36,97 @@ version.</p> +<h2 id="4.2">Android 4.2</h2> + + +<p class="caution"><strong>Important:</strong> To download the new Android +4.2.x system components from the Android SDK Manager, you must first update the +SDK tools to revision 20 or later and restart the Android SDK Manager. If you do not, +the Android 4.2 system components will not be available for download.</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="" />Revision 1</a> <em>(November 2012)</em> + </p> + + <div class="toggle-content-toggleme"> + + <p>Initial release. The system version is 4.2.</p> + <dl> + <dt>Dependencies:</dt> + <dd>SDK Tools r20 or higher is required.</dd> + </dl> + + </div> +</div> + +<h3>Device Definitions</h3> + +<p>The platform includes the following 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 7 (7.3", 800 x 1280, Large tvdpi screen) + </li> + <li> + Galaxy Nexus (4.7", 720 x 1280, Normal xhdpi screen) + </li> + <li> + Nexus S (4.0", 480 x 800, Normal hdpi screen) + </li> + <li> + Nexus One (3.7", 480 x 720, Normal hdpi screen) + </li> + <li> + 10.1" WXGA Tablet (1280 x 800, X-Large mdpi screen) + </li> + <li> + 7.0" WSVGA Tablet (1024 x 600, Large mdpi screen) + </li> + <li> + 5.4" FWVGA (480 x 854, Large mdpi screen) + </li> + <li> + 5.1" WVGA (480 x 800, Large mdpi screen) + </li> + <li> + 4.7" WXGA (1280 x 720, Normal xhdpi screen) + </li> + <li> + 4.65" 720p (720 x 1280, Normal xhdpi screen) + </li> + <li> + 4.0" WVGA (480 x 800, Normal hdpi screen) + </li> + <li> + 3.7" WVGA (480 x 800, Normal hdpi screen) + </li> + <li> + 3.7" FWVGA slider (480 x 854, Normal hdpi screen) + </li> + <li> + 3.4" WQVGA (240 x 432, Normal ldpi screen) + </li> + <li> + 3.3" WQVGA (240 x 400, Normal ldpi screen) + </li> + <li> + 3.2" QVGA ADP2 (320 x 480, Normal mdpi screen) + </li> + <li> + 3.2" HVGA slider ADP1 (320 x 480, Normal mdpi screen) + </li> + <li> + 2.7" QVGA slider (240 x 320, Small ldpi screen) + </li> + <li> + 2.7" QVGA (240 x 320, Small ldpi screen) + </li> +</ul> @@ -41,15 +134,15 @@ version.</p> <p class="caution"><strong>Important:</strong> To download the new Android -4.0.x system components from the Android SDK Manager, you must first update the +4.1.x system components from the Android SDK Manager, you must first update the SDK tools to revision 20 or later and restart the Android SDK Manager. If you do not, the Android 4.1 system components will not be available for download.</p> -<div class="toggle-content opened"> +<div class="toggle-content closed"> <p><a href="#" onclick="return toggleContent(this)"> - <img src="{@docRoot}assets/images/triangle-opened.png" + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt="" />Revision 3</a> <em>(October 2012)</em> </p> diff --git a/docs/html/tools/sdk/eclipse-adt.jd b/docs/html/tools/sdk/eclipse-adt.jd index f2ff07c..4adb7b2 100644 --- a/docs/html/tools/sdk/eclipse-adt.jd +++ b/docs/html/tools/sdk/eclipse-adt.jd @@ -57,6 +57,182 @@ 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 21.1.0</a> <em>(February 2013)</em> + </p> + + <div class="toggle-content-toggleme"> +<dl> + <dt>Dependencies:</dt> + + <dd> + <ul> + <li>Java 1.6 or higher is required for ADT 21.1.0.</li> + <li>Eclipse Helios (Version 3.6.2) or higher is required for ADT 21.1.0.</li> + <li>ADT 21.1.0 is designed for use with <a href="{@docRoot}tools/sdk/tools-notes.html">SDK + Tools r21.1.0</a>. If you haven't already installed SDK Tools r21.1.0 into your SDK, use the + Android SDK Manager to do so.</li> + </ul> + </dd> + + <dt>General Notes:</dt> + <dd> + <ul> + <li>Added new <a href="{@docRoot}tools/projects/templates.html">code templates</a> for + notifications, blank fragments and list fragments.</li> + <li>Added support for resource rename refactoring. Renaming a resource XML file, drawable + icon, an {@code R.} field name or ID in the layout editor invokes a refactoring routine + to update all resource references.</li> + <li>Added more than 15 new Lint checks, including checks for overriding older APIs, XML + resource problems, graphic asset issues and manifest tags. + <li>Updated XML Editor to respond to refactoring shortcut keys such as <strong>Refactor + > Rename</strong>.</li> + <li>Updated XML Editor to improve double click handling.</li> + <li>Added code completion improvements for custom views, theme references and class + references. For example, code completion in a {@code <fragment android:name=””>} tag + now suggests completion with a list of fragment classes. Similarly, code completion in the + manifest now offers implementations suitable for the given tag.</li> + <li>Updated the <strong>Project Import</strong> dialog so that it shows a table for all + imported projects where you can edit the name of the imported project.</li> + <li>Added support for layout aliases in the Layout Editor.</li> + </ul> + </dd> + + <dt>Bug fixes:</dt> + <dd> + <ul> + <li>Fixed issued with refactoring support for renaming and moving classes and packages. + </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 21.0.1</a> <em>(December 2012)</em> + </p> + + <div class="toggle-content-toggleme"> +<dl> + <dt>Dependencies:</dt> + + <dd> + <ul> + <li>Java 1.6 or higher is required for ADT 21.0.1.</li> + <li>Eclipse Helios (Version 3.6.2) or higher is required for ADT 21.0.1.</li> + <li>ADT 21.0.1 is designed for use with <a href="{@docRoot}tools/sdk/tools-notes.html">SDK + Tools r21.0.1</a>. If you haven't already installed SDK Tools r21.0.1 into your SDK, use the + Android SDK Manager to do so.</li> + </ul> + </dd> + + <dt>General Notes:</dt> + <dd> + <ul> + <li>Build + <ul> + <li>Updated build to detect and handle package name conflicts between an application and + the libraries it depends on. Libraries cannot share package names unless all of them + share the same package name. + (<a href="http://code.google.com/p/android/issues/detail?id=40152">Issue 40152</a>, + <a href="http://code.google.com/p/android/issues/detail?id=40273">Issue 40273</a>) + </li> + <li>Added a flag to disable dex merging to deal with cases where merging could generate + a broken dex file. If this happens to your project, add the following setting to your + {@code project.properties} file: {@code dex.disable.merger=true} This setting + causes the build system to revert to the older, slower dex processing that does not + pre-dex libraries.</li> + </ul> + </li> + </ul> + </dd> + + <dt>Bug fixes:</dt> + <dd> + <ul> + <li>Lint + <ul> + <li>Corrected check for {@code 0px} values in style XML elements. + (<a href="http://code.google.com/p/android/issues/detail?id=39601">Issue 39601</a>) + </li> + <li>Fixed incorrect flagging of formatting strings. + (<a href="http://code.google.com/p/android/issues/detail?id=39758">Issue 39758</a>) + </li> + <li>Fixed problem where {@code tools:ignore} directive in the manifest file was ignored + by the Lint tool. + (<a href="http://code.google.com/p/android/issues/detail?id=40136">Issue 40136</a>) + </li> + <li>Fixed problem with flagging a wakelock release inside a conditional. + (<a href="http://code.google.com/p/android/issues/detail?id=40424">Issue 40424</a>) + </li> + <li>Fixed incorrect reporting of missing {@code layout_width} and {@code layout_height} + XML fields. + (<a href="http://code.google.com/p/android/issues/detail?id=38958">Issue 38958</a>) + </li> + <li>Fixed handling of custom namespace attributes.</li> + <li>Added fixes for filtering out library project warnings.</li> + <li>Removed warnings about missing classes before a build.</li> + </ul> + </li> + + <li>Android Virtual Device Manager + <ul> + <li>Fixed handling of {@code devices.xml} file in other locales. + (<a href="http://code.google.com/p/android/issues/detail?id=39704">Issue 39704</a>) + </li> + <li>Fixed problem where the AVD Manager would not allow you to create a new AVD using + the <strong>4.0" WVGA</strong> or <strong> 4.65" 720p</strong> device definitions. + (<a href="http://code.google.com/p/android/issues/detail?id=39939">Issue 39939</a>) + </li> + <li>Fixed problem where deleted device definitions were not removed.</li> + <li>Fixed incorrect screen resolution setting for the Nexus One device definition.</li> + <li>Fixed problem where writing of an AVD settings file does not properly escape + {@code \\} path characters.</li> + </ul> + </li> + + <li>Layout Editor + <ul> + <li>Fixed problem where layout cannot render strings starting with {@code \@}. + (<a href="http://code.google.com/p/android/issues/detail?id=40222">Issue 40222</a>) + </li> + <li>Fixed preview error when using the {@code android:numColumns} attribute in a layout. + (<a href="http://code.google.com/p/android/issues/detail?id=21296">Issue 21296</a>) + </li> + <li>Fixed compatibility issue with IntelliJ layout preview caused by layout editor + deleting the {@code .android/devices.xml} file.</li> + <li>Added fixes to editor for {@link android.widget.GridLayout}.</li> + </ul> + </li> + + <li>Added support for {@code ldrtl} and {@code ldltr} resource qualifiers.</li> + <li>Fixed problem where Android XML resources mistakenly get compiled into {@code *.out.xml} + output files, causing project errors. + (<a href="http://code.google.com/p/android/issues/detail?id=3767">Issue 3767</a>)</li> + <li>Fixed error which caused resource refresh operations to fail. + (<a href="http://code.google.com/p/android/issues/detail?id=39213">Issue 39213</a>)</li> + <li>Updated the Custom View code template handle to library projects properly.</li> + <li>Fixed support for library string resources ({@code strings.xml}) when exporting an + application that references a library with string resources. + (<a href="http://code.google.com/p/android/issues/detail?id=39751">Issue 39751</a>)</li> + <li>Fixed problem where bad AVD setting files caused Device Manager and graphical XML editors + to crash. + (<a href="http://code.google.com/p/android/issues/detail?id=40400">Issue 40400</a>)</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 21.0.0</a> <em>(November 2012)</em> </p> diff --git a/docs/html/tools/sdk/images/2.0/camera-modes.png b/docs/html/tools/sdk/images/2.0/camera-modes.png Binary files differdeleted file mode 100644 index ac4c1da..0000000 --- a/docs/html/tools/sdk/images/2.0/camera-modes.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.0/email-inbox.png b/docs/html/tools/sdk/images/2.0/email-inbox.png Binary files differdeleted file mode 100644 index 50d1c19..0000000 --- a/docs/html/tools/sdk/images/2.0/email-inbox.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.0/mms-search.png b/docs/html/tools/sdk/images/2.0/mms-search.png Binary files differdeleted file mode 100644 index 22c7dca..0000000 --- a/docs/html/tools/sdk/images/2.0/mms-search.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.0/multiple-accounts.png b/docs/html/tools/sdk/images/2.0/multiple-accounts.png Binary files differdeleted file mode 100644 index aa4cb15..0000000 --- a/docs/html/tools/sdk/images/2.0/multiple-accounts.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.0/quick-connect.png b/docs/html/tools/sdk/images/2.0/quick-connect.png Binary files differdeleted file mode 100644 index 0bbf7dd..0000000 --- a/docs/html/tools/sdk/images/2.0/quick-connect.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.2/22browser.png b/docs/html/tools/sdk/images/2.2/22browser.png Binary files differdeleted file mode 100644 index 817439d..0000000 --- a/docs/html/tools/sdk/images/2.2/22browser.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.2/22exchange.png b/docs/html/tools/sdk/images/2.2/22exchange.png Binary files differdeleted file mode 100644 index 1fa1f59..0000000 --- a/docs/html/tools/sdk/images/2.2/22exchange.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.2/22gallery.png b/docs/html/tools/sdk/images/2.2/22gallery.png Binary files differdeleted file mode 100644 index 0cb74ad..0000000 --- a/docs/html/tools/sdk/images/2.2/22gallery.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.2/22home.png b/docs/html/tools/sdk/images/2.2/22home.png Binary files differdeleted file mode 100644 index a11ea30..0000000 --- a/docs/html/tools/sdk/images/2.2/22home.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.2/22hotspot.png b/docs/html/tools/sdk/images/2.2/22hotspot.png Binary files differdeleted file mode 100644 index 0951439..0000000 --- a/docs/html/tools/sdk/images/2.2/22hotspot.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.2/22keyboard.png b/docs/html/tools/sdk/images/2.2/22keyboard.png Binary files differdeleted file mode 100644 index 69f95ca..0000000 --- a/docs/html/tools/sdk/images/2.2/22keyboard.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.2/jit-graph.png b/docs/html/tools/sdk/images/2.2/jit-graph.png Binary files differdeleted file mode 100644 index 52b8d60..0000000 --- a/docs/html/tools/sdk/images/2.2/jit-graph.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.3/ffc.png b/docs/html/tools/sdk/images/2.3/ffc.png Binary files differdeleted file mode 100644 index 136a395..0000000 --- a/docs/html/tools/sdk/images/2.3/ffc.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.3/home-menu.png b/docs/html/tools/sdk/images/2.3/home-menu.png Binary files differdeleted file mode 100644 index e9c8620..0000000 --- a/docs/html/tools/sdk/images/2.3/home-menu.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.3/home-plain.png b/docs/html/tools/sdk/images/2.3/home-plain.png Binary files differdeleted file mode 100644 index a6255f6..0000000 --- a/docs/html/tools/sdk/images/2.3/home-plain.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.3/nfc.png b/docs/html/tools/sdk/images/2.3/nfc.png Binary files differdeleted file mode 100644 index a21b6ab..0000000 --- a/docs/html/tools/sdk/images/2.3/nfc.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.3/onetouch.png b/docs/html/tools/sdk/images/2.3/onetouch.png Binary files differdeleted file mode 100644 index 2789612..0000000 --- a/docs/html/tools/sdk/images/2.3/onetouch.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.3/power.png b/docs/html/tools/sdk/images/2.3/power.png Binary files differdeleted file mode 100644 index 7b0785d..0000000 --- a/docs/html/tools/sdk/images/2.3/power.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.3/running.png b/docs/html/tools/sdk/images/2.3/running.png Binary files differdeleted file mode 100644 index fe9a1a0..0000000 --- a/docs/html/tools/sdk/images/2.3/running.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.3/selection.png b/docs/html/tools/sdk/images/2.3/selection.png Binary files differdeleted file mode 100644 index 46ff28c..0000000 --- a/docs/html/tools/sdk/images/2.3/selection.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/2.3/sipcall.png b/docs/html/tools/sdk/images/2.3/sipcall.png Binary files differdeleted file mode 100644 index 48a5a1d..0000000 --- a/docs/html/tools/sdk/images/2.3/sipcall.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/browser.png b/docs/html/tools/sdk/images/3.0/browser.png Binary files differdeleted file mode 100644 index 0f16b27..0000000 --- a/docs/html/tools/sdk/images/3.0/browser.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/browser_full.png b/docs/html/tools/sdk/images/3.0/browser_full.png Binary files differdeleted file mode 100644 index 08a329d..0000000 --- a/docs/html/tools/sdk/images/3.0/browser_full.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/camera.png b/docs/html/tools/sdk/images/3.0/camera.png Binary files differdeleted file mode 100644 index 7dabdfc..0000000 --- a/docs/html/tools/sdk/images/3.0/camera.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/camera_full.png b/docs/html/tools/sdk/images/3.0/camera_full.png Binary files differdeleted file mode 100644 index 3ee95c9..0000000 --- a/docs/html/tools/sdk/images/3.0/camera_full.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/contacts.png b/docs/html/tools/sdk/images/3.0/contacts.png Binary files differdeleted file mode 100644 index 9304701..0000000 --- a/docs/html/tools/sdk/images/3.0/contacts.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/contacts_full.png b/docs/html/tools/sdk/images/3.0/contacts_full.png Binary files differdeleted file mode 100644 index b5eaf5b..0000000 --- a/docs/html/tools/sdk/images/3.0/contacts_full.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/copy.png b/docs/html/tools/sdk/images/3.0/copy.png Binary files differdeleted file mode 100644 index d5a4c3e..0000000 --- a/docs/html/tools/sdk/images/3.0/copy.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/copy_full.png b/docs/html/tools/sdk/images/3.0/copy_full.png Binary files differdeleted file mode 100644 index 124cf52..0000000 --- a/docs/html/tools/sdk/images/3.0/copy_full.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/home_hero1.png b/docs/html/tools/sdk/images/3.0/home_hero1.png Binary files differdeleted file mode 100644 index c00391f..0000000 --- a/docs/html/tools/sdk/images/3.0/home_hero1.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/home_hero1_full.png b/docs/html/tools/sdk/images/3.0/home_hero1_full.png Binary files differdeleted file mode 100644 index 1910ed2..0000000 --- a/docs/html/tools/sdk/images/3.0/home_hero1_full.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/homescreen_cust_port.png b/docs/html/tools/sdk/images/3.0/homescreen_cust_port.png Binary files differdeleted file mode 100644 index b003a30..0000000 --- a/docs/html/tools/sdk/images/3.0/homescreen_cust_port.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/homescreen_cust_port_full.png b/docs/html/tools/sdk/images/3.0/homescreen_cust_port_full.png Binary files differdeleted file mode 100644 index 9c64edd..0000000 --- a/docs/html/tools/sdk/images/3.0/homescreen_cust_port_full.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/mail_drag.png b/docs/html/tools/sdk/images/3.0/mail_drag.png Binary files differdeleted file mode 100644 index 1f09a7a..0000000 --- a/docs/html/tools/sdk/images/3.0/mail_drag.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/mail_drag_full.png b/docs/html/tools/sdk/images/3.0/mail_drag_full.png Binary files differdeleted file mode 100644 index be4472f..0000000 --- a/docs/html/tools/sdk/images/3.0/mail_drag_full.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/tasks.png b/docs/html/tools/sdk/images/3.0/tasks.png Binary files differdeleted file mode 100644 index a4ba1ba..0000000 --- a/docs/html/tools/sdk/images/3.0/tasks.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/tasks_full.png b/docs/html/tools/sdk/images/3.0/tasks_full.png Binary files differdeleted file mode 100644 index d2a2241..0000000 --- a/docs/html/tools/sdk/images/3.0/tasks_full.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.0/widgets.png b/docs/html/tools/sdk/images/3.0/widgets.png Binary files differdeleted file mode 100644 index d847666..0000000 --- a/docs/html/tools/sdk/images/3.0/widgets.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.1/controls.png b/docs/html/tools/sdk/images/3.1/controls.png Binary files differdeleted file mode 100644 index e0ca1f8..0000000 --- a/docs/html/tools/sdk/images/3.1/controls.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.1/home.png b/docs/html/tools/sdk/images/3.1/home.png Binary files differdeleted file mode 100644 index ea0a75a..0000000 --- a/docs/html/tools/sdk/images/3.1/home.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.1/home_full.png b/docs/html/tools/sdk/images/3.1/home_full.png Binary files differdeleted file mode 100644 index 2b8e85e..0000000 --- a/docs/html/tools/sdk/images/3.1/home_full.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.1/resizeable.png b/docs/html/tools/sdk/images/3.1/resizeable.png Binary files differdeleted file mode 100644 index c9f5e8e..0000000 --- a/docs/html/tools/sdk/images/3.1/resizeable.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/3.1/tasks.png b/docs/html/tools/sdk/images/3.1/tasks.png Binary files differdeleted file mode 100644 index 89d69e5..0000000 --- a/docs/html/tools/sdk/images/3.1/tasks.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/allapps-lg.png b/docs/html/tools/sdk/images/4.0/allapps-lg.png Binary files differdeleted file mode 100644 index f5eba3c..0000000 --- a/docs/html/tools/sdk/images/4.0/allapps-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/allapps.png b/docs/html/tools/sdk/images/4.0/allapps.png Binary files differdeleted file mode 100644 index 317a49a..0000000 --- a/docs/html/tools/sdk/images/4.0/allapps.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/bbench.png b/docs/html/tools/sdk/images/4.0/bbench.png Binary files differdeleted file mode 100644 index f113092..0000000 --- a/docs/html/tools/sdk/images/4.0/bbench.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/beam-lg.png b/docs/html/tools/sdk/images/4.0/beam-lg.png Binary files differdeleted file mode 100644 index 608fc94..0000000 --- a/docs/html/tools/sdk/images/4.0/beam-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/beam-maps-lg.png b/docs/html/tools/sdk/images/4.0/beam-maps-lg.png Binary files differdeleted file mode 100644 index 96ac235..0000000 --- a/docs/html/tools/sdk/images/4.0/beam-maps-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/beam-maps.png b/docs/html/tools/sdk/images/4.0/beam-maps.png Binary files differdeleted file mode 100644 index 63b6756..0000000 --- a/docs/html/tools/sdk/images/4.0/beam-maps.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/beam.png b/docs/html/tools/sdk/images/4.0/beam.png Binary files differdeleted file mode 100644 index 0eb7d26..0000000 --- a/docs/html/tools/sdk/images/4.0/beam.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/browser-lg.png b/docs/html/tools/sdk/images/4.0/browser-lg.png Binary files differdeleted file mode 100644 index fe3fe81..0000000 --- a/docs/html/tools/sdk/images/4.0/browser-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/browser-tabs-lg.png b/docs/html/tools/sdk/images/4.0/browser-tabs-lg.png Binary files differdeleted file mode 100644 index 0ea8f10..0000000 --- a/docs/html/tools/sdk/images/4.0/browser-tabs-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/browser-tabs.png b/docs/html/tools/sdk/images/4.0/browser-tabs.png Binary files differdeleted file mode 100644 index 413b0c6..0000000 --- a/docs/html/tools/sdk/images/4.0/browser-tabs.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/browser.png b/docs/html/tools/sdk/images/4.0/browser.png Binary files differdeleted file mode 100644 index 4bc8179..0000000 --- a/docs/html/tools/sdk/images/4.0/browser.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/calendar-widget-lg.png b/docs/html/tools/sdk/images/4.0/calendar-widget-lg.png Binary files differdeleted file mode 100644 index 39fc986..0000000 --- a/docs/html/tools/sdk/images/4.0/calendar-widget-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/calendar-widget.png b/docs/html/tools/sdk/images/4.0/calendar-widget.png Binary files differdeleted file mode 100644 index 80a57f7..0000000 --- a/docs/html/tools/sdk/images/4.0/calendar-widget.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/camera-lg.png b/docs/html/tools/sdk/images/4.0/camera-lg.png Binary files differdeleted file mode 100644 index 7d96a4f..0000000 --- a/docs/html/tools/sdk/images/4.0/camera-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/camera.png b/docs/html/tools/sdk/images/4.0/camera.png Binary files differdeleted file mode 100644 index 7454549..0000000 --- a/docs/html/tools/sdk/images/4.0/camera.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/contact-call-lg.png b/docs/html/tools/sdk/images/4.0/contact-call-lg.png Binary files differdeleted file mode 100644 index 40b1f40..0000000 --- a/docs/html/tools/sdk/images/4.0/contact-call-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/contact-call.png b/docs/html/tools/sdk/images/4.0/contact-call.png Binary files differdeleted file mode 100644 index 5550b57..0000000 --- a/docs/html/tools/sdk/images/4.0/contact-call.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/contact-connect-lg.png b/docs/html/tools/sdk/images/4.0/contact-connect-lg.png Binary files differdeleted file mode 100644 index ad0d04c..0000000 --- a/docs/html/tools/sdk/images/4.0/contact-connect-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/contact-connect.png b/docs/html/tools/sdk/images/4.0/contact-connect.png Binary files differdeleted file mode 100644 index d958206..0000000 --- a/docs/html/tools/sdk/images/4.0/contact-connect.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/contact-email-lg.png b/docs/html/tools/sdk/images/4.0/contact-email-lg.png Binary files differdeleted file mode 100644 index db75a46..0000000 --- a/docs/html/tools/sdk/images/4.0/contact-email-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/contact-email.png b/docs/html/tools/sdk/images/4.0/contact-email.png Binary files differdeleted file mode 100644 index 9e5460d..0000000 --- a/docs/html/tools/sdk/images/4.0/contact-email.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/contact-faves-lg.png b/docs/html/tools/sdk/images/4.0/contact-faves-lg.png Binary files differdeleted file mode 100644 index 1ec3fd0..0000000 --- a/docs/html/tools/sdk/images/4.0/contact-faves-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/contact-faves.png b/docs/html/tools/sdk/images/4.0/contact-faves.png Binary files differdeleted file mode 100644 index 57e4ca6..0000000 --- a/docs/html/tools/sdk/images/4.0/contact-faves.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/face-unlock-lg.png b/docs/html/tools/sdk/images/4.0/face-unlock-lg.png Binary files differdeleted file mode 100644 index 3fd1695..0000000 --- a/docs/html/tools/sdk/images/4.0/face-unlock-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/face-unlock.png b/docs/html/tools/sdk/images/4.0/face-unlock.png Binary files differdeleted file mode 100644 index 00afb83..0000000 --- a/docs/html/tools/sdk/images/4.0/face-unlock.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/folders.xcf b/docs/html/tools/sdk/images/4.0/folders.xcf Binary files differdeleted file mode 100644 index 66cc02c..0000000 --- a/docs/html/tools/sdk/images/4.0/folders.xcf +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/gallery-edit-lg.png b/docs/html/tools/sdk/images/4.0/gallery-edit-lg.png Binary files differdeleted file mode 100644 index 3d6688f..0000000 --- a/docs/html/tools/sdk/images/4.0/gallery-edit-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/gallery-edit.png b/docs/html/tools/sdk/images/4.0/gallery-edit.png Binary files differdeleted file mode 100644 index 69744ec..0000000 --- a/docs/html/tools/sdk/images/4.0/gallery-edit.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/gallery-share-lg.png b/docs/html/tools/sdk/images/4.0/gallery-share-lg.png Binary files differdeleted file mode 100644 index 749f51e..0000000 --- a/docs/html/tools/sdk/images/4.0/gallery-share-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/gallery-share.png b/docs/html/tools/sdk/images/4.0/gallery-share.png Binary files differdeleted file mode 100644 index 443a70c..0000000 --- a/docs/html/tools/sdk/images/4.0/gallery-share.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/gallery-widget.png b/docs/html/tools/sdk/images/4.0/gallery-widget.png Binary files differdeleted file mode 100644 index e72fd0d..0000000 --- a/docs/html/tools/sdk/images/4.0/gallery-widget.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/home-lg.png b/docs/html/tools/sdk/images/4.0/home-lg.png Binary files differdeleted file mode 100644 index 5b9021d..0000000 --- a/docs/html/tools/sdk/images/4.0/home-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/home.png b/docs/html/tools/sdk/images/4.0/home.png Binary files differdeleted file mode 100644 index cd24732..0000000 --- a/docs/html/tools/sdk/images/4.0/home.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/live-effects.png b/docs/html/tools/sdk/images/4.0/live-effects.png Binary files differdeleted file mode 100644 index 11a0122..0000000 --- a/docs/html/tools/sdk/images/4.0/live-effects.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/lock-camera-lg.png b/docs/html/tools/sdk/images/4.0/lock-camera-lg.png Binary files differdeleted file mode 100644 index c82cec6..0000000 --- a/docs/html/tools/sdk/images/4.0/lock-camera-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/lock-camera.png b/docs/html/tools/sdk/images/4.0/lock-camera.png Binary files differdeleted file mode 100644 index d3cc153..0000000 --- a/docs/html/tools/sdk/images/4.0/lock-camera.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/lock-lg.png b/docs/html/tools/sdk/images/4.0/lock-lg.png Binary files differdeleted file mode 100644 index b859e11..0000000 --- a/docs/html/tools/sdk/images/4.0/lock-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/lock.png b/docs/html/tools/sdk/images/4.0/lock.png Binary files differdeleted file mode 100644 index d168826..0000000 --- a/docs/html/tools/sdk/images/4.0/lock.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/quick-responses-lg.png b/docs/html/tools/sdk/images/4.0/quick-responses-lg.png Binary files differdeleted file mode 100644 index 39cea9a..0000000 --- a/docs/html/tools/sdk/images/4.0/quick-responses-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/quick-responses.png b/docs/html/tools/sdk/images/4.0/quick-responses.png Binary files differdeleted file mode 100644 index d43f348..0000000 --- a/docs/html/tools/sdk/images/4.0/quick-responses.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/screenshot-lg.png b/docs/html/tools/sdk/images/4.0/screenshot-lg.png Binary files differdeleted file mode 100644 index 30ac339..0000000 --- a/docs/html/tools/sdk/images/4.0/screenshot-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/screenshot.png b/docs/html/tools/sdk/images/4.0/screenshot.png Binary files differdeleted file mode 100644 index b23c913..0000000 --- a/docs/html/tools/sdk/images/4.0/screenshot.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/tasks-lg.png b/docs/html/tools/sdk/images/4.0/tasks-lg.png Binary files differdeleted file mode 100644 index 58b5c5d..0000000 --- a/docs/html/tools/sdk/images/4.0/tasks-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/tasks.png b/docs/html/tools/sdk/images/4.0/tasks.png Binary files differdeleted file mode 100644 index 34a9d4a..0000000 --- a/docs/html/tools/sdk/images/4.0/tasks.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/text-replace-lg.png b/docs/html/tools/sdk/images/4.0/text-replace-lg.png Binary files differdeleted file mode 100644 index 047d802..0000000 --- a/docs/html/tools/sdk/images/4.0/text-replace-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/text-replace.png b/docs/html/tools/sdk/images/4.0/text-replace.png Binary files differdeleted file mode 100644 index d2bda3e..0000000 --- a/docs/html/tools/sdk/images/4.0/text-replace.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/tts-lg.png b/docs/html/tools/sdk/images/4.0/tts-lg.png Binary files differdeleted file mode 100644 index 2f49051..0000000 --- a/docs/html/tools/sdk/images/4.0/tts-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/tts.png b/docs/html/tools/sdk/images/4.0/tts.png Binary files differdeleted file mode 100644 index 3eae634..0000000 --- a/docs/html/tools/sdk/images/4.0/tts.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/usage-all-lg.png b/docs/html/tools/sdk/images/4.0/usage-all-lg.png Binary files differdeleted file mode 100644 index fd7eeba..0000000 --- a/docs/html/tools/sdk/images/4.0/usage-all-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/usage-all.png b/docs/html/tools/sdk/images/4.0/usage-all.png Binary files differdeleted file mode 100644 index 048db83..0000000 --- a/docs/html/tools/sdk/images/4.0/usage-all.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/usage-maps-lg.png b/docs/html/tools/sdk/images/4.0/usage-maps-lg.png Binary files differdeleted file mode 100644 index b144370..0000000 --- a/docs/html/tools/sdk/images/4.0/usage-maps-lg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/4.0/usage-maps.png b/docs/html/tools/sdk/images/4.0/usage-maps.png Binary files differdeleted file mode 100644 index a6dcd21..0000000 --- a/docs/html/tools/sdk/images/4.0/usage-maps.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/battery.png b/docs/html/tools/sdk/images/battery.png Binary files differdeleted file mode 100644 index 10fd16b..0000000 --- a/docs/html/tools/sdk/images/battery.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/camera.png b/docs/html/tools/sdk/images/camera.png Binary files differdeleted file mode 100644 index 6078388..0000000 --- a/docs/html/tools/sdk/images/camera.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/donut_small_bg.png b/docs/html/tools/sdk/images/donut_small_bg.png Binary files differdeleted file mode 100644 index f514b50..0000000 --- a/docs/html/tools/sdk/images/donut_small_bg.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/market.png b/docs/html/tools/sdk/images/market.png Binary files differdeleted file mode 100644 index 8d11134..0000000 --- a/docs/html/tools/sdk/images/market.png +++ /dev/null diff --git a/docs/html/tools/sdk/images/search.png b/docs/html/tools/sdk/images/search.png Binary files differdeleted file mode 100644 index 10ab910..0000000 --- a/docs/html/tools/sdk/images/search.png +++ /dev/null diff --git a/docs/html/tools/sdk/ndk/index.jd b/docs/html/tools/sdk/ndk/index.jd index 7c8ca71..cb4954b 100644 --- a/docs/html/tools/sdk/ndk/index.jd +++ b/docs/html/tools/sdk/ndk/index.jd @@ -1,22 +1,195 @@ ndk=true +page.template=sdk -ndk.win_download=android-ndk-r8c-windows.zip -ndk.win_bytes=233787657 -ndk.win_checksum=3ff1570fa4ea865b7702507ea43dbae4 +ndk.win_download=android-ndk-r8d-windows.zip +ndk.win_bytes=327014028 +ndk.win_checksum=d78ec3d4ec15ad3b18b9f488a5763c23 -ndk.mac_download=android-ndk-r8c-darwin-x86.tar.bz2 -ndk.mac_bytes=214270840 -ndk.mac_checksum=74a23e9e058512121835e0d6932e72d5 +ndk.mac_download=android-ndk-r8d-darwin-x86.tar.bz2 +ndk.mac_bytes=308328942 +ndk.mac_checksum=5cd9ef9fb7e03943ee8c9e147e42e571 -ndk.linux_download=android-ndk-r8c-linux-x86.tar.bz2 -ndk.linux_bytes=179945337 -ndk.linux_checksum=b0851346ff90c9266bc050016a228319 +ndk.linux_download=android-ndk-r8d-linux-x86.tar.bz2 +ndk.linux_bytes=254644383 +ndk.linux_checksum=e1fa0379a3feb59f2f0865f1a90bd382 page.title=Android NDK - @jd:body + + +<div id="tos" style="display:none;width:760px;height:0;margin:0 auto"> + +<div class="ndk" style=" +z-index: 99; +width: 720px; +position: absolute; +margin: -70px 0; +padding: 14px; +background: white; +border: 1px solid #999; +box-shadow: -10px 10px 50px #888; +-moz-box-shadow: -10px 10px 50px #888; +-webkit-box-shadow: -10px 10px 50px #888;"> +<p>Before installing the Android NDK, you must agree to the following terms and conditions.</p> +<div class="sdk-terms" style="width:auto" onfocus="this.blur()"> +<h2 class="norule">Terms and Conditions</h2> +This is the Android Software Development Kit License Agreement + +<h3>1. Introduction</h3> +1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK. + +1.2 “Android” means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time. + +1.3 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States. + + +<h3>2. Accepting this License Agreement</h3> +2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement. + +2.2 By clicking to accept, you hereby agree to the terms of this License Agreement. + +2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK. + +2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity. + + +<h3>3. SDK License from Google</h3> +3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform. + +3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. + +3.3 You may not use the SDK for any purpose not expressly permitted by this License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK; or (b) load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK. + +3.4 You agree that you will not take any actions that may cause or result in the fragmentation of Android, including but not limited to distributing, participating in the creation of, or promoting in any way a software development kit derived from the SDK. + +3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement. + +3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you. + +3.7 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. + +3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK. + + +<h3>4. Use of the SDK by You</h3> +4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications. + +4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). + +4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so. + +4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier. + +4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. + +4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach. + + +<h3>5. Your Developer Credentials</h3> +5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials. + + +<h3>6. Privacy and Information</h3> +6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected. + +6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy. + + +<h3>7. Third Party Applications</h3> +7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. + +7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. + +7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties. + + +<h3>8. Using Android APIs</h3> +8.1 Google Data APIs + +8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. + +8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. + + +<h3>9. Terminating this License Agreement</h3> +9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below. + +9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials. + +9.3 Google may at any time, terminate this License Agreement with you if: +(A) you have breached any provision of this License Agreement; or +(B) Google is required to do so by law; or +(C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or +(D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable. + +9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely. + + +<h3>10. DISCLAIMER OF WARRANTIES</h3> +10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. + +10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. + +10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + + +<h3>11. LIMITATION OF LIABILITY</h3> +11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. + + +<h3>12. Indemnification</h3> +12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement. + + +<h3>13. Changes to the License Agreement</h3> +13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available. + + +<h3>14. General Legal Terms</h3> +14.1 This License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK. + +14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. + +14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable. + +14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to this License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to this License Agreement. + +14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. + +14.6 The rights granted in this License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under this License Agreement without the prior written approval of the other party. + +14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. + + +<em>November 13, 2012</em> +</div> + + + +<div id="sdk-terms-form"> +<p> +<input id="agree" type="checkbox" name="agree" value="1" onclick="onAgreeChecked()" /> +<label id="agreeLabel" for="agree">I have read and agree with the above terms and conditions</label> +</p> +<p><a href="" class="button disabled ndk" id="downloadForRealz" onclick="return onDownloadNdkForRealz(this);"></a></p> +</div> + + + +</div> +</div> + + + + + + + + + + <div id="qv-wrapper"> <div id="qv"> <h2>In this document</h2> @@ -77,6 +250,170 @@ the NDK, 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 NDK, Revision 8d</a> <em>(December 2012)</em> + </p> + + <div class="toggle-content-toggleme"> + <dl> + <dt>Important changes:</dt> + <dd> + <ul> + <li>Added the GNU Compiler Collection (GCC) 4.7 compiler to the NDK. The GCC 4.6 compiler + is still the default, so you must to explicitly enable the new version as follows: + <ul> + <li>For {@code ndk-build}, export the {@code NDK_TOOLCHAIN_VERSION=4.7} variable + <em>or</em> add it to {@code Application.mk}.</li> + <li>For standalone builds, add the {@code --toolchain=} option to + {@code make-standalone-toolchain.sh}, for example: + <pre>--toolchain=arm-linux-androideabi-4.7</pre></li> + </ul> + <p class="note"> + <strong>Note:</strong> This feature is experimental. Please try it and + <a href="http://code.google.com/p/android/issues/list">report any issues</a>.</p> + </li> + <li>Added {@code stlport} exception support via gabi++. Note that the new gabi++ + depends on {@code dlopen} and related code, meaning that: + <ul> + <li>You can no longer build a <em>static</em> executable using the {@code -static} + option or include {@code libstlport_static.a} using + {@code APP_STL := stlport_static}. (You can still use the {@code -static} option + with a standalone toolchain.) Compiling a <em>dynamic</em> executable using + {@code include $(BUILD_EXECUTABLE)} continues to work because the compiler + automatically adds the {@code -ldl} option.</li> + <li>If your project links using {@code -nostdlib} and {-Wl,--no-undefined}, you + must manually include the {@code -ldl} option.</li> + </ul> + For more information, see {@code CPLUSPLUS-SUPPORT.html}. + + <p class="note"> + <strong>Note:</strong> This feature is experimental and works better with the GCC + 4.6/4.7 compilers than with GCC 4.4.3 or Clang 3.1. Please try it and + <a href="http://code.google.com/p/android/issues/list">report any issues</a>.</p> + </li> + <li>Added a {@code -mstack-protector-guard=} option for x86 to choose between a + <em>global</em> default path which is compatible with older Android C library (bionic) + and a new <em>tls</em> path (%gs:20) for {@code -fstack-protector}, + {@code -fstack-protector-all} and {@code -fstack-protector-strong} using the GCC 4.6 + and higher compilers. + + <p class="note"> + <strong>Note:</strong> The {@code -mstack-protector-guard} setting itself does not + enable any {@code -fstack-protector*} options.</p> + </li> + <li>Added {@code android_setCpu()} function to + {@code sources/android/cpufeatures/cpu-features.c} for use when auto-detection via + {@code /proc} is not possible in Android 4.1 and higher. + (<a href="http://code.google.com/p/chromium/issues/detail?id=164154">Chromium Issue + 164154</a>)</li> + </ul> + </dd> + + <dt>Important bug fixes:</dt> + <dd> + <ul> + <li>Fixed unnecessary rebuild of object files when using the {@code ndk-build} script. + (<a href="http://code.google.com/p/android/issues/detail?id=39810">Issue 39810</a>)</li> + <li>Fixed a linker failure with the NDK 8c release for Mac OS X 10.6.x that produced the + following error: + <pre> +dyld: lazy symbol binding failed: Symbol not found: _memmem +Referenced from: ...../arm-linux-androideabi/bin/ld +Expected in: /usr/lib/libSystem.B.dylib</pre> + This problem was caused by building on Mac OS X 10.7, which produced binaries that were + not compatible with Mac OS 10.6.x and the NDK. + </li> + <li>Removed the {@code -x c++} options from the Clang++ standalone build script. + (<a href="http://code.google.com/p/android/issues/detail?id=39089">Issue 39089</a>)</li> + <li>Fixed issues using the {@code NDK_TOOLCHAIN_VERSION=clang3.1} option in Cygwin. + (<a href="http://code.google.com/p/android/issues/detail?id=39585">Issue 39585</a>)</li> + <li>Fixed the {@code make-standalone-toolchain.sh} script to allow generation of a + standalone toolchain using the Cygwin or MinGW environments. The resulting toolchain + can be used in Cygwin, MingGW or CMD.exe environments. + (<a href="http://code.google.com/p/android/issues/detail?id=39915">Issue 39915</a>, + <a href="http://code.google.com/p/android/issues/detail?id=39585">Issue 39585</a>)</li> + <li>Added missing {@code SL_IID_ANDROIDBUFFERQUEUESOURCE} option in android-14 builds for + ARM and X86. + (<a href="http://code.google.com/p/android/issues/detail?id=40625">Issue 40625</a>)</li> + <li>Fixed x86 CPU detection for the {@code ANDROID_CPU_X86_FEATURE_MOVBE} feature. + (<a href="http://code.google.com/p/android/issues/detail?id=39317">Issue 39317</a>)</li> + <li>Fixed an issue preventing the Standard Template Library (STL) from using C++ + sources that do not have a {@code .cpp} file extension.</li> + <li>Fixed GCC 4.6 ARM internal compiler error <em>at reload1.c:1061</em>. + (<a href="http://code.google.com/p/android/issues/detail?id=20862">Issue 20862</a>)</li> + <li>Fixed GCC 4.4.3 ARM internal compiler error <em>at emit-rtl.c:1954</em>. + (<a href="http://code.google.com/p/android/issues/detail?id=22336">Issue 22336</a>)</li> + <li>Fixed GCC 4.4.3 ARM internal compiler error <em>at postreload.c:396</em>. + (<a href="http://code.google.com/p/android/issues/detail?id=22345">Issue 22345</a>)</li> + <li>Fixed problem with GCC 4.6/4.7 skipping lambda functions. + (<a href="http://code.google.com/p/android/issues/detail?id=35933">Issue 35933</a>)</li> + </ul> + </dd> + + <dt>Other bug fixes:</dt> + <dd> + <ul> + <li>NDK header file fixes: + <ul> + <li>Fixed {@code __WINT_TYPE__} and {@code wint_t} to be the same type.</li> + <li>Corrected typo in {@code android/bitmap.h}. + (<a href="http://code.google.com/p/android/issues/detail?id=15134">Issue 15134</a>) + </li> + <li>Corrected typo in {@code errno.h}.</li> + <li>Added check for the presence of {@code __STDC_VERSION__} in {@code sys/cdefs.h}. + (<a href="http://code.google.com/p/android/issues/detail?id=14627">Issue 14627</a>) + </li> + <li>Reorganized headers in {@code byteswap.h} and {@code dirent.h}.</li> + <li>Fixed {@code limits.h} to include {@code page.h} which provides {@code PAGE_SIZE} + settings. + (<a href="http://code.google.com/p/android/issues/detail?id=39983">Issue 39983</a>) + </li> + <li>Fixed return type of {@code glGetAttribLocation()} and + {@code glGetUniformLocation()} from {@code int} to {@code GLint}.</li> + <li>Fixed {@code __BYTE_ORDER} constant for x86 builds. + (<a href="http://code.google.com/p/android/issues/detail?id=39824">Issue 39824</a>) + </li> + </ul> + </li> + <li>Fixed {@code ndk-build} script to not overwrite {@code -Os} with {@code -O2} for ARM + builds.</li> + <li>Fixed build scripts to allow overwriting of {@code HOST_AWK}, {@code HOST_SED}, and + {@code HOST_MAKE} settings.</li> + <li>Fixed issue for {@code ld.gold} on {@code fsck_msdos} builds linking objects built by + the Intel C/C++ compiler (ICC).</li> + <li>Fixed ARM EHABI support in Clang to conform to specifications.</li> + <li>Fixed GNU Debugger (GDB) to shorten the time spent on walking the target's link map + during {@code solib} events. + (<a href="http://code.google.com/p/android/issues/detail?id=38402">Issue 38402</a>)</li> + <li>Fixed missing {@code libgcc.a} file when linking shared libraries.</li> + </ul> + </dd> + + <dt>Other changes:</dt> + <dd> + <ul> + <li>Backported 64-bit built-in atomic functions for ARM to GCC 4.6.</li> + <li>Added documentation for audio output latency, along with other documentation and + fixes.</li> + <li>Fixed debug builds with Clang so that non-void functions now raise a {@code SIGILL} + signal for paths without a return statement.</li> + <li>Updated {@code make-standalone-toolchain.sh} to accept the suffix {@code -clang3.1} + which is equivalent to adding {@code --llvm-version=3.1} to the GCC 4.6 toolchain.</li> + <li>Updated GCC and Clang bug report URL to: + <a href="http://source.android.com/source/report-bugs.html">http://source.android.com/source/report-bugs.html</a></li> + <li>Added ARM ELF support to {@code llvm-objdump}.</li> + <li>Suppressed <em>treating c input as c++</em> warning for Clang builds.</li> + <li>Updated build so that only the 32-bit version of {@code libiberty.a} is built and + placed in {@code lib32/}.</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="">Android NDK, Revision 8c</a> <em>(November 2012)</em> </p> diff --git a/docs/html/tools/sdk/preview/index.jd b/docs/html/tools/sdk/preview/index.jd index ed8f7e0..d96df93 100644 --- a/docs/html/tools/sdk/preview/index.jd +++ b/docs/html/tools/sdk/preview/index.jd @@ -1,2 +1,3 @@ sdk.redirect=true +page.template=sdk @jd:body diff --git a/docs/html/tools/sdk/tools-notes.jd b/docs/html/tools/sdk/tools-notes.jd index c5388d0..a5b7eee 100644 --- a/docs/html/tools/sdk/tools-notes.jd +++ b/docs/html/tools/sdk/tools-notes.jd @@ -28,6 +28,144 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues <div class="toggle-content opened"> <p><a href="#" onclick="return toggleContent(this)"> <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" + alt=""/>SDK Tools, Revision 21.1.0</a> <em>(February 2013)</em> + </p> + + <div class="toggle-content-toggleme"> + + <dl> + <dt>Dependencies:</dt> + <dd> + <ul> + <li>Android SDK Platform-tools revision 16 or later.</li> + <li>If you are developing in Eclipse with ADT, note that the SDK Tools r21.1.0 is + designed for use with ADT 21.1.0 and later. If you haven't already, update your + <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 21.1.0.</li> + <li>If you are developing outside Eclipse, you must have + <a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later.</li> + </ul> + </dd> + + <dt>General Notes:</dt> + <dd> + <ul> + <li>Improved error reporting in {@code dx} when dex merging fails in the build + system.</li> + <li>Added more than 15 new Lint checks, including checks for overriding older APIs, XML + resource problems, graphic asset issues and manifest tags.</li> + <li>Added new aapt feature to compile resources.</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=""/>SDK Tools, Revision 21.0.1</a> <em>(December 2012)</em> + </p> + + <div class="toggle-content-toggleme"> + + <dl> + <dt>Dependencies:</dt> + <dd> + <ul> + <li>Android SDK Platform-tools revision 16 or later.</li> + <li>If you are developing in Eclipse with ADT, note that the SDK Tools r21.0.1 is + designed for use with ADT 21.0.1 and later. If you haven't already, update your + <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 21.0.1.</li> + <li>If you are developing outside Eclipse, you must have + <a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later.</li> + </ul> + </dd> + + <dt>General Notes:</dt> + <dd> + <ul> + <li>Build + <ul> + <li>Updated build to detect and handle package name conflicts between an application and + the libraries it depends on. Libraries cannot share package names unless all of them + share the same package name. + (<a href="http://code.google.com/p/android/issues/detail?id=40152">Issue 40152</a>, + <a href="http://code.google.com/p/android/issues/detail?id=40273">Issue 40273</a>) + </li> + <li>Added a flag to disable dex merging to deal with cases where merging could generate + a broken dex file. If this happens to your project, add the following setting to your + {@code project.properties} file: {@code dex.disable.merger=true} This setting + causes the build system to revert to the older, slower dex processing that does not + pre-dex libraries.</li> + </ul> + </li> + + <li>Renderscript + <ul> + <li>Added support for + <a href="{@docRoot}guide/topics/renderscript/compute.html#filterscript">Filterscript</a> + compilation.</li> + <li>Added new project setting to control the Renderscript compilation target separately + from an Android project. Adding the following line to a {@code project.properties} + file causes Renderscript code to be compiled for Android API Level 17, while the + containing application can target a different (lower) API level: + <pre>renderscript.target = 17</pre> + Previously, the Renderscript compilation target was tied to the + {@code android:minSdkVersion} setting in the manifest. + (<a href="http://code.google.com/p/android/issues/detail?id=40487">Issue 40487</a>) + </li> + </ul> + </li> + + </ul> + </dd> + + + <dt>Bug fixes:</dt> + <dd> + <ul> + <li>Lint + <ul> + <li>Corrected check for {@code 0px} values in style XML elements. + (<a href="http://code.google.com/p/android/issues/detail?id=39601">Issue 39601</a>) + </li> + <li>Fixed incorrect flagging of formatting strings. + (<a href="http://code.google.com/p/android/issues/detail?id=39758">Issue 39758</a>) + </li> + <li>Fixed problem where {@code tools:ignore} directive in the manifest file was ignored + by the Lint tool. + (<a href="http://code.google.com/p/android/issues/detail?id=40136">Issue 40136</a>) + </li> + <li>Fixed problem with flagging a wakelock release inside a conditional. + (<a href="http://code.google.com/p/android/issues/detail?id=40424">Issue 40424</a>) + </li> + <li>Fixed incorrect reporting of missing {@code layout_width} and {@code layout_height} + XML fields. + (<a href="http://code.google.com/p/android/issues/detail?id=38958">Issue 38958</a>) + </li> + <li>Fixed handling of custom namespace attributes.</li> + <li>Added fixes for filtering out library project warnings.</li> + <li>Removed warnings about missing classes before a build.</li> + </ul> + </li> + + <li>Fixed problem with UI Automator Viewer execution script where Android tools directory + is not set.</li> + <li>Fixed problem with the SDK Manager so that it auto-selects the most recently released + platform on startup.</li> + <li>Fixed Java finding script to look for the currently supported version of Java (1.6 or + higher).</li> + <li>Fixed the SDK Manager launcher in the ADT bundle so that it can properly launch the + SDK Manager program when it is placed at the root of the bundle.</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=""/>SDK Tools, Revision 21</a> <em>(November 2012)</em> </p> @@ -37,14 +175,15 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues <dt>Dependencies:</dt> <dd> <ul> - <li>Android SDK Platform-tools revision 15 or later.</li> + <li>Android SDK Platform-tools revision 16 or later.</li> <li>If you are developing in Eclipse with ADT, note that the SDK Tools r21 is designed for use with ADT 21.0.0 and later. If you haven't already, update your <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT Plugin</a> to 21.0.0.</li> <li>If you are developing outside Eclipse, you must have <a href="http://ant.apache.org/">Apache Ant</a> 1.8 or later.</li> - </ul> + </ul> </dd> + <dt>General Notes:</dt> <dd> <ul> @@ -87,10 +226,12 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues standard size and Nexus virtual devices.</li> <li>Improved emulators so that they launch with a skin that is dynamically generated and reflects the actual hardware configured in the AVD Manager.</li> + <li>Improved support for developing Android apps on MIPS-based devices with new MIPS + System Images for Android Virtual Devices.</li> </ul> </li> <li>Added {@code jobb} tool for creating and encrypting - <a href="{@docRoot}guide/google/play/expansion-files.html">APK Expansion Files</a>. + <a href="{@docRoot}google/play/expansion-files.html">APK Expansion Files</a>. (<a href="{@docRoot}tools/help/jobb.html">more info</a>) <li>Improved the Android JUnit test runner to allow a test to be run on all connected devices simultaneously.</li> @@ -825,7 +966,7 @@ documentation. </li> </ul> </dd> </dl> - </div> +</div> </div> <div class="toggle-content closed"> @@ -859,7 +1000,7 @@ decimal point.</li> </ul> </dd> </dl> - </div> +</div> </div> <div class="toggle-content closed"> @@ -890,7 +1031,7 @@ href="{@docRoot}tools/projects/index.html#LibraryProjects">Creating and Managing provides the equivalent library project support.</p> </dd> </dl> - </div> +</div> </div> <div class="toggle-content closed"> @@ -939,7 +1080,7 @@ officially supported. </li> </ul> </dd> </dl> - </div> +</div> </div> <div class="toggle-content closed"> @@ -989,7 +1130,7 @@ skin name specified.</li> </ul> </dd> </dl> - </div> +</div> </div> <div class="toggle-content closed"> @@ -1053,6 +1194,6 @@ solutions for the issues it finds. For usage, see <a href="/tools/help/layoutopt.html">layoutopt</a>.</p> </dd> </dl> - </div> +</div> </div> diff --git a/docs/html/tools/testing/testing_ui.jd b/docs/html/tools/testing/testing_ui.jd new file mode 100644 index 0000000..701415e --- /dev/null +++ b/docs/html/tools/testing/testing_ui.jd @@ -0,0 +1,356 @@ +page.title=UI Testing +parent.title=Testing +parent.link=index.html +@jd:body + +<div id="qv-wrapper"> + <div id="qv"> + <h2>In this document</h2> + <ol> + <li><a href="#overview">Overview</a></li> + <ul> + <li><a href="#workflow">Workflow</a></li> + </ul> + <li><a href="#uianalysis">Analyzing Your UI</a></li> + <li><a href="#prepare">Preparing to Test</a> + <ul> + <LI><a href="#loading">Load the App</a></LI> + <LI><a href="#identifyUI">Identify UI Components</a></LI> + <LI><a href="#accessibility">Ensure Accessibility</a></LI> + <LI><a href="#configure">Configure Development Environment</a></LI> + </ul> + </li> + <li><a href="#creating">Creating Tests</a> + <ul> + <LI><a href="#classes">uiautomator API</a></LI> + <li><a href="#sample">Sample Test Case</a> + </ul> + </li> + <li><a href="#builddeploy">Building and Deploying Tests</a></li> + <li><a href="#running">Running Tests</a></li> + <li><a href="#bestpractices">Best Practices</a></li> + </ol> + <h2>Key classes</h2> + <ol> + <li><a href="{@docRoot}tools/help/uiautomator/IAutomationSupport.html">IAutomationSupport</a></li> + <li><a href="{@docRoot}tools/help/uiautomator/UiAutomatorTestCase.html">UiAutomatorTestCase</a></li> + <li><a href="{@docRoot}tools/help/uiautomator/UiCollection.html">UiCollection</a></li> + <li><a href="{@docRoot}tools/help/uiautomator/UiDevice.html">UiDevice</a></li> + <li><a href="{@docRoot}tools/help/uiautomator/UiObject.html">UiObject</a></li> + <li><a href="{@docRoot}tools/help/uiautomator/UiScrollable.html">UiScrollable</a></li> + <li><a href="{@docRoot}tools/help/uiautomator/UiSelector.html">UiSelector</a></li> + </ol> + <h2>See Also</h2> + <ol> + <li> + <a href="{@docRoot}tools/help/uiautomator/index.html">uiautomator (reference)</a> + </li> + </ol> + </div> +</div> + +<p> +In addition to unit testing the individual components that make up your Android application (such as activities, services, and content providers), it is also important that you test the behavior of your application’s user interface (UI) when it is running on a device. UI testing ensures that your application returns the correct UI output in response to a sequence of user actions on a device, such as entering keyboard input or pressing toolbars, menus, dialogs, images, and other UI controls. +</p> +<p> +Functional or black-box UI testing does not require testers to know the internal implementation details of the app, only its expected output when a user performs a specific action or enters a specific input. This approach allows for better separation of development and testing roles in your organization. +</p> +<p>One common approach to UI testing is to run tests manually and verify that the app is behaving as expected. However, this approach can be time-consuming, tedious, and error-prone. A more efficient and reliable approach is to automate the UI testing with a software testing framework. Automated testing involves creating programs to perform testing tasks (test cases) to cover specific usage scenarios, and then using the testing framework to run the test cases automatically and in a repeatable manner.</p> + +<h2 id="overview">Overview</h2> +<p>The Android SDK provides the following tools to support automated, functional UI testing on your application: +<ul> +<LI>{@code uiautomatorviewer} - A GUI tool to scan and analyze the UI components of an Android application.</LI> +<LI>{@code uiautomator} - A Java library containing APIs to create customized functional UI tests, and an execution engine to automate and run the tests.</LI> +</ul></p> + +<p>To use these tools, you must have the following versions of the Android development tools installed: +<ul> +<LI>Android SDK Tools, Revision 21 or higher</LI> +<LI>Android SDK Platform, API 16 or higher</LI> +</ul> +</p> + +<h3 id="workflow">Workflow for the the uiautomator testing framework</h3> +<p>Here's a short overview of the steps required to automate UI testing: +<ol> +<LI>Prepare to test by installing the app on a test device, analyzing the app’s UI components, and ensuring that your application is accessible by the test automation framework.</LI> +<li>Create automated tests to simulate specific user interactions on your application.</li> +<li>Compile your test cases into a JAR file and install it on your test device along with your app.</li> +<li>Run the tests and view the test results.</li> +<li>Correct any bugs or defects discovered in testing.</li> +</ol> +</p> + +<h2 id="uianalysis">Analyzing Your Application's UI</h2> +<p>Before you start writing your test cases, it's helpful to familiarize yourself with the UI components (including the views and controls) of the targeted application. You can use the {@code uiautomatorviewer} tool to take a snapshot of the foreground UI screen on any Android device that is connected to your development machine. The {@code uiautomatorviewer} tool provides a convenient visual interface to inspect the layout hierarchy and view the properties of the individual UI components that are displayed on the test device. Using this information, you can later create {@code uiautomator} tests with selector objects that target specific UI components to test.</p> + +<a href="{@docRoot}images/testing/UIAutomatorViewer.png"> + <img src="{@docRoot}images/testing/UIAutomatorViewer.png" + alt="User interface of uiautomatorviewer tool" height="327px" id="figure1"/> +</a> +<p class="img-caption"> + <strong>Figure 1.</strong> The {@code uiautomatorviewer} showing the captured interface of a test deviice. +</p> + +<p>To analyze the UI components of the application that you want to test:</p> +<ol> +<li>Connect your Android device to your development machine.</li> +<li>Open a terminal window and navigate to {@code <android-sdk>/tools/}.</li> +<LI>Run the tool with this command:<pre>$ uiautomatorviewer</pre></LI> +<li><p>To capture a screen for analysis, click the <strong>Device Screenshot</strong> button in the GUI of the {@code uiautomatorviewer} tool.</p> +<p class="note"><strong>Note: </strong>If you have more than one device connected, specify the device for screen capture by setting the {@code ANDROID_SERIAL} environment variable: + <ol type="a"> + <li>Find the serial numbers for your connected devices by running this command:<pre>$ adb devices</pre> </li> + <li>Set the {@code ANDROID_SERIAL} environment variable to select the device to test: + <ul> + <li>In Windows: <pre>set ANDROID_SERIAL=<device serial number></pre></li> + <li>In UNIX: <pre>export ANDROID_SERIAL=<device serial number></pre></li> + </ul> + </li> + </ol> +If you are connected to only a single device, you do not need to set the ANDROID_SERIAL environment variable.</p> +</li> +<li>View the UI properties for your application: + <ul> + <LI>Hover over the snapshot in the left-hand panel to see the UI components identified by the {@code uiautomatorviewer} tool. You can view the component’s properties listed in the lower right-hand panel, and the layout hierarchy in the upper right-hand panel.</LI> + <li>Optionally, click on the <strong>Toggle NAF Nodes</strong> button to see UI components that are not accessible to the {@code uiautomator} testing framework. Only limited information may be available for these components.</li> + </ul> +</li> +</ol> + +<h2 id="prepare">Preparing to Test</h2> +<p>Before using the {@code uiautomator} testing framework, complete these pre-flight tasks: +</p> +<h3 id="loading">Load the application to a device</h3> +<p>If you are reading this document, chances are that the Android application that you want to test has not been published yet. If you have a copy of the APK file, you can install the APK onto a test device by using the {@code adb} tool. To learn how to install an APK file using the {@code adb} tool, see the <a href="{@docRoot}tools/help/adb.html#move">{@code adb}</a> documentation. </p> + +<h3 id="identifyUI">Identify the application’s UI components</h3> +<p>Before writing your {@code uiautomator} tests, first identify the UI components in the application that you want to test. Typically, good candidates for testing are UI components that are visible and that users can interact with. The UI components should also have visible text labels, <a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">{@code android:contentDescription}</a> values, or both. + +<p>You can inspect the visible screen objects in an application conveniently by using the {@code uiautomatorviewer} tool. For more information about how to analyze an application screen with this tool, see the section <a href="#uianalaysis">Analyzing Your Application’s UI</a>. For more information about the common types of UI components provided by Android, see <a href="{@docRoot}guide/topics/ui/index.html">User Interface</a>.</p> + +<h3 id="accessibility">Ensure that the application is accessible</h3> +<p>This step is required because the {@code uiautomator} tool depends on the accessibility features of the Android framework to execute your functional UI tests. You should include these minimum optimizations to support the {@code uiautomator} tool: +<ul> +<LI>Use the <a href="{@docRoot}reference/android/view/View.html#attr_android:contentDescription">{@code android:contentDescription}</a> attribute to label the {@link android.widget.ImageButton}, {@link android.widget.ImageView}, {@link android.widget.CheckBox} and other user interface controls.</LI> +<li>Provide an <a href="{@docRoot}reference/android/widget/TextView.html#attr_android:hint">{@code android:hint}</a> attribute <em>instead</em> of a content description for {@link android.widget.EditText} fields</li> +<li>Associate an <a href="{@docRoot}reference/android/widget/TextView.html#attr_android:hint">{@code android:hint}</a> attribute with any graphical icons used by controls that provide feedback to the user (for example, status or state information).</li> +<li>Make sure that all the user interface elements are accessible with a directional controller, such as a trackball or D-pad.</li> +<li>Use the {@code uiautomatorviewer} tool to ensure that the UI component is accessible to the testing framework. You can also test the application by turning on accessibility services like TalkBack and Explore by Touch, and try using your application using only directional controls. </li> +</ul> +</p> + +<p>For more information about implementing and testing accessibility, see <a href="{@docRoot}guide/topics/ui/accessibility/apps.html">Making Applications Accessible</a>.</p> + +<p class="note"><strong>Note: </strong>To identify the non-accessible components in the UI, click on the <strong>Toggle NAF Nodes</strong> option in the {@code uiautomatorviewer} tool.</p> + +<p>Generally, Android application developers get accessibility support for free, courtesy of the {@link android.view.View} and {@link android.view.ViewGroup} classes. However, some applications use custom view components to provide a richer user experience. Such custom components won't get the accessibility support that is provided by the standard Android UI components. If this applies to your application, ensure that the application developer exposes the custom drawn UI components to Android accessibility services, by implementing the {@link android.view.accessibility.AccessibilityNodeProvider} class. For more information about making custom view components accessible, see <a href="{@docRoot}guide/topics/ui/accessibility/apps.html#custom-views">Making Applications Accessible</a>.</p> + +<h3 id="configure">Configure your development environment</h3> +<p>If you're developing in Eclipse, the Android SDK provides additional tools that help you write test cases using {@code uiautomator} and buiild your JAR file. In order to set up Eclipse to assist you, you need to create a project that includes the {@code uiautomator} client library, along with the Android SDK library. To configure Eclipse:</p> +<ol> +<li>Create a new Java project in Eclipse, and give your project a name that is relevant to the tests you’re about to create (for example, "MyAppNameTests"). In the project, you will create the test cases that are specific to the application that you want to test.</li> +<li>From the <strong>Project Explorer</strong>, right-click on the new project that you created, then select <strong>Properties > Java Build Path</strong>, and do the following: + <ol type="a"> + <LI>Click <strong>Add Library > JUnit</strong> then select <strong>JUnit3</strong> to add JUnit support.</LI> + <li>Click <strong>Add External JARs...</strong> and navigate to the SDK directory. Under the platforms directory, select the latest SDK version and add both the {@code uiautomator.jar} and {@code android.jar} files.</li> + </ol> +</li> +</ol> +<p>If you did not configure Eclipse as your development environment, make sure that the {@code uiautomator.jar} and {@code android.jar} files from the {@code <android-sdk>/platforms/<sdk>} directory are in your Java class path.</p> +<p>Once you have completed these prerequisite tasks, you're almost ready to start creating your {@code uiautomator} tests. </li> + +<h2 id="creating">Creating uiautomator Tests</h2> +<p>To build a test that runs in the {@code uiautomator} framework, create a test case that extends the <a href="{@docRoot}tools/help/uiautomator/UiAutomatorTestCase.html">{@code UiAutomatorTestCase}</a> class. In Eclipse, the test case file goes under the {@code src} directory in your project. Later, you will build the test case as a JAR file, then copy this file to the test device. The test JAR file is not an APK file and resides separately from the application that you want to test on the device.</p> + +<p>Because the <a href="{@docRoot}tools/help/uiautomator/UiAutomatorTestCase.html">{@code UiAutomatorTestCase}</a> class extends {@code junit.framework.TestCase}, you can use the JUnit {@code Assert} class to test that UI components in the app return the expected results. To learn more about JUnit, you can read the documentation on the <a href="http://www.junit.org/">junit.org</a> home page.</p> + +<p>The first thing your test case should do is access the device that contains the target app. It’s also good practice to start the test from the Home screen of the device. From the Home screen (or some other starting location you’ve chosen in the target app), you can use the classes provided by the {@code uiautomator} API to simulate user actions and to test specific UI components. For an example of how to put together a {@code uiautomator} test case, see the <a href="#sample">sample test case</a>.</p> + +<h3 id="classes">uiautomator API</h3> +<p>The {@code uiautomator} API is bundled in the {@code uiautomator.jar} file under the {@code <android-sdk>/platforms/} directory. The API includes these key classes that allow you to capture and manipulate UI components on the target app:</p> +<dl> +<DT><a href="{@docRoot}tools/help/uiautomator/UiDevice.html">{@code UiDevice}</a></DT> +<dd><p>Represents the device state. In your tests, you can call methods on the <a href="{@docRoot}tools/help/uiautomator/UiDevice.html">{@code UiDevice}</a> instance to check for the state of various properties, such as current orientation or display size. Your tests also can use the <a href="{@docRoot}tools/help/uiautomator/UiDevice.html">{@code UiDevice}</a> instance to perform device level actions, such as forcing the device into a specific rotation, pressing the d-pad hardware button, or pressing the Home and Menu buttons.</p> +<p>To get an instance of <a href="{@docRoot}tools/help/uiautomator/UiDevice.html">{@code UiDevice}</a> and simulate a Home button press: +<pre> +getUiDevice().pressHome(); +</pre></p></dd> + +<dt><a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code UiSelector}</a></dt> +<dd>Represents a search criteria to query and get a handle on specific elements in the currently displayed UI. +If more than one matching element is found, the first matching element in the layout hierarchy is returned as the target {@code UiObject}. When constructing a <a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code UiSelector}</a>, you can chain together multiple properties to refine your search. If no matching UI element is found, a <a href="{@docRoot}tools/help/uiautomator/UiAutomatorObjectNotFoundException.html">{@code UiAutomatorObjectNotFoundException}</a> is thrown. You can use the <a href="{@docRoot}tools/help/uiautomator/UiSelector.html#childSelector(com.android.uiautomator.core.UiSelector)">{@code childSelector()}</a> method to nest multiple <a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code UiSelector}</a> instances. For example, the following code example shows how to specify a search to find the first {@link android.widget.ListView} in the currently displayed UI, then search within that {@link android.widget.ListView} to find a UI element with the text property {@code Apps}. +<pre> +UiObject appItem = new UiObject(new UiSelector() + .className("android.widget.ListView").instance(1) + .childSelector(new UiSelector().text("Apps"))); +</pre> +</dd> + +<dt><a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code UiObject}</a></dt> +<dd>Represents a UI element. To create a <a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code UiObject}</a> instance, use a {@code UiSelector} that describes how to search for, or select, the UI element. +<p>The following code example shows how to construct <a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code UiObject}</a> instances that represent a <strong>Cancel</strong> button and a <strong>OK</strong> button in your application.</p> +<pre> +UiObject cancelButton = new UiObject(new UiSelector().text("Cancel")); +UiObject okButton = new UiObject(new UiSelector().text("OK")); +</pre> +<p>You can reuse the <a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code UiObject}</a> instances that you have created in other parts of your app testing, as needed. Note that the {@code uiautomator} test framework searches the current display for a match every time your test uses a <a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code UiObject}</a> instance to click on a UI element or query a property.</p> +<p>In the following code example, the {@code uiautomator} test framework searches for a UI element with the text property {@code OK}. If a match is found and if the element is enabled, the framework simulates a user click action on the element.</p> +<pre> +if(okButton.exists() && okButton.isEnabled()) +{ + okButton.click(); +} +</pre> +<p>You can also restrict the search to find only elements of a specific class. For example, to find matches of the {@link android.widget.Button} class:</p> +<pre> +UiObject cancelButton = new UiObject(new UiSelector().text("Cancel") + .className("android.widget.Button")); +UiObject okButton = new UiObject(new UiSelector().text("OK") + .className("android.widget.Button")); +</pre> +</dd> + +<dt><a href="{@docRoot}tools/help/uiautomator/UiCollection.html">{@code UiCollection}</a></dt> +<dd>Represents a collection of items, for example songs in a music album or a list of emails in an inbox. Similar to a <a href="{@docRoot}tools/help/uiautomator/UiObject.html">{@code UiObject}</a>, you construct a <a href="{@docRoot}tools/help/uiautomator/UiCollection.html">{@code UiCollection}</a> instance by specifying a <a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code UiSelector}</a>. The <a href="{@docRoot}tools/help/uiautomator/UiSelector.html">{@code UiSelector}</a> for a <a href="{@docRoot}tools/help/uiautomator/UiCollection.html">{@code UiCollection}</a> should search for a UI element that is a container or wrapper of other child UI elements (such as a layout view that contains child UI elements). For example, the following code snippet shows how to construct a <a href="{@docRoot}tools/help/uiautomator/UiCollection.html">{@code UiCollection}</a> to represent a video album that is displayed within a {@link android.widget.FrameLayout}: +<pre> +UiCollection videos = new UiCollection(new UiSelector() + .className("android.widget.FrameLayout")); +</pre> +<p>If the videos are listed within a {@link android.widget.LinearLayout} view, and you want to to retrieve the number of videos in this collection:</p> +<pre> +int count = videos.getChildCount(new UiSelector() + .className("android.widget.LinearLayout")); +</pre> +<p>If you want to find a specific video that is labeled with the text element {@code Cute Baby Laughing} from the collection and simulate a user-click on the video:</p> +<pre> +UiObject video = videos.getChildByText(new UiSelector() + .className("android.widget.LinearLayout"), "Cute Baby Laughing"); +video.click(); +</pre> +<p>Similarly, you can simulate other user actions on the UI object. For example, if you want +to simulate selecting a checkbox that is associated with the video:</p> +<pre> +UiObject checkBox = video.getChild(new UiSelector() + .className("android.widget.Checkbox")); +if(!checkBox.isSelected()) checkbox.click(); +</pre> +</dd> + +<dt><a href="{@docRoot}tools/help/uiautomator/UiScrollable.html">{@code UiScrollable}</a></dt> +<dd>Represents a scrollable collection of UI elements. You can use the <a href="{@docRoot}tools/help/uiautomator/UiScrollable.html">{@code UiScrollable}</a> class to simulate vertical or horizontal scrolling across a display. This technique is helpful when a UI element is positioned off-screen and you need to scroll to bring it into view. +<p>For example, the following code shows how to simulate scrolling down the Settings menu and clicking on an <strong>About tablet</strong> option:</p> +<pre> +UiScrollable settingsItem = new UiScrollable(new UiSelector() + .className("android.widget.ListView")); +UiObject about = settingsItem.getChildByText(new UiSelector() + .className("android.widget.LinearLayout"), "About tablet"); +about.click() +</pre> +</dd> +</dl> +<p>For more information about these APIs, see the <a href="{@docRoot}tools/help/uiautomator/index.html">{@code uiautomator}</a> reference.</p> + +<h3 id="sample">A sample uiautomator test case</h3> +<p>The following code example shows a simple test case which simulates a user bringing up the Settings app in a stock Android device. The test case mimics all the steps that a user would typically take to perform this task, including opening the Home screen, launching the <strong>All Apps</strong> screen, scrolling to the <strong>Settings</strong> app icon, and clicking on the icon to enter the Settings app.</p> +<pre> +package com.uia.example.my; + +// Import the uiautomator libraries +import com.android.uiautomator.core.UiObject; +import com.android.uiautomator.core.UiObjectNotFoundException; +import com.android.uiautomator.core.UiScrollable; +import com.android.uiautomator.core.UiSelector; +import com.android.uiautomator.testrunner.UiAutomatorTestCase; + +public class LaunchSettings extends UiAutomatorTestCase { + + public void testDemo() throws UiObjectNotFoundException { + + // Simulate a short press on the HOME button. + getUiDevice().pressHome(); + + // We’re now in the home screen. Next, we want to simulate + // a user bringing up the All Apps screen. + // If you use the uiautomatorviewer tool to capture a snapshot + // of the Home screen, notice that the All Apps button’s + // content-description property has the value “Apps”. We can + // use this property to create a UiSelector to find the button. + UiObject allAppsButton = new UiObject(new UiSelector() + .description("Apps")); + + // Simulate a click to bring up the All Apps screen. + allAppsButton.clickAndWaitForNewWindow(); + + // In the All Apps screen, the Settings app is located in + // the Apps tab. To simulate the user bringing up the Apps tab, + // we create a UiSelector to find a tab with the text + // label “Apps”. + UiObject appsTab = new UiObject(new UiSelector() + .text("Apps")); + + // Simulate a click to enter the Apps tab. + appsTab.click(); + + // Next, in the apps tabs, we can simulate a user swiping until + // they come to the Settings app icon. Since the container view + // is scrollable, we can use a UiScrollable object. + UiScrollable appViews = new UiScrollable(new UiSelector() + .scrollable(true)); + + // Set the swiping mode to horizontal (the default is vertical) + appViews.setAsHorizontalList(); + + // Create a UiSelector to find the Settings app and simulate + // a user click to launch the app. + UiObject settingsApp = appViews.getChildByText(new UiSelector() + .className(android.widget.TextView.class.getName()), + "Settings"); + settingsApp.clickAndWaitForNewWindow(); + + // Validate that the package name is the expected one + UiObject settingsValidation = new UiObject(new UiSelector() + .packageName("com.android.settings")); + assertTrue("Unable to detect Settings", + settingsValidation.exists()); + } +} +</pre> + +<h2 id="builddeploy">Building and Deploying Your uiautomator Tests</h2> +<p>Once you have coded your test, follow these steps to build and deploy your test JAR to your target Android test device:</p> +<ol> +<li>Create the required build configuration files to build the output JAR. To generate the build configuration files, open a terminal and run the following command: +<pre><android-sdk>/tools/android create uitest-project -n <name> -t 1 -p <path></pre> +The {@code <name>} is the name of the project that contains your {@code uiautomator} test source files, and the {@code <path>} is the path to the corresponding project directory. +</li> +<LI>From the command line, set the {@code ANDROID_HOME} variable: +<ul> +<li>In Windows: +<pre>set ANDROID_HOME=<path_to_your_sdk></pre> +</li> +<li>In UNIX: +<pre>export ANDROID_HOME=<path_to_your_sdk></pre> +</li> +</ul> +</LI> +<li>Go to the project directory where your {@code build.xml} file is located and build your test JAR. <pre>ant build</pre></li> +<li>Deploy your generated test JAR file to the test device by using the {@code adb push} command: <pre>adb push <path_to_output_jar> /data/local/tmp/</pre> +<p>Here’s an example: <pre>adb push ~/dev/workspace/LaunchSettings/bin/LaunchSettings.jar /data/local/tmp/</pre></p> +</li> +</ol> + +<h2 id="running">Running uiautomator Tests</h2> +<p>Here’s an example of how to run a test that is implemented in the {@code LaunchSettings.jar} file. The tests are bundled in the {@code com.uia.example.my} package:</p> +<pre>adb shell uiautomator runtest LaunchSettings.jar -c com.uia.example.my.LaunchSettings</pre> +<p>To learn more about the syntax, subcommands, and options for {@code uiautomator}, see the <a href="{@docRoot}tools/help/uiautomator/index.html">{@code uiautomator}</a> reference.</p> + + +<h2 id="bestpractices">Best Practices</h2> +<p>Here are some best practices for functional UI testing with the {@code uiautomator} framework: </p> +<ul> +<LI>Ensure that you validate the same UI functions on your application across the various types of devices that your application might run on (for example, devices with different screen densities).</LI> +<li>You should also test your UI against common scenarios such as in-coming phone calls, network interruptions, and user-initiated switching to other applications on the device.</li> +</ul> + diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs index 56bbd5a..91a018c 100644 --- a/docs/html/tools/tools_toc.cs +++ b/docs/html/tools/tools_toc.cs @@ -10,8 +10,8 @@ <div class="nav-section-header"><a href="<?cs var:toroot ?>sdk/index.html"><span class="en">Download</span></a></div> <ul> - <li><a href="<?cs var:toroot ?>sdk/installing/bundle.html"> - <span class="en">Setting Up the ADT Bundle</span></a></li> + <li><a href="<?cs var:toroot ?>sdk/installing/bundle.html"> + <span class="en">Setting Up the ADT Bundle</span></a></li> <li class="nav-section"> <div class="nav-section-header"> <a href="<?cs var:toroot ?>sdk/installing/index.html"><span class="en">Setting Up @@ -19,12 +19,12 @@ <ul> <li><a href="<?cs var:toroot ?>sdk/installing/installing-adt.html"> <span class="en">Installing the Eclipse Plugin</span></a></li> - <li><a href="<?cs var:toroot ?>sdk/installing/adding-packages.html"> - <span class="en">Adding Platforms and Packages</span></a></li> + <li><a href="<?cs var:toroot ?>sdk/installing/adding-packages.html"> + <span class="en">Adding Platforms and Packages</span></a></li> </ul> </li> - <li><a href="<?cs var:toroot ?>sdk/exploring.html"> - <span class="en">Exploring the SDK</span></a></li> + <li><a href="<?cs var:toroot ?>sdk/exploring.html"> + <span class="en">Exploring the SDK</span></a></li> <li><a href="<?cs var:toroot ?>tools/sdk/ndk/index.html">Download the NDK</a> </li> </ul> @@ -32,32 +32,33 @@ <li class="nav-section"> <div class="nav-section-header"> - <a href="/tools/workflow/index.html"><span class="en">Workflow</span></a> + <a href="<?cs var:toroot ?>tools/workflow/index.html"><span class="en">Workflow</span></a> </div> <ul> <li class="nav-section"> - <div class="nav-section-header"><a href="/tools/devices/index.html"><span class="en">Setting Up Virtual Devices</span></a></div> + <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/devices/index.html"><span class="en">Setting Up Virtual Devices</span></a></div> <ul> - <li><a href="/tools/devices/managing-avds.html"><span class="en">With AVD Manager</span></a></li> - <li><a href="/tools/devices/managing-avds-cmdline.html"><span class="en">From the Command Line</span></a></li> - <li><a href="/tools/devices/emulator.html"><span class="en">Using the Android Emulator</span></a></li> + <li><a href="<?cs var:toroot ?>tools/devices/managing-avds.html"><span class="en">With AVD Manager</span></a></li> + <li><a href="<?cs var:toroot ?>tools/devices/managing-avds-cmdline.html"><span class="en">From the Command Line</span></a></li> + <li><a href="<?cs var:toroot ?>tools/devices/emulator.html"><span class="en">Using the Android Emulator</span></a></li> </ul> </li> - <li><a href="/tools/device.html"><span class="en">Using Hardware Devices</span></a></li> + <li><a href="<?cs var:toroot ?>tools/device.html"><span class="en">Using Hardware Devices</span></a></li> <li class="nav-section"> - <div class="nav-section-header"><a href="/tools/projects/index.html"><span class="en">Setting Up Projects</span></a></div> + <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/projects/index.html"><span class="en">Setting Up Projects</span></a></div> <ul> - <li><a href="/tools/projects/projects-eclipse.html"><span class="en">From Eclipse with ADT</span></a></li> - <li><a href="/tools/projects/projects-cmdline.html"><span class="en">From the Command Line</span></a></li> + <li><a href="<?cs var:toroot ?>tools/projects/projects-eclipse.html"><span class="en">From Eclipse with ADT</span></a></li> + <li><a href="<?cs var:toroot ?>tools/projects/projects-cmdline.html"><span class="en">From the Command Line</span></a></li> + <li><a href="<?cs var:toroot ?>tools/projects/templates.html"><span class="en">Using Code Templates</span></a></li> </ul> </li> <li class="nav-section"> - <div class="nav-section-header"><a href="/tools/building/index.html"><span class="en">Building and Running</span></a></div> + <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/building/index.html"><span class="en">Building and Running</span></a></div> <ul> - <li><a href="/tools/building/building-eclipse.html"><span class="en">From Eclipse with ADT</span></a></li> - <li><a href="/tools/building/building-cmdline.html"><span class="en">From the Command Line</span></a></li> + <li><a href="<?cs var:toroot ?>tools/building/building-eclipse.html"><span class="en">From Eclipse with ADT</span></a></li> + <li><a href="<?cs var:toroot ?>tools/building/building-cmdline.html"><span class="en">From the Command Line</span></a></li> </ul> </li> @@ -93,6 +94,10 @@ <a href="<?cs var:toroot?>tools/testing/testing_accessibility.html"> <span class="en">Accessibility Testing</span></a> </li> + <li> + <a href="<?cs var:toroot?>tools/testing/testing_ui.html"> + <span class="en">UI Testing</span></a> + </li> <li> <a href="<?cs var:toroot ?>tools/testing/what_to_test.html"> <span class="en">What To Test</span></a> @@ -166,6 +171,20 @@ class="en">MonkeyRunner</span></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/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> diff --git a/docs/html/tools/workflow/publishing/preparing.jd b/docs/html/tools/workflow/publishing/preparing.jd index 4633d7e..9925037 100644 --- a/docs/html/tools/workflow/publishing/preparing.jd +++ b/docs/html/tools/workflow/publishing/preparing.jd @@ -291,7 +291,7 @@ current user has purchased it. Using Google Play Licensing is optional even if y releasing your app through Google Play.</p> <p>For more information about Google Play Licensing Service and how to use it in your -application, see <a href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a>.</p> +application, see <a href="{@docRoot}google/play/licensing/index.html">Application Licensing</a>.</p> <h2 id="publishing-build">Building Your Application for Release</h2> @@ -333,7 +333,7 @@ information about the signing process and signing guidelines.</p> <p>If your application relies on a remote server, make sure the server is secure and that it is configured for production use. This is particularly important if you are implementing <a -href="{@docRoot}guide/google/play/billing/index.html">in-app billing</a> in your application and you are +href="{@docRoot}google/play/billing/index.html">in-app billing</a> in your application and you are performing the signature verification step on a remote server.</p> <p>Also, if your application fetches content from a remote server or a real-time service (such as a diff --git a/docs/html/tools/workflow/publishing/publishing.jd b/docs/html/tools/workflow/publishing/publishing.jd index a54b030..ab6321c 100644 --- a/docs/html/tools/workflow/publishing/publishing.jd +++ b/docs/html/tools/workflow/publishing/publishing.jd @@ -58,11 +58,11 @@ Applications</a>.</p> publish it on an application marketplace like Google Play. Publishing on Google Play is a straightforward process that you can do in just a few simple steps—register, configure, upload, and publish. Registration takes only a few minutes and needs to be done only once. -The configuration and publishing steps can all be done through the Google Play Android Developer Console +The configuration and publishing steps can all be done through the Google Play Developer Console after you register as a Google Play developer.</p> <p>To start publishing on Google Play, first read this topic and then go to the <a -href="https://play.google.com/apps/publish">Google Play Android Developer Console</a> and register as +href="https://play.google.com/apps/publish">Google Play Developer Console</a> and register as a Google Play developer.</p> @@ -73,8 +73,8 @@ your Android applications to users around the world. When you release your appli Google Play you have access to a suite of developer tools that let you analyze your sales, identify market trends, and control who your applications are being distributed to. You also have access to several revenue-enhancing features, such as <a -href="{@docRoot}guide/google/play/billing/index.html">in-app billing</a> and -<a href="{@docRoot}guide/google/play/licensing/index.html">application licensing</a>.</p> +href="{@docRoot}google/play/billing/index.html">in-app billing</a> and +<a href="{@docRoot}google/play/licensing/index.html">application licensing</a>.</p> <p>Before you can publish applications on Google Play, you need to <a href="http://play.google.com/apps/publish">register</a> as a Google Play developer. During the @@ -83,7 +83,7 @@ to the <a href="http://www.android.com/us/developer-distribution-agreement.html" Developer Distribution Agreement</a>. After you register you can access the Developer Console, where you can upload applications, configure publishing options, and monitor publishing data. If you want to sell your applications or use the in-app billing feature, you will also need -to set up a Google Checkout merchant account. For more information about the registration process, +to set up a Google Wallet merchant account. For more information about the registration process, see <a href="https://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=113468"> Developer Registration</a>.</p> @@ -150,7 +150,7 @@ href="https://support.google.com/androidmarket/developer/bin/answer.py?hl=en&ans href="http://support.google.com/androidmarket/developer/bin/answer.py?hl=en&answer=188189&topic= 2364761&ctx=topic">content rating</a>. In addition, if you want to sell items within your app using the in-app billing feature, you can use the Developer Console to <a -href="http://grendel.sea.corp.google.com:48014/guide/google/play/billing/billing_admin.html#billing-list +href="http://grendel.sea.corp.google.com:48014/google/play/billing/billing_admin.html#billing-list - setup">create a product list</a> and control which items are available for purchase in your app.</p> @@ -194,7 +194,7 @@ filter in your manifest, only those devices that have a camera will see your app Play. Filters must be configured in your application's manifest file when you are <a href="{@docRoot}tools/publishing/preparing.html">preparing your app for release</a> (that is, before you upload your app to Google Play). For more information, see <a -href="{@docRoot}guide/google/play/filters.html">Filters on Google Play</a>.</p> +href="{@docRoot}google/play/filters.html">Filters on Google Play</a>.</p> <p>You can also use the multiple APK feature to distribute different {@code .apk} files under the same application listing and the same package name; however, you should use this option only as a last @@ -211,7 +211,7 @@ each APK to the appropriate devices based on configuration support you've declar file of each APK. To use this feature, you need to build your separate {@code .apk} files when you are <a href="{@docRoot}tools/publishing/preparing.html">preparing your app for release</a> (that is, before you upload your app to Google Play). For more information, see <a -href="{@docRoot}guide/google/play/publishing/multiple-apks.html">Multiple APK Support</a>.</p> +href="{@docRoot}google/play/publishing/multiple-apks.html">Multiple APK Support</a>.</p> <h2 id="marketupgrade">Publishing Updates on Google Play</h2> @@ -254,11 +254,11 @@ higher.</p> <p>For complete information about Google Play Licensing Service and how to use it in your application, read <a -href="{@docRoot}guide/google/play/licensing/index.html">Application Licensing</a>.</p> +href="{@docRoot}google/play/licensing/index.html">Application Licensing</a>.</p> <h2 id="marketinappbilling">Using Google Play In-app Billing</h2> -<p><a href="{@docRoot}guide/google/play/billing/billing_overview.html">Google Play In-app Billing</a> +<p><a href="{@docRoot}google/play/billing/billing_overview.html">Google Play In-app Billing</a> is a Google Play service that lets you sell digital content in your applications. You can use the service to sell a wide range of content, including downloadable content such as media files or photos, and virtual content such as game levels or potions.</p> @@ -271,16 +271,16 @@ in-app purchases is the same as the transaction fee for application purchases (3 <p>Any application that you publish through Google Play can implement in-app billing. No special account or registration is required other than a Google Play publisher account and a Google -Checkout Merchant account. Also, because the service uses no dedicated framework APIs, you can add +Wallet merchant account. Also, because the service uses no dedicated framework APIs, you can add in-app billing to any application that uses a minimum API level of 4 or higher.</p> <p>To help you integrate in-app billing into your application, the Android SDK provides a <a -href="{@docRoot}guide/google/play/billing/billing_integrate.html#billing-download">sample application</a> +href="{@docRoot}google/play/billing/billing_integrate.html#billing-download">sample application</a> that demonstrates a simple implementation of in-app billing. The sample application contains examples of billing-related classes you can use to implement in-app billing in your application. It also contains examples of the database, user interface, and business logic you might use to implement in-app billing. For more information about the in-app billing feature, see the -<a href="{@docRoot}guide/google/play/billing/index.html">In-app Billing documentation</a>.</p> +<a href="{@docRoot}google/play/billing/index.html">In-app Billing documentation</a>.</p> <h2 id="marketintent">Linking to Your Apps on Google Play</h2> @@ -632,21 +632,21 @@ $(document).ready(function() { <div class="button-row"> <input type="radio" name="buttonStyle" value="get_it_on_play_logo_small" id="ns" checked="checked" /> - <label for="ns"><img src="http://www.android.com/images/brand/get_it_on_play_logo_small.png" + <label for="ns"><img src="//www.android.com/images/brand/get_it_on_play_logo_small.png" alt="Get it on Google Play (small)" /></label> <input type="radio" name="buttonStyle" value="get_it_on_play_logo_large" id="nm" /> - <label for="nm"><img src="http://www.android.com/images/brand/get_it_on_play_logo_large.png" + <label for="nm"><img src="//www.android.com/images/brand/get_it_on_play_logo_large.png" alt="Get it on Google Play (large)" /></label> </div> <div class="button-row"> <input type="radio" name="buttonStyle" value="android_app_on_play_logo_small" id="ws" /> - <label for="ws"><img src="http://www.android.com/images/brand/android_app_on_play_logo_small.png" + <label for="ws"><img src="//www.android.com/images/brand/android_app_on_play_logo_small.png" alt="Android app on Google Play (small)" /></label> <input type="radio" name="buttonStyle" value="android_app_on_play_logo_large" id="wm" /> - <label for="wm"><img src="http://www.android.com/images/brand/android_app_on_play_logo_large.png" + <label for="wm"><img src="//www.android.com/images/brand/android_app_on_play_logo_large.png" alt="Android app on Google Play (large)" /></label> </div> diff --git a/docs/html/tools/workflow/publishing/publishing_overview.jd b/docs/html/tools/workflow/publishing/publishing_overview.jd index ca0dca8..a1973c9 100755 --- a/docs/html/tools/workflow/publishing/publishing_overview.jd +++ b/docs/html/tools/workflow/publishing/publishing_overview.jd @@ -129,8 +129,8 @@ your Android applications to users around the world. When you release your appli Google Play you have access to a suite of developer tools that let you analyze your sales, identify market trends, and control who your applications are being distributed to. You also have access to several revenue-enhancing features that are not available anywhere else, such as <a -href="{@docRoot}guide/google/play/billing/index.html">in-app billing</a> and <a -href="{@docRoot}guide/google/play/licensing.html">application licensing</a>. This rich array of tools +href="{@docRoot}google/play/billing/index.html">in-app billing</a> and <a +href="{@docRoot}google/play/licensing.html">application licensing</a>. This rich array of tools and features, coupled with numerous end-user community features, makes Google Play the premier marketplace for selling and buying Android applications.</p> diff --git a/docs/html/tools/workflow/publishing_overview.jd b/docs/html/tools/workflow/publishing_overview.jd index ca0dca8..a1973c9 100755 --- a/docs/html/tools/workflow/publishing_overview.jd +++ b/docs/html/tools/workflow/publishing_overview.jd @@ -129,8 +129,8 @@ your Android applications to users around the world. When you release your appli Google Play you have access to a suite of developer tools that let you analyze your sales, identify market trends, and control who your applications are being distributed to. You also have access to several revenue-enhancing features that are not available anywhere else, such as <a -href="{@docRoot}guide/google/play/billing/index.html">in-app billing</a> and <a -href="{@docRoot}guide/google/play/licensing.html">application licensing</a>. This rich array of tools +href="{@docRoot}google/play/billing/index.html">in-app billing</a> and <a +href="{@docRoot}google/play/licensing.html">application licensing</a>. This rich array of tools and features, coupled with numerous end-user community features, makes Google Play the premier marketplace for selling and buying Android applications.</p> |
