1 page.title=Eclipse ADT 2 @jd:body 3 4 <div id="qv-wrapper"> 5 <div id="qv"> 6 <h2></h2> 7 <ol> 8 <li><a href="#CreatingAProject">Android </a></li> 9 <li><a href="#Running"></a> 10 <ol> 11 <li><a href="#CreatingAnAvd">AVD </a></li> 12 <li><a href="#RunningAnApplication"></a></li> 13 </ol> 14 </li> 15 <li><a href="#RunConfig"></a></li> 16 <li><a href="#Signing"></a></li> 17 <li><a href="#Tips">Eclipse </a></li> 18 </div> 19 </div> 20 21 22 <p>Android Development Tools (ADT) plugin for EclipseEclipse Android Eclipse ADT Android :</p> 23 24 <ul> 25 <li>Eclipse Android ADT DDMS Eclipse </li> 26 <li>Android Android </li> 27 <li>Android </li> 28 <li> Android Android XML </li> 29 <li> APK </li> 30 </ul> 31 32 <p>ADT Eclipse Android Eclipse ADT <a href="{@docRoot}sdk/eclipse-adt.html#installing">Eclipse ADT </a></p> 33 <p> 0.9 ADT <a href="{@docRoot}sdk/eclipse-adt.html#updating">Eclipse ADT </a></p> 34 <p class="note"><strong>:</strong> ADT SDK </p> 35 36 37 <h2 id="CreatingAProject">Android </h2> 38 39 <p>ADT Android : </p> 40 41 <ol> 42 <li>[<strong>File</strong>] > [<strong>New</strong>] > [<strong>Project</strong>] </li> 43 <li>[<strong>Android</strong>] > [<strong>Android Android Project</strong>] [<strong>Next</strong>] </li> 44 <li>: 45 <ul> 46 <li><em></em></li> <li>[Contents] [<strong>Create new project in workspace</strong>] </li> 47 <li>[Target] [ Build Target] Android Android 48 <p> SDK API Android 1.1 (Target Name) </p> 49 <p class="note"><strong>:</strong> [ Package Explorer] [<strong>Properties</strong>] [<strong>Android</strong>] </p> 50 </li> 51 <li>[Properties] 52 <ul> 53 <li> (Application name) <em></em> Android </li> 54 <li> (Package name) <em></em>Java </li> 55 <li>[Activity Create Activity] Activity <em></em></li> 56 <li>[SDK Min SDK Version] <em></em> API <code>minSdkVersion</code> Android <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a> API Build Target API (API Level)</li> 57 </ul> 58 </li> 59 </ul> 60 </li> 61 <li>[<strong>Finish</strong>] </li> 62 </ol> 63 64 <p class="note"><strong>:</strong> [New] <em></em></p> 65 66 <p> ADT :</p> 67 <dl> 68 <dt><code>src/</code></dt> 69 <dd> Activity Java Java </dd> 70 <dt><code><em><Android Version></em>/</code>: <code>Android 1.1/</code></dt> 71 <dd> <code>android.jar</code> <em></em></dd> 72 <dt><code>gen/</code></dt> 73 <dd>ADT Java <code>R.java</code> AIDL </dd> 74 <dt><code>assets/</code></dt> 75 <dd> <a href="{@docRoot}guide/topics/resources/index.html">Resources and Assets</a></dd> 76 <dt><code>res/</code></dt> 77 <dd> <a href="{@docRoot}guide/topics/resources/index.html">Resources and Assets</a></dd> 78 <dt><code>AndroidManifest.xml</code></dt> 79 <dd> Android <a href="{@docRoot}guide/topics/manifest/manifest-intro.html">The AndroidManifest.xml File</a></dd> 80 <dt><code>default.properties</code></dt> 81 <dd> [Properties] </dd> 82 </dl> 83 84 85 <h2 id="Running"></h2> 86 87 <p><em></em> Android Android AVD<strong></strong>AVD Android <a href="{@docRoot}guide/developing/tools/avd.html">Android </a> AVD </p> 88 89 <p>AVD <a href="{@docRoot}guide/developing/device.html">Developing On a Device</a> </p> 90 91 <h3 id="CreatingAnAvd">AVD </h3> 92 93 <p>AVD :</p> 94 95 <ol> 96 <li> Windows Mac/Linux SDK <code>tools/</code> </li> 97 <li>: 98 <pre>android list targets</pre> 99 <p> Android :</p> 100 <pre> 101 id:1 102 Name: Android 1.1 103 Type: platform 104 API level: 2 105 Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P 106 id:2 107 Name: Android 1.5 108 Type: platform 109 API level: 3 110 Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P 111 </pre> 112 <p> Android <code>id</code> </p> 113 </li> 114 <li> AVD : 115 <pre>android create avd --name <em><your_avd_name></em> --target <em><targetID></em></pre> 116 <li> yesEnter no</li> 117 </li> 118 </ol> 119 120 <p> AVD AVD </p> 121 122 <p>AVD <a href="{@docRoot}guide/developing/tools/avd.html">Android </a> </p> 123 124 125 <h3 id="RunningYourApplication"></h3> 126 127 <p class="note"><strong>:</strong> AVD AVD </p> 128 129 <p>Eclipse [<strong>Run</strong>] > [<strong>Run</strong>] [<strong>Run</strong>] > [<strong>Debug</strong>]ADT </p> 130 131 <p>Eclipse :</p> 132 133 <ol> 134 <li></li> 135 <li></li> 136 <li> 137 <p>Android <a href="#AutoAndManualTargetModes"> </a></p> 138 </li> 139 </ol> 140 141 <p>Eclipse </p> 142 143 <p><a href="#launchconfig"></a></p> 144 145 146 <h2 id="RunConfig"></h2> 147 148 <p> Activity Android ADT <em></em> AVD </p> 149 150 <p> Eclipse :</p> 151 152 <ol> 153 <li> 154 <ul> 155 <li>Eclipse 3.3Europa[<strong>Run</strong>] > [<strong>Open Run Dialog</strong>] [<strong> Open Debug Dialog</strong>] 156 </li> 157 <li>Eclipse 3.4Ganymede[<strong>Run</strong>] > [<strong>Run Configurations</strong>] [<strong>Debug Configurations</strong>] 158 </li> 159 </ul> 160 </li> 161 <li>[<strong>Android Android Application</strong>] 162 <ul> 163 <li>: 164 <ol> 165 <li>[<strong>Android Android Application</strong>] <em></em> New launch configuration [<strong>Android Android Application</strong>] [<strong>New</strong>] </li> 166 <li></li> 167 <li>[Android] </li> 168 </ol> 169 <li>[<strong>Android Android Application</strong>] </li> 170 </ul> 171 </li> 172 <li> 173 <p>[Target] AVD ManualAutomatic<a href=#AutoAndManualModes"> </a></p> 174 </li> 175 </ol> 176 177 178 <h3 id="AutoAndManualTargetModes"> </h3> 179 180 <p><strong></strong> AVD ADT AVD :</p> 181 182 <ol> 183 <li> AVD </li> 184 <li> Device Chooser</li> 185 <li> ADT AVD AVD AVD </li> 186 <li> AVD </li> 187 </ol> 188 189 <p> AVD AVD <em></em> AVD </p> 190 <p><strong></strong>Device Chooser AVD </p> 191 192 <h2 id="Signing"></h2> 193 194 <p>Android Android Android 2 </p> 195 <p>ADT .apk Eclipse Keytool ADT SDK <strong></strong></p> 196 <p><a href="{@docRoot}guide/publishing/app-signing.html"></a>Android Android ADT </p> 197 198 <h2 id="Tips">Eclipse </h2> 199 200 <h3 id="arbitraryexpressions">Eclipse Java </h3> 201 202 <p>Eclipse zip <code>android.os.Debug.startMethodTracing()</code> dmTrace </p><p> [<strong>Window</strong>] > [<strong>Show View</strong>] > [<strong>Display</strong>] [Display] 'J' Ctrl+Shift+D 1 Object.wait() </p><p> Ctrl+Shift+D </p><p>Alt+Shift+ </p><p>Eclipse [Display] </p> 203 204 <table width="100%" border="1"> 205 <tr> 206 <th scope="col"></th> 207 <th scope="col"></th> 208 </tr> 209 <tr> 210 <td><code>zip</code></td> 211 <td><code>(java.lang.String) 212 /work/device/out/linux-x86-debug/android/app/android_sdk.zip</code></td> 213 </tr> 214 <tr> 215 <td><code>zip.endsWith(".zip")</code></td> 216 <td><code>(boolean) true</code></td> 217 </tr> 218 <tr> 219 <td><code>zip.endsWith(".jar")</code></td> 220 <td><code>(boolean) false</code></td> 221 </tr> 222 </table> 223 <p> Eclipse </p> 224 225 <h3>DDMS </h3> 226 227 <p>ADT DDMS 8700 Eclipse <strong>:</strong> <a href="{@docRoot}guide/developing/tools/ddms.html">DDMS</a> </p> 228 229 <!-- TODO: clean this up and expand it to cover more wizards and features 230 <h3>ADT Wizards</h3> 231 232 <p>Notice that the "New Android Project" wizard has been expanded to use the multi-platform 233 capabilities of the new SDK.</p> 234 235 <p>There is now a "New XML File" wizard that lets you create skeleton XML resource 236 files for your Android projects. This makes it easier to create a new layout, a new menu, a 237 new strings file, etc.</p> 238 239 <p>Both wizards are available via <strong>File > New</strong> and new icons in the main 240 Eclipse toolbar (located to the left of the Debug and Run icons). 241 If you do not see the new icons, you may need to select <strong>Window > Reset 242 Perspective</strong> from the Java perspective.</p> 243 --> 244