From 692249286b358d5d1755e26a020fdabdad3c19eb Mon Sep 17 00:00:00 2001 From: Scott Main Date: Fri, 26 Aug 2011 11:50:36 -0700 Subject: [PATCH] docs: update device doc with missing changes from hc mr2 Change-Id: I655897d8a7780e4ecf400d5dc9156539133b542e --- docs/html/guide/developing/device.jd | 194 +++++++++++++++++++-------- 1 file changed, 139 insertions(+), 55 deletions(-) diff --git a/docs/html/guide/developing/device.jd b/docs/html/guide/developing/device.jd index bde170e09c055..309d9cbc09d19 100644 --- a/docs/html/guide/developing/device.jd +++ b/docs/html/guide/developing/device.jd @@ -41,7 +41,8 @@ Dev Phone, see the Android MarketNote: When developing on a device, keep in mind that you should still use the Android emulator to test your application +href="{@docRoot}guide/developing/devices/emulator.html">Android emulator to test your +application on configurations that are not equivalent to those of your real device. Although the emulator does not allow you to test every device feature (such as the accelerometer), it does allow you to verify that your application functions properly on different versions of the Android @@ -56,14 +57,22 @@ would on the emulator. Before you can start, there are just a few things to do:<
  1. Declare your application as "debuggable" in your Android Manifest.

    In Eclipse, you can do this from the Application tab when viewing the Manifest - (on the right side, set Debuggable to true). Otherwise, in the AndroidManifest.xml - file, add android:debuggable="true" to the <application> element.

    + (on the right side, set Debuggable to true). Otherwise, in the +AndroidManifest.xml + file, add android:debuggable="true" to the <application> +element.

    +
  2. +
  3. Set up your device to allow installation of non-Market applications.

    On +the device, go to Settings > Applications and enable + +Unknown sources.

    +
  4. Turn on "USB Debugging" on your device. -

    On the device, go to the home screen, press MENU, select Applications > Development, - then enable USB debugging.

    +

    On the device, go to Settings > Applications > Development + and enable USB debugging.

  5. -
  6. Setup your system to detect your device. +
  7. Set up your system to detect your device.
    • 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, @@ -71,27 +80,38 @@ would on the emulator. Before you can start, there are just a few things to do:< Driver. Otherwise, you can find a link to the appropriate OEM driver in the OEM USB Drivers document.
    • If you're developing on Mac OS X, it just works. Skip this step.
    • -
    • If you're developing on Ubuntu Linux, you need to add a rules file -that contains a USB configuration for each type of device you want to use for -development. Each device manufacturer uses a different vendor ID. The -example rules files below show how to add an entry for a single vendor ID -(the HTC vendor ID). In order to support more devices, you will need additional -lines of the same format that provide a different value for the -SYSFS{idVendor} property. For other IDs, see the table of USB Vendor IDs, below. -
        -
      1. Log in as root and create this file: - /etc/udev/rules.d/51-android.rules. -

        For Gusty/Hardy, edit the file to read:
        - SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", - MODE="0666"

        + +
      2. If you're developing on Ubuntu Linux, you need to add a +udev +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 +is identified by a unique vendor ID, as specified by the +ATTR{idVendor} property. For a list of vendor IDs, see USB Vendor IDs, below. To set up device detection on +Ubuntu Linux: -

        For Dapper, edit the file to read:
        - SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", - MODE="0666"

        +
          +
        1. Log in as root and create this file: + /etc/udev/rules.d/51-android.rules. +

          Use this format to add each vendor to the file:
          + SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", +MODE="0666", GROUP="plugdev" +

          + + In this example, the vendor ID is for HTC. The MODE +assignment specifies read/write permissions, and GROUP defines +which Unix group owns the device node.

          + +

          Note: The rule syntax +may vary slightly depending on your environment. Consult the udev +documentation for your system as needed. For an overview of rule syntax, see +this guide to writing udev +rules.

        2. Now execute:
          - chmod a+r /etc/udev/rules.d/51-android.rules + chmod a+r /etc/udev/rules.d/51-android.rules
      3. @@ -99,79 +119,143 @@ href="#VendorIds">USB Vendor IDs, below.
      -

      You can verify that your device is connected by executing adb devices from your -SDK {@code platform-tools/} directory. If connected, you'll see the device name listed as a -"device."

      +

      You can verify that your device is connected by executing adb +devices from your SDK {@code platform-tools/} directory. If connected, +you'll see the device name listed as a "device."

      -

      If using Eclipse, run or debug as usual. You will be presented -with a Device Chooser dialog that lists the available emulator(s) and connected device(s). -Select the device upon which you want to install and run the application.

      - -

      If using the Android Debug Bridge (adb), -you can issue commands with the -d flag to target your -connected device.

      +

      If using Eclipse, run or debug your application as usual. You will be +presented with a Device Chooser dialog that lists the available +emulator(s) and connected device(s). Select the device upon which you want to +install and run the application.

      +

      If using the Android +Debug Bridge (adb), you can issue commands with the -d flag to +target your connected device.

      USB Vendor IDs

      -

      This table provides a reference to the vendor IDs needed in order to add -USB device support on Linux. The USB Vendor ID is the value given to the -SYSFS{idVendor} property in the rules file, as described in step 3, above.

      + +

      This table provides a reference to the vendor IDs needed in order to add USB +device support on Linux. The USB Vendor ID is the value given to the +ATTR{idVendor} property in the rules file, as described +above.

      - + + + + + + - + + - + + - + + - + + - + + - + + - + + + + + + - + + - + + - + + - + + + + + + + + + + - + + + + + + - + + + + + + + + + + + + + + + + + + + + + + - + + - + + - + + + + + + - + +
      CompanyUSB Vendor ID
      Acer0502
      0502
      ASUS0b05
      Dell413c
      413c
      Foxconn0489
      0489
      Garmin-Asus091E
      091E
      Google18d1
      18d1
      HTC0bb4
      0bb4
      Huawei12d1
      12d1
      K-Touch24e3
      24e3
      KT Tech2116
      Kyocera0482
      0482
      Lenevo17EF
      17EF
      LG1004
      1004
      Motorola22b8
      22b8
      NEC0409
      Nook2080
      Nvidia0955
      0955
      OTGV2257
      Pantech10A9
      10A9
      Pegatron0x1D4D
      Philips0471
      PMC-Sierra04da
      Qualcomm05c6
      SK Telesys1f53
      Samsung04e8
      04e8
      Sharp04dd
      04dd
      Sony Ericsson0fce
      0fce
      Toshiba0930
      ZTE19D2
      19D2