| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | page.title=Developing on a Device |
| 2 | @jd:body |
| 3 | |
| 4 | <div id="qv-wrapper"> |
| 5 | <div id="qv"> |
| 6 | <h2>In this document</h2> |
| 7 | <ol> |
| 8 | <li><a href="#devices">Available Devices</a> |
| 9 | <ol> |
| 10 | <li><a href="#g1">T-Mobile G1</a></li> |
| 11 | <li><a href="#dev-phone-1">Android Dev Phone 1</a></li> |
| 12 | </ol> |
| 13 | </li> |
| 14 | <li><a href="#setting-up">Setting up a Device for Development</a></li> |
| 15 | </ol> |
| 16 | </div> |
| 17 | </div> |
| 18 | |
| 19 | <p>When building mobile applications, it's vital to test them on real |
| 20 | devices prior to releasing them to users. This page covers what you need to know, |
| 21 | including the types of devices that you can use, and how to set one up for |
| 22 | developing and debugging.</p> |
| 23 | |
| 24 | |
| 25 | <h2 id="devices">Available Devices</h2> |
| 26 | <p>While developers can use regular |
| 27 | consumer devices purchased at retail to test and use their apps, some developers |
| 28 | may choose not to use a retail device, preferring an unlocked or no-contract |
| 29 | device. Here are some options for obtaining devices capable of testing your applications.</p> |
| 30 | |
| 31 | |
| 32 | <h3 id="g1">T-Mobile G1</h3> |
| 33 | |
| 34 | <p>The T-Mobile G1 device makes an excellent development device. You can write |
| 35 | applications in the SDK and install them on the G1, then run them as users |
| 36 | would, using the same hardware, system, and network.</p> |
| 37 | |
| 38 | <p>For more information about obtaining a G1, visit the <a |
| 39 | href="http://www.t-mobileg1.com">T-Mobile G1 site</a>. </p> |
| 40 | |
| 41 | |
| 42 | <h3 id="dev-phone-1">Android Dev Phone 1</h3> |
| 43 | |
| 44 | <div class="sidebox-wrapper"> |
| 45 | <div class="sidebox-inner"> |
| 46 | <p>Selected specs for Android Dev Phone 1:</p> |
| 47 | <ul> |
| 48 | <li>Touch screen</li> |
| 49 | <li>Trackball</li> |
| 50 | <li>3.2 megapixel camera with autofocus</li> |
| 51 | <li>Wi-Fi</li> |
| 52 | <li>GPS-enabled</li> |
| 53 | <li>Bluetooth v2.0 |
| 54 | <ul><li>Handsfree profile v1.5</li> |
| 55 | <li>Headset profile v1.0</li></ul></li> |
| 56 | <li>3G WCDMA (1700/2100 MHz)</li> |
| 57 | <li>Quad-band GSM (850/900/1800/1900 MHz)</li> |
| 58 | <li>QWERTY slider keyboard</li> |
| 59 | <li>Includes 1GB MicroSD card (can be replaced with up to 16GB card)</li> |
| 60 | </ul> |
| 61 | </div> |
| 62 | </div> |
| 63 | <p>The Android Dev Phone 1 is a SIM-unlocked and hardware-unlocked device that |
| 64 | is designed for advanced developers. The device ships with a system image that |
| 65 | is fully compatible with Android 1.0, so you can rely on it when developing your |
| 66 | applications. You can use any SIM in the device and can flash custom Android |
| 67 | builds that will work with the unlocked bootloader. Unlike the bootloader on |
| 68 | retail devices, the bootloader on the Android Dev Phone 1 does not enforce |
| 69 | signed system images. The Android Dev Phone 1 should also appeal to developers |
| 70 | who live outside of T-Mobile geographies. </p> |
| 71 | |
| 72 | <p>To purchase an Android Dev Phone 1 device, you must first register as an |
| 73 | Android developer on the Android Market site, if you haven't done so already. |
| 74 | Once you've logged into your developer account on Android Market, you can |
| 75 | purchase the device by following the link to "Development phones." To accommodate demand, |
| 76 | there is a limit of 1 device per developer account, for now.</p> |
| 77 | |
| 78 | <p>The device currently costs $399 (USD) (including free shipping in the US), |
| 79 | and is available for purchase in 18 international markets, including the |
| 80 | US, UK, Germany, Japan, India, Canada, France, Taiwan, Spain, Australia, |
| 81 | Singapore, Switzerland, Netherlands, Austria, Sweden, Finland, Poland, and |
| 82 | Hungary. We will continue to expand this program into new geographies over |
| 83 | time. Check this page for updated information.</p> |
| 84 | |
| 85 | <p>Note that Android Dev Phone 1 devices are <em>not</em> intended for |
| 86 | non-developer end-users. Because the device can be configured with system |
| 87 | software not provided by or supported by Google or any other company, end-users |
| 88 | operate these devices at their own risk.</p> |
| 89 | |
| 90 | <p>For full device specs and more information about obtaining an Android Dev |
| 91 | Phone 1 device, see the <a href="http://market.android.com/publish">Android |
| 92 | Market</a> site.</p> |
| 93 | |
| 94 | |
| 95 | <h2 id="setting-up">Setting up a Device for Development</h2> |
| 96 | |
| 97 | <p>With a T-mobile G1 or Android Dev Phone 1, you can develop and debug your Android applications just as you |
| 98 | would on the emulator. There are just a few things to do before you can start.</p> |
| 99 | <ol> |
| 100 | <li>Declare your application as "debuggable" in your Android Manifest. |
| 101 | <p>In Eclipse, you can do this from the <b>Application</b> tab when viewing the Manifest |
| 102 | (on the right side, set <b>Debuggable</b> to <em>true</em>). Otherwise, in the <code>AndroidManifest.xml</code> |
| 103 | |
| 104 | file, add <code>android:debuggable="true"</code> to the <code><application></code> element.</p> |
| 105 | </li> |
| 106 | <li>Turn on "USB Debugging" on your device. |
| 107 | <p>On the device, go to the home screen, press <b>MENU</b>, select <b>Applications</b> > <b>Development</b>, |
| 108 | then enable <b>USB debugging</b>.</p> |
| 109 | |
| 110 | </li> |
| 111 | <li>Setup your system to detect your device. |
| 112 | <ul> |
| 113 | <li>If you're developing on 32-bit Windows, you need to install the 32-bit USB driver for adb. |
| 114 | The USB driver is included in the SDK package. To install it, follow these steps:</p> |
| 115 | <ol> |
| 116 | <li>Connect your Android device via USB. When the <em>Found New Hardware Wizard</em> appears, |
| 117 | you'll be asked if you'd like Windows Update to search for software. Select <em>No, not this |
| 118 | time</em> and click <b>Next</b>.</li> |
| 119 | |
| 120 | <li>Select <em>Install from a list or specified location</em> and click <b>Next</b>.</li> |
| 121 | <li>Select <em>Search for the best driver in these locations</em>. Browse to the <code>usb_driver/x86</code> in the SDK package (<code><sdk>\usb_driver\x86</code>).</li> |
| 122 | <li>Click <b>Finish</b>. The system should install the driver files as necessary. Your machine may require a reboot.</li> |
| 123 | </ol> |
| 124 | </li> |
| 125 | <li>If you're developing on 64-bit Windows Vista, you need to install the 64-bit USB driver for adb. |
| 126 | The USB driver is included in the SDK package. To install it, follow these steps:</p> |
| 127 | <ol> |
| 128 | <li>Connect your Android device via USB. When the <em>Found New Hardware Wizard</em> appears, |
| 129 | you'll be asked if you'd like Windows Update to search for software. Select <em>No, not this |
| 130 | time</em> and click <b>Next</b>.</li> |
| 131 | |
| 132 | <li>Select <em>Install from a list or specified location</em> and click <b>Next</b>.</li> |
| 133 | <li>Select <em>Search for the best driver in these locations</em>. Browse to the <code>usb_driver/amd64</code> in the SDK package (<code><sdk>\usb_driver\amd64</code>).</li> |
| 134 | <li>Click <b>Finish</b>. The system should install the driver files as necessary. Your machine may require a reboot.</li> |
| 135 | </ol> |
| 136 | </li> |
| 137 | <li>If you're developing on Mac OS X, it just works. Skip this step.</li> |
| 138 | <li>If you're developing on Ubuntu Linux, you need to add a rules file: |
| 139 | <ol> |
| Dirk Dougherty | fa03b80 | 2009-06-23 11:35:31 -0700 | [diff] [blame] | 140 | <li>Login as root and create this file: <code>/etc/udev/rules.d/51-android.rules</code>. |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 141 | <p>For Gusty/Hardy, edit the file to read: <br/> |
| 142 | <code>SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"</code></p> |
| 143 | |
| 144 | <p>For Dapper, edit the file to read: <br/> |
| 145 | <code>SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"</code></p> |
| 146 | </li> |
| 147 | <li>Now execute:<br/> |
| 148 | <code>chmod a+rx /etc/udev/rules.d/50-android.rules</code> |
| 149 | </li> |
| 150 | </ol> |
| 151 | |
| 152 | </li> |
| 153 | </ul> |
| 154 | </li> |
| 155 | </ol> |
| 156 | <p>You can verify that your device is connected by executing <code>adb devices</code> from your |
| 157 | SDK tools/ directory. If connected, you'll see the device name listed as a "device."</p> |
| 158 | <p>If using Eclipse, select run or debug as usual. You will be presented |
| 159 | with a <b>Device Chooser</b> dialog that lists the available emulator(s) and connected device(s). |
| 160 | Select the device to install and run the application there.</p> |
| 161 | |
| 162 | <p>If using the <a href="{@docRoot}guide/developing/tools/adb.html">Android Debug Bridge</a> (adb), |
| 163 | you can issue commands with the <code>-d</code> flag to target your connected device.</p> |