diff options
Diffstat (limited to 'docs/html')
-rw-r--r-- | docs/html/guide/developing/device.jd | 31 | ||||
-rw-r--r-- | docs/html/images/training/lint_icon.png | bin | 0 -> 22128 bytes | |||
-rw-r--r-- | docs/html/index.jd | 2 | ||||
-rw-r--r-- | docs/html/sdk/ndk/index.jd | 128 | ||||
-rw-r--r-- | docs/html/sdk/ndk/overview.jd | 2 | ||||
-rw-r--r-- | docs/html/sdk/oem-usb.jd | 200 | ||||
-rw-r--r-- | docs/html/sdk/sdk_toc.cs | 2 | ||||
-rw-r--r-- | docs/html/sdk/win-usb.jd | 187 | ||||
-rw-r--r-- | docs/html/training/improving-layouts/optimizing-layout.jd | 45 |
9 files changed, 357 insertions, 240 deletions
diff --git a/docs/html/guide/developing/device.jd b/docs/html/guide/developing/device.jd index d390ec1..d22dca1 100644 --- a/docs/html/guide/developing/device.jd +++ b/docs/html/guide/developing/device.jd @@ -51,19 +51,13 @@ would on the emulator. Before you can start, there are just a few things to do:< <ol> <li>Declare your application as "debuggable" in your Android Manifest. - <p>In Eclipse, you can do this from the <b>Application</b> tab when viewing the Manifest - (on the right side, set <b>Debuggable</b> to <em>true</em>). Otherwise, in the -<code>AndroidManifest.xml</code> - file, add <code>android:debuggable="true"</code> to the <code><application></code> -element.</p> - </li> - <li>Set up your device to allow installation of non-Market applications. <p>On -the device, go to <strong>Settings > Applications</strong> and enable - -<strong>Unknown sources</strong> (on an Android 4.0 device, the setting is -located in <strong>Settings > Security</strong>).</p> - - </li> + <p>When using Eclipse, you can skip this step, because running your app directly from +the Eclipse IDE automatically enables debugging.</p> + <p>In the <code>AndroidManifest.xml</code> file, add <code>android:debuggable="true"</code> to +the <code><application></code> element.</p> + <p class="note"><strong>Note:</strong> If you manually enable debugging in the manifest + file, be sure to disable it before you build for release (your published application +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> @@ -72,13 +66,10 @@ located in <strong>Settings > Developer options</strong>).</p> </li> <li>Set up your system to detect your device. <ul> - <li>If you're developing on Windows, you need to install a USB driver - for adb. If you're using an Android Developer Phone (ADP), Nexus One, or Nexus S, - see the <a href="{@docRoot}sdk/win-usb.html">Google Windows USB - Driver</a>. Otherwise, you can find a link to the appropriate OEM driver in the - <a href="{@docRoot}sdk/oem-usb.html">OEM USB Drivers</a> document.</li> + <li>If you're developing on Windows, you need to install a USB driver for adb. For an +installation guide and links to OEM drivers, see the <a href="{@docRoot}sdk/oem-usb.html">OEM USB +Drivers</a> document.</li> <li>If you're developing on Mac OS X, it just works. Skip this step.</li> - <li>If you're developing on Ubuntu Linux, you need to add a <code>udev</code> rules file that contains a USB configuration for each type of device you want to use for development. In the rules file, each device manufacturer @@ -114,7 +105,7 @@ rules</a>.</p> </li> </ol> -<p>You can verify that your device is connected by executing <code>adb +<p>When plugged in over USB, 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> diff --git a/docs/html/images/training/lint_icon.png b/docs/html/images/training/lint_icon.png Binary files differnew file mode 100644 index 0000000..118a741 --- /dev/null +++ b/docs/html/images/training/lint_icon.png diff --git a/docs/html/index.jd b/docs/html/index.jd index b9d6758..431a7d2 100644 --- a/docs/html/index.jd +++ b/docs/html/index.jd @@ -154,7 +154,7 @@ href="{@docRoot}resources/dashboard/platform-versions.html">Learn more »</ + "href='https://plus.google.com/108967384991768947849'>+Android Developers</a>. " + "We'll use it to host Hangouts for developers, talk about the latest releases, " + "development and design tips, and much more.</p>" -+ "<div style='margin:.7em 0 0 -1.2em'><g:plus href='https://plus.google.com/108967384991768947849' " ++ "<div style='margin:.7em 0 0 0'><g:plus href='https://plus.google.com/108967384991768947849' " + "size=\"smallbadge\" width=\"275\"></g:plus></div>" }, diff --git a/docs/html/sdk/ndk/index.jd b/docs/html/sdk/ndk/index.jd index afbad57..29f0749 100644 --- a/docs/html/sdk/ndk/index.jd +++ b/docs/html/sdk/ndk/index.jd @@ -1,16 +1,16 @@ ndk=true -ndk.win_download=android-ndk-r7-windows.zip -ndk.win_bytes=81270552 -ndk.win_checksum=55483482cf2b75e8dd1a5d9a7caeb6e5 +ndk.win_download=android-ndk-r7b-windows.zip +ndk.win_bytes=80346206 +ndk.win_checksum=c42b0c9c14428397337421d5e4999380 -ndk.mac_download=android-ndk-r7-darwin-x86.tar.bz2 -ndk.mac_bytes=71262092 -ndk.mac_checksum=817ca5675a1dd44078098e43070f19b6 +ndk.mac_download=android-ndk-r7b-darwin-x86.tar.bz2 +ndk.mac_bytes=73817184 +ndk.mac_checksum=6daa82ca6b73bc0614c9997430079c7a -ndk.linux_download=android-ndk-r7-linux-x86.tar.bz2 -ndk.linux_bytes=64884365 -ndk.linux_checksum=bf15e6b47bf50824c4b96849bf003ca3 +ndk.linux_download=android-ndk-r7b-linux-x86.tar.bz2 +ndk.linux_bytes=64349733 +ndk.linux_checksum=0eb8af18796cdaa082df8f7c54ad7f9a page.title=Android NDK @@ -62,6 +62,116 @@ padding: .25em 1em; <div class="toggleable open"> <a href="#" onclick="return toggleDiv(this)"><img src= "{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px"> + Android NDK, Revision 7b</a> <em>(February 2012)</em> + + <div class="toggleme"> + <p>This release of the NDK includes fixes for native Windows builds, Cygwin and many other + improvements:</p> + + <dl> + <dt>Important bug fixes:</dt> + + <dd> + <ul> + <li>Updated {@code sys/atomics.h} to avoid correctness issues + on some multi-core ARM-based devices. Rebuild your unmodified sources with this + version of the NDK and this problem should be completely eliminated. + For more details, read {@code docs/ANDROID-ATOMICS.html}.</li> + <li>Reverted to {@code binutils} 2.19 to fix debugging issues that + appeared in NDK r7 (which switched to {@code binutils} 2.20.1).</li> + <li>Fixed {@code ndk-build} on 32-bit Linux. A packaging error put a 64-bit version + of the {@code awk} executable under {@code prebuilt/linux-x86/bin} in NDK r7.</li> + <li>Fixed native Windows build ({@code ndk-build.cmd}). Other build modes were not + affected. The fixes include: + <ul> + <li>Removed an infinite loop / stack overflow bug that happened when trying + to call {@code ndk-build.cmd} from a directory that was <em>not</em> the top of + your project path (e.g., in any sub-directory of it).</li> + <li>Fixed a problem where the auto-generated dependency files were ignored. This + meant that updating a header didn't trigger recompilation of sources that included + it.</li> + <li>Fixed a problem where special characters in files or paths, other than spaces and + quotes, were not correctly handled.</li> + </ul> + </li> + <li>Fixed the standalone toolchain to generate proper binaries when using + {@code -lstdc++} (i.e., linking against the GNU {@code libstdc++} C++ runtime). You + should use {@code -lgnustl_shared} if you want to link against the shared library + version or {@code -lstdc++} for the static version. + + <p>See {@code docs/STANDALONE-TOOLCHAIN.html} for more details about this fix.</p> + </li> + <li>Fixed {@code gnustl_shared} on Cygwin. The linker complained that it couldn't find + {@code libsupc++.a} even though the file was at the right location.</li> + <li>Fixed Cygwin C++ link when not using any specific C++ runtime through + {@code APP_STL}.</li> + </ul> + </dd> + </dl> + + <dl> + <dt>Other changes:</dt> + + <dd> + <ul> + <li>When your application uses the GNU {@code libstdc++} runtime, the compiler will + no longer forcibly enable exceptions and RTTI. This change results in smaller code. + <p>If you need these features, you must do one of the following:</p> + <ul> + <li>Enable exceptions and/or RTTI explicitly in your modules or + {@code Application.mk}. (recommended)</li> + <li>Define {@code APP_GNUSTL_FORCE_CPP_FEATURES} to {@code 'exceptions'}, + {@code 'rtti'} or both in your {@code Application.mk}. See + {@code docs/APPLICATION-MK.html} for more details.</li> + </ul> + </li> + <li>{@code ndk-gdb} now works properly when your application has private services + running in independent processes. It debugs the main application process, instead of the + first process listed by {@code ps}, which is usually a service process.</li> + <li>Fixed a rare bug where NDK r7 would fail to honor the {@code LOCAL_ARM_MODE} value + and always compile certain source files (but not all) to 32-bit instructions.</li> + <li>{@code stlport}: Refresh the sources to match the Android platform version. This + update fixes a few minor bugs: + <ul> + <li>Fixed instantiation of an incomplete type</li> + <li>Fixed minor "==" versus "=" typo</li> + <li>Used {@code memmove} instead of {@code memcpy} in {@code string::assign}</li> + <li>Added better handling of {@code IsNANorINF}, {@code IsINF}, {@code IsNegNAN}, + etc.</li> + </ul> + <p>For complete details, see the commit log.</p> + </li> + <li>{@code stlport}: Removed 5 unnecessary static initializers from the library.</li> + <li>The GNU libstdc++ libraries for armeabi-v7a were mistakenly compiled for + armeabi instead. This change had no impact on correctness, but using the right + ABI should provide slightly better performance.</li> + <li>The {@code cpu-features} helper library was updated to report three optional + x86 CPU features ({@code SSSE3}, {@code MOVBE} and {@code POPCNT}). See + {@code docs/CPU-FEATURES.html} for more details.</li> + <li>{@code docs/NDK-BUILD.html} was updated to mention {@code NDK_APPLICATION_MK} instead + of {@code NDK_APP_APPLICATION_MK} to select a custom {@code Application.mk} file.</li> + <li>Cygwin: {@code ndk-build} no longer creates an empty "NUL" file in the current + directory when invoked.</li> + <li>Cygwin: Added better automatic dependency detection. In the previous version, it + didn't work properly in the following cases: + <ul> + <li>When the Cygwin drive prefix was not {@code /cygdrive}.</li> + <li>When using drive-less mounts, for example, when Cygwin would translate + {@code /home} to {@code \\server\subdir} instead of {@code C:\Some\Dir}.</li> + </ul> + </li> + <li>Cygwin: {@code ndk-build} does not try to use the native Windows tools under + {@code $NDK/prebuilt/windows/bin} with certain versions of Cygwin and/or GNU Make.</li> + </ul> + </dd> + </dl> + </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"> Android NDK, Revision 7</a> <em>(November 2011)</em> <div class="toggleme"> diff --git a/docs/html/sdk/ndk/overview.jd b/docs/html/sdk/ndk/overview.jd index 85599f7..e969f5d 100644 --- a/docs/html/sdk/ndk/overview.jd +++ b/docs/html/sdk/ndk/overview.jd @@ -46,7 +46,7 @@ page.title=What is the NDK? <li>Documentation, samples, and tutorials</li> </ul> - <p>The latest release of the NDK supports these ARM instruction sets:</p> + <p>The latest release of the NDK supports the following instruction sets:</p> <ul> <li>ARMv5TE (including Thumb-1 instructions)</li> diff --git a/docs/html/sdk/oem-usb.jd b/docs/html/sdk/oem-usb.jd index b81be71..f98257d 100644 --- a/docs/html/sdk/oem-usb.jd +++ b/docs/html/sdk/oem-usb.jd @@ -3,9 +3,21 @@ page.title=OEM USB Drivers <div id="qv-wrapper"> <div id="qv"> + <h2>In this document</h2> + <ol> + <li><a href="#InstallingDriver">Installing a USB Driver</a> + <ol> + <li><a href="#Win7">Windows 7</a></li> + <li><a href="#WinXp">Windows XP</a></li> + <li><a href="#WinVista">Windows Vista</a></li> + </ol> + </li> + <li><a href="#Drivers">OEM Drivers</a></li> + </ol> + <h2>See also</h2> <ol> - <li><a href="{@docRoot}guide/developing/device.html">Developing on a Device</a></li> + <li><a href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a></li> <li><a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a></li> </ol> </div> @@ -18,8 +30,185 @@ where you can download the appropriate USB driver for your device. However, this not exhaustive for all available Android-powered devices.</p> <p>If you're developing on Mac OS X or Linux, then you probably don't need to install a USB driver. -Refer to <a href="{@docRoot}guide/developing/device.html#setting-up">Setting up a Device</a> to -start development with a device.</p> +To start developing with your device, read <a +href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a>.</p> + +<p class="note"><strong>Note:</strong> If your device is one of the Android Developer Phones +(purchased from the Android Market publisher site), a Nexus One, or a Nexus S, then you need +the <a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a>, instead of an OEM driver. The Galaxy +Nexus driver, however, is distributed by <a +href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW">Samsung</a> +(listed as model SCH-I515).</p> + + +<h2 id="InstallingDriver">Installing a USB Driver</h2> + +<p>First, find the appropriate driver for your device from the <a href="#Drivers">OEM drivers</a> +table below.</p> + +<p>Once you've downloaded your USB driver, follow the instructions below to install or upgrade the +driver, based on your version of Windows and whether you're installing for the first time +or upgrading an existing driver.</p> + +<p class="note"><strong>Tip:</strong> When you finish the USB driver installation, +see <a +href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a> for +other important information about using an Android-powered device for +development.</p> + +<ol class="nolist"> + <li><a href="#Win7">Windows 7</a></li> + <li><a href="#WinXp">Windows XP</a></li> + <li><a href="#WinVista">Windows Vista</a></li> +</ol> + + +<p class="caution"><strong>Caution:</strong> +You may make changes to <code>android_winusb.inf</code> file found inside +<code>usb_driver\</code> (for example, to add support for other devices), +however, this will lead to security warnings when you install or upgrade the +driver. Making any other changes to the driver files may break the installation +process.</p> + + +<h3 id="Win7">Windows 7</h3> + + +<p>To install the Android USB driver on Windows 7 for the first time:</p> +<ol> + <li>Connect your Android-powered device to your computer's USB port.</li> + <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer, + and select <strong>Manage</strong>.</li> + <li>Select <strong>Devices</strong> in the left pane.</li> + <li>Locate and expand <em>Other device</em> in the right pane.</li> + <li>Right-click the device name (such as <em>Nexus S</em>) and select <strong>Update + Driver Software</strong>. + This will launch the Hardware Update Wizard.</li> + <li>Select <strong>Browse my computer for driver software</strong> and click + <strong>Next</strong>.</li> + <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB +Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li> + <li>Click <strong>Next</strong> to install the driver.</li> +</ol> + +<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows 7 with the new +driver:</p> + +<ol> + <li>Connect your Android-powered device to your computer's USB port.</li> + <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer, + and select <strong>Manage</strong>.</li> + <li>Select <strong>Device Manager</strong> in the left pane of the Computer Management + window.</li> + <li>Locate and expand <em>Android Phone</em> in the right pane.</li> + <li>Right-click <em>Android Composite ADB Interface</em> and select <strong>Update + Driver</strong>. + This will launch the Hardware Update Wizard.</li> + <li>Select <strong>Install from a list or specific location</strong> and click + <strong>Next</strong>.</li> + <li>Select <strong>Search for the best driver in these locations</strong>; un-check +<strong>Search removable media</strong>; and check <strong>Include this location in the +search</strong>.</li> + <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB +Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li> + <li>Click <strong>Next</strong> to upgrade the driver.</li> +</ol> + + + + + +<h3 id="WinXp">Windows XP</h3> + +<p>To install the Android USB driver on Windows XP for the first time:</p> + +<ol> + <li>Connect your Android-powered device to your computer's USB port. Windows + will detect the device and launch the Hardware Update Wizard.</li> + <li>Select <strong>Install from a list or specific location</strong> and click + <strong>Next</strong>.</li> + <li>Select <strong>Search for the best driver in these locations</strong>; un-check +<strong>Search + removable media</strong>; and check <strong>Include +this location in the search</strong>.</li> + <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB +Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li> + <li>Click <strong>Next</strong> to install the driver.</li> +</ol> + +<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows XP with the new +driver:</p> + +<ol> + <li>Connect your Android-powered device to your computer's USB port.</li> + <li>Right-click on <em>My Computer</em> from your desktop or Windows Explorer, + and select <strong>Manage</strong>.</li> + <li>Select <strong>Device Manager</strong> in the left pane.</li> + <li>Locate and expand <em>Android Phone</em> in the right pane.</li> + <li>Right-click <em>Android Composite ADB Interface</em> and select <strong>Update + Driver</strong>. + This will launch the Hardware Update Wizard.</li> + <li>Select <strong>Install from a list or specific location</strong> and click + <strong>Next</strong>.</li> + <li>Select <strong>Search for the best driver in these locations</strong>; un-check <strong>Search + removable media</strong>; and check <strong>Include +this location in the search</strong>.</li> + <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB +Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li> + <li>Click <strong>Next</strong> to upgrade the driver.</li> +</ol> + + + +<h3 id="WinVista">Windows Vista</h3> + +<p>To install the Android USB driver on Windows Vista for the first time:</p> + +<ol> + <li>Connect your Android-powered device to your computer's USB port. Windows + will detect the device and launch the Found New Hardware wizard.</li> + <li>Select <strong>Locate and install driver software</strong>.</li> + <li>Select <strong>Don't search online</strong>.</li> + <li>Select <strong>I don't have the disk. Show me other options</strong>.</li> + <li>Select <strong>Browse my computer for driver software</strong>.</li> + <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB +Driver is located in {@code <sdk>\extras\google\usb_driver\}.) As long as you specified the +exact location of the + installation package, you may leave <strong>Include subfolders</strong> checked or + unchecked—it doesn't matter.</li> + <li>Click <strong>Next</strong>. Vista may prompt you to confirm the privilege elevation + required for driver installation. Confirm it.</li> + <li>When Vista asks if you'd like to install the Google ADB Interface device, + click <strong>Install</strong> to install the driver.</li> +</ol> + +<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows Vista with the new +driver:</p> + +<ol> + <li>Connect your Android-powered device to your computer's USB port.</li> + <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer, + and select <strong>Manage</strong>.</li> + <li>Select <strong>Device Manager</strong> in the left pane.</li> + <li>Locate and expand <em>ADB Interface</em> in the right pane.</li> + <li>Right-click on <em>HTC Dream Composite ADB Interface</em>, and select <strong>Update + Driver Software</strong>.</li> + <li>When Vista starts updating the driver, a prompt will ask how you want to + search for the driver + software. Select <strong>Browse my computer for driver software</strong>.</li> + <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB +Driver is located in {@code <sdk>\extras\google\usb_driver\}.) As long as you specified the +exact location of the + installation package, you may leave <strong>Include subfolders</strong> checked or + unchecked—it doesn't matter.</li> + <li>Click <strong>Next</strong>. Vista might prompt you to confirm the privilege elevation + required for driver installation. Confirm it.</li> + <li>When Vista asks if you'd like to install the Google ADB Interface device, + click <strong>Install</strong> to upgrade the driver.</li> +</ol> + + +<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 Android Market publisher site), a Nexus One, or a Nexus S, then you need @@ -28,10 +217,7 @@ Nexus driver, however, is distributed by <a href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW">Samsung</a> (listed as model SCH-I515).</p> -<p>For instructions about how to install the driver on Windows, follow the guide for <a - href="{@docRoot}sdk/win-usb.html#InstallingDriver">Installing the USB Driver</a>.</p> -<p class="table-caption"><strong>Table 1.</strong> Links to OEM USB drivers</p> <table><tr> <th>OEM</th> <th>Driver URL</th></tr> @@ -92,7 +278,7 @@ href="http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index">http </tr> <tr><td>KT Tech</td> <td><a -href="http://www.kttech.co.kr/cscenter/download05.asp">http://www.kttech.co.kr/cscenter/download05.asp</a> for EV-S100(Take)</td> +href="http://www.kttech.co.kr/cscenter/download05.asp">http://www.kttech.co.kr/cscenter/download05.asp</a> for EV-S100 (Take)</td> </tr> <tr> <td> diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs index 0de477a..f7541f7 100644 --- a/docs/html/sdk/sdk_toc.cs +++ b/docs/html/sdk/sdk_toc.cs @@ -195,7 +195,7 @@ class="new">new!</span> <span style="display:none" class="zh-TW"></span> </span> <ul> - <li><a href="<?cs var:toroot ?>sdk/ndk/index.html">Android NDK, r7</a> + <li><a href="<?cs var:toroot ?>sdk/ndk/index.html">Android NDK, r7b</a> <span class="new">new!</span> </li> <li><a href="<?cs var:toroot ?>sdk/ndk/overview.html">What is the NDK?</a></li> diff --git a/docs/html/sdk/win-usb.jd b/docs/html/sdk/win-usb.jd index 2d1435b..2bd031e 100644 --- a/docs/html/sdk/win-usb.jd +++ b/docs/html/sdk/win-usb.jd @@ -7,19 +7,12 @@ page.title=Google USB Driver <ol> <li><a href="#notes">Revisions</a></li> <li><a href="#WinUsbDriver">Downloading the Google USB Driver</a></li> - <li><a href="#InstallingDriver">Installing the USB Driver</a> - <ol> - <li><a href="#Win7">Windows 7</a></li> - <li><a href="#WinXp">Windows XP</a></li> - <li><a href="#WinVista">Windows Vista</a></li> - </ol> - </li> </ol> <h2>See also</h2> <ol> - <li><a href="{@docRoot}guide/developing/device.html">Developing on a Device</a></li> + <li><a href="{@docRoot}sdk/oem-usb.html#InstallingDriver">Installing a USB Driver</a></li> + <li><a href="{@docRoot}guide/developing/device.html">Using Hardware Devices</a></li> <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li> - <li><a href="{@docRoot}sdk/oem-usb.html">OEM USB Drivers</a></li> </ol> </div> </div> @@ -43,9 +36,9 @@ href="http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZ (listed as model SCH-I515).</p> <p class="note"><strong>Note:</strong> -If you're developing on Mac OS X or Linux, then you do not need to install a USB driver. Refer to <a -href="{@docRoot}guide/developing/device.html#setting-up">Setting up a Device</a> to start -development with a device.</p> +If you're developing on Mac OS X or Linux, then you do not need to install a USB driver. To start +developing with your device, also read <a href="{@docRoot}guide/developing/device.html">Using +Hardware Devices</a>.</p> <p>The sections below provide instructions on how to download and install the Google USB Driver for Windows. </p> @@ -170,174 +163,10 @@ included with the <a href="{@docRoot}sdk/index.html">Android SDK</a>:</p> <ol> <li>Launch the SDK and AVD Manager by double-clicking <code>SDK Manager.exe</code>, at the root of your SDK directory.</li> - <li>Expand the <em>Third party Add-ons</em> and <em>Google Inc. add-ons</em>.</li> - <li>Check <strong>Google Usb Driver package</strong> and click <strong>Install selected</strong>.</li> + <li>Expand <em>Extras</em>.</li> + <li>Check <strong>Google USB Driver package</strong> and click <strong>Install</strong>.</li> <li>Proceed to install the package. When done, the driver files are downloaded into the <code><sdk>\extras\google\usb_driver\</code> directory.</li> </ol> - - -<h2 id="InstallingDriver">Installing the USB Driver</h2> - -<p>Once you've downloaded your USB driver, follow the instructions below to install or upgrade the -driver, based on your version of Windows and whether you're installing for the first time -or upgrading an existing driver.</p> - -<p class="note"><strong>Tip:</strong> When you finish the USB driver installation, -see <a -href="{@docRoot}guide/developing/device.html">Developing on a Device</a> for -other important information about using an Android-powered device for -development.</p> - -<ol class="nolist"> - <li><a href="#Win7">Windows 7</a></li> - <li><a href="#WinXp">Windows XP</a></li> - <li><a href="#WinVista">Windows Vista</a></li> -</ol> - - -<p class="caution"><strong>Caution:</strong> -You may make changes to <code>android_winusb.inf</code> file found inside -<code>usb_driver\</code> (for example, to add support for other devices), -however, this will lead to security warnings when you install or upgrade the -driver. Making any other changes to the driver files may break the installation -process.</p> - - -<h3 id="Win7">Windows 7</h3> - - -<p>To install the Android USB driver on Windows 7 for the first time:</p> -<ol> - <li>Connect your Android-powered device to your computer's USB port.</li> - <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer, - and select <strong>Manage</strong>.</li> - <li>Select <strong>Devices</strong> in the left pane.</li> - <li>Locate and expand <em>Other device</em> in the right pane.</li> - <li>Right-click the device name (such as <em>Nexus S</em>) and select <strong>Update - Driver Software</strong>. - This will launch the Hardware Update Wizard.</li> - <li>Select <strong>Browse my computer for driver software</strong> and click - <strong>Next</strong>.</li> - <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB -Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li> - <li>Click <strong>Next</strong> to install the driver.</li> -</ol> - -<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows 7 with the new -driver:</p> - -<ol> - <li>Connect your Android-powered device to your computer's USB port.</li> - <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer, - and select <strong>Manage</strong>.</li> - <li>Select <strong>Device Manager</strong> in the left pane of the Computer Management - window.</li> - <li>Locate and expand <em>Android Phone</em> in the right pane.</li> - <li>Right-click <em>Android Composite ADB Interface</em> and select <strong>Update - Driver</strong>. - This will launch the Hardware Update Wizard.</li> - <li>Select <strong>Install from a list or specific location</strong> and click - <strong>Next</strong>.</li> - <li>Select <strong>Search for the best driver in these locations</strong>; un-check -<strong>Search removable media</strong>; and check <strong>Include this location in the -search</strong>.</li> - <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB -Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li> - <li>Click <strong>Next</strong> to upgrade the driver.</li> -</ol> - - - - - -<h3 id="WinXp">Windows XP</h3> - -<p>To install the Android USB driver on Windows XP for the first time:</p> - -<ol> - <li>Connect your Android-powered device to your computer's USB port. Windows - will detect the device and launch the Hardware Update Wizard.</li> - <li>Select <strong>Install from a list or specific location</strong> and click - <strong>Next</strong>.</li> - <li>Select <strong>Search for the best driver in these locations</strong>; un-check -<strong>Search - removable media</strong>; and check <strong>Include -this location in the search</strong>.</li> - <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB -Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li> - <li>Click <strong>Next</strong> to install the driver.</li> -</ol> - -<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows XP with the new -driver:</p> - -<ol> - <li>Connect your Android-powered device to your computer's USB port.</li> - <li>Right-click on <em>My Computer</em> from your desktop or Windows Explorer, - and select <strong>Manage</strong>.</li> - <li>Select <strong>Device Manager</strong> in the left pane.</li> - <li>Locate and expand <em>Android Phone</em> in the right pane.</li> - <li>Right-click <em>Android Composite ADB Interface</em> and select <strong>Update - Driver</strong>. - This will launch the Hardware Update Wizard.</li> - <li>Select <strong>Install from a list or specific location</strong> and click - <strong>Next</strong>.</li> - <li>Select <strong>Search for the best driver in these locations</strong>; un-check <strong>Search - removable media</strong>; and check <strong>Include -this location in the search</strong>.</li> - <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB -Driver is located in {@code <sdk>\extras\google\usb_driver\}.)</li> - <li>Click <strong>Next</strong> to upgrade the driver.</li> -</ol> - - - -<h3 id="WinVista">Windows Vista</h3> - -<p>To install the Android USB driver on Windows Vista for the first time:</p> - -<ol> - <li>Connect your Android-powered device to your computer's USB port. Windows - will detect the device and launch the Found New Hardware wizard.</li> - <li>Select <strong>Locate and install driver software</strong>.</li> - <li>Select <strong>Don't search online</strong>.</li> - <li>Select <strong>I don't have the disk. Show me other options</strong>.</li> - <li>Select <strong>Browse my computer for driver software</strong>.</li> - <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB -Driver is located in {@code <sdk>\extras\google\usb_driver\}.) As long as you specified the -exact location of the - installation package, you may leave <strong>Include subfolders</strong> checked or - unchecked—it doesn't matter.</li> - <li>Click <strong>Next</strong>. Vista may prompt you to confirm the privilege elevation - required for driver installation. Confirm it.</li> - <li>When Vista asks if you'd like to install the Google ADB Interface device, - click <strong>Install</strong> to install the driver.</li> -</ol> - -<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows Vista with the new -driver:</p> - -<ol> - <li>Connect your Android-powered device to your computer's USB port.</li> - <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer, - and select <strong>Manage</strong>.</li> - <li>Select <strong>Device Manager</strong> in the left pane.</li> - <li>Locate and expand <em>ADB Interface</em> in the right pane.</li> - <li>Right-click on <em>HTC Dream Composite ADB Interface</em>, and select <strong>Update - Driver Software</strong>.</li> - <li>When Vista starts updating the driver, a prompt will ask how you want to - search for the driver - software. Select <strong>Browse my computer for driver software</strong>.</li> - <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB -Driver is located in {@code <sdk>\extras\google\usb_driver\}.) As long as you specified the -exact location of the - installation package, you may leave <strong>Include subfolders</strong> checked or - unchecked—it doesn't matter.</li> - <li>Click <strong>Next</strong>. Vista might prompt you to confirm the privilege elevation - required for driver installation. Confirm it.</li> - <li>When Vista asks if you'd like to install the Google ADB Interface device, - click <strong>Install</strong> to upgrade the driver.</li> -</ol> - +<p>For installation information, read <a href="{@docRoot}sdk/oem-usb.html#InstallingDriver">Installing a USB Driver</a>.</p> diff --git a/docs/html/training/improving-layouts/optimizing-layout.jd b/docs/html/training/improving-layouts/optimizing-layout.jd index 65c8af7..0eaf199 100644 --- a/docs/html/training/improving-layouts/optimizing-layout.jd +++ b/docs/html/training/improving-layouts/optimizing-layout.jd @@ -18,7 +18,7 @@ next.link=reusing-layouts.html <ol> <li><a href="#Inspect">Inspect Your Layout</a></li> <li><a href="#Revise">Revise Your Layout</a></li> - <li><a href="#Layoutopt">Use Layoutopt</a></li> + <li><a href="#Lint">Use Lint</a></li> </ol> <!-- other docs (NOT javadocs) --> @@ -44,7 +44,7 @@ is inflated repeatedly, such as when used in a {@link android.widget.ListView} o android.widget.GridView}.</p> <p>In this lesson you'll learn to use <a -href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">Heirachy Viewer</a> and <a +href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a> and <a href="{@docRoot}guide/developing/tools/layoutopt.html">Layoutopt</a> to examine and optimize your layout.</p> @@ -53,7 +53,7 @@ layout.</p> <h2 id="Inspect">Inspect Your Layout</h2> <p>The Android SDK tools include a tool called <a -href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">Heirachy Viewer</a> that allows +href="{@docRoot}guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a> that allows you to analyze your layout while your application is running. Using this tool helps you discover bottlenecks in the layout performance.</p> @@ -130,27 +130,28 @@ example of how each layout has appropriate uses and you should carefully conside layout weight is necessary.</p> -<h2 id="Layoutopt">Use Layoutopt</h2> +<h2 id="Lint">Use Lint</h2> + +<p>It is always good practice to run the <a href="http://tools.android.com/tips/lint">Lint</a> tool on your layout files to search for possible view hierarchy optimizations. Lint has replaced the Layoutopt tool and has much greater functionality. Some examples of Lint <a +href="http://tools.android.com/tips/lint-checks">rules</a> are:</p> + +<ul> +<li>Use compound drawables - A {@link android.widget.LinearLayout} which contains an {@link android.widget.ImageView} and a {@link android.widget.TextView} can be more efficiently handled as a compound drawable.</li> +<li>Merge root frame - If a {@link android.widget.FrameLayout} is the root of a layout and does not provide background or padding etc, it can be replaced with a merge tag which is slightly more efficient.</li> +<li>Useless leaf - A layout that has no children or no background can often be removed (since it is invisible) for a flatter and more efficient layout hierarchy.</li> +<li>Useless parent - A layout with children that has no siblings, is not a {@link android.widget.ScrollView} or a root layout, and does not have a background, can be removed and have its children moved directly into the parent for a flatter and more efficient layout hierarchy.</li> +<li>Deep layouts - Layouts with too much nesting are bad for performance. Consider using flatter layouts such as {@link android.widget.RelativeLayout} or {@link android.widget.GridLayout} to improve performance. The default maximum depth is 10.</li> +</ul> + +<p>Another benefit of Lint is that it is integrated into the Android Development Tools for Eclipse (ADT 16+). Lint automatically runs whenever you export an APK, edit and save an XML file or use the Layout Editor. To manually force Lint to run press the Lint button in the Eclipse toolbar.</p> + +<img src="{@docRoot}images/training/lint_icon.png" alt="" /> + +<p>When used inside Eclipse, Lint has the ability to automatically fix some issues, provide suggestions for others and jump directly to the offending code for review. If you don’t use Eclipse for your development, Lint can also be run from the command line. More information about Lint is available at <a href="http://tools.android.com/tips/lint">tools.android.com</a>.</p> + + -<p>It is always good practice to also run the <a -href="{@docRoot}guide/developing/tools/layoutopt.html">layoutopt</a> tool on your final layout files -to search for places in your view hierarchy that may be optimized. Layoutopt is also in your SDK -{@code tools/} directory and takes a layout directory name or a space-separated list of layout files -that you'd like to inspect.</p> -<p>When you run {@code layoutopt} on a layout file, it prints a line number for each issue found, a -description of the issue, and for some types of issues it also suggests a resolution. For -example:</p> -<pre class="no-pretty-print classic"> -$ layoutopt samples/ -samples/compound.xml - 7:23 The root-level <FrameLayout/> can be replaced with <merge/> - 11:21 This LinearLayout layout or its FrameLayout parent is useless -samples/simple.xml - 7:7 The root-level <FrameLayout/> can be replaced with <merge/> -</pre> -<p>After you apply the suggested layout optimizations, run Hierarchy Viewer again to inspect the -performance changes.</p> |