Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 1 | page.title=MonkeyDevice |
| 2 | parent.title=monkeyrunner |
| 3 | parent.link=index.html |
| 4 | @jd:body |
| 5 | <style> |
| 6 | h4.jd-details-title {background-color: #DEE8F1;} |
| 7 | </style> |
| 8 | <p> |
| 9 | A monkeyrunner class that represents a device or emulator accessible by the workstation running |
| 10 | <code><a href="{@docRoot}tools/help/monkeyrunner_concepts.html">monkeyrunner</a></code>. |
| 11 | </p> |
| 12 | <p> |
| 13 | This class is used to control an Android device or emulator. The methods send UI events, |
| 14 | retrieve information, install and remove applications, and run applications. |
| 15 | </p> |
| 16 | <p> |
| 17 | You normally do not have to create an instance of <code>MonkeyDevice</code>. Instead, you |
| 18 | use |
| 19 | <code><a href="{@docRoot}tools/help/MonkeyRunner.html#waitForConnection"> |
| 20 | MonkeyRunner.waitForConnection()</a></code> to create a new object from a connection to a device or |
| 21 | emulator. For example, instead of |
| 22 | using:</p> |
| 23 | <pre> |
| 24 | newdevice = MonkeyDevice() |
| 25 | </pre> |
| 26 | <p> |
| 27 | you would use: |
| 28 | </p> |
| 29 | <pre> |
| 30 | newdevice = MonkeyRunner.waitForConnection() |
| 31 | </pre> |
| 32 | <h2>Summary</h2> |
| 33 | <table id="constants" class="jd-sumtable" style="background-color: white;"> |
| 34 | <tr> |
| 35 | <th colspan="12" style="background-color: #E2E2E2">Constants</th> |
| 36 | </tr> |
| 37 | <tr class="api" style="background-color: white;"> |
| 38 | <td class="jd-typecol"><em>string</em></td> |
| 39 | <td class="jd-linkcol"><a href="#ACTION_DOWN">DOWN</a></td> |
| 40 | <td class="jd-descrcol" width="100%"> |
| 41 | Use this with the <code>type</code> argument of |
| 42 | <code><a href="#press">press()</a></code> or <code><a href="#touch">touch()</a> |
| 43 | </code> |
| 44 | to send a DOWN event. |
| 45 | </td> |
| 46 | </tr> |
| 47 | <tr class="api" style="background-color: white;"> |
| 48 | <td class="jd-typecol"><em>string</em></td> |
| 49 | <td class="jd-linkcol"><a href="#ACTION_UP">UP</a></td> |
| 50 | <td class="jd-descrcol" width="100%"> |
| 51 | Use this with the <code>type</code> argument of |
| 52 | <code><a href="#press">press()</a></code> or <code><a href="#touch">touch()</a> |
| 53 | </code> |
| 54 | to send an UP event. |
| 55 | </td> |
| 56 | </tr> |
| 57 | <tr class="api" style="background-color: white;"> |
| 58 | <td class="jd-typecol"><em>string</em></td> |
| 59 | <td class="jd-linkcol"><a href="#ACTION_DOWN_AND_UP">DOWN_AND_UP</a></td> |
| 60 | <td class="jd-descrcol" width="100%"> |
| 61 | Use this with the <code>type</code> argument of |
| 62 | <code><a href="#press">press()</a></code> or <code><a href="#touch">touch()</a> |
| 63 | </code> |
| 64 | to send a DOWN event immediately followed by an UP event. |
| 65 | </td> |
| 66 | </tr> |
| 67 | </table> |
| 68 | <table id="pubmethods" class="jd-sumtable"> |
| 69 | <tr> |
| 70 | <th colspan="12" style="background-color: #E2E2E2">Methods</th> |
| 71 | </tr> |
| 72 | <tr class="api" > |
| 73 | <td class="jd-typecol"> |
| 74 | <nobr> |
| 75 | void |
| 76 | </nobr> |
| 77 | </td> |
| 78 | <td class="jd-linkcol" width="100%"> |
| 79 | <nobr> |
| 80 | <span class="sympad"> |
| 81 | <a href="#broadcastIntent">broadcastIntent</a> |
| 82 | </span> |
| 83 | (<em>string</em> uri, |
| 84 | <em>string</em> action, |
| 85 | <em>string</em> data, |
| 86 | <em>string</em> mimetype, |
| 87 | <em>iterable</em> categories |
| 88 | <em>dictionary</em> extras, |
| 89 | <em>component</em> component, |
| 90 | <em>iterable</em> flags) |
| 91 | </nobr> |
| 92 | <div class="jd-descrdiv"> |
| 93 | Broadcasts an Intent to this device, as if the Intent were coming from an |
| 94 | application. |
| 95 | </div> |
| 96 | </td> |
| 97 | </tr> |
| 98 | <tr class="api" > |
| 99 | <td class="jd-typecol"> |
| 100 | <nobr> |
| 101 | void |
| 102 | </nobr> |
| 103 | </td> |
| 104 | <td class="jd-linkcol" width="100%"> |
| 105 | <nobr> |
| 106 | <span class="sympad"> |
| 107 | <a href="#drag">drag</a> |
| 108 | </span> |
| 109 | (<em>tuple</em> start, |
| 110 | <em>tuple</em> end, |
| 111 | <em>float</em> duration, |
| 112 | <em>integer</em> steps) |
| 113 | </nobr> |
| 114 | <div class="jd-descrdiv"> |
| 115 | Simulates a drag gesture (touch, hold, and move) on this device's screen. |
| 116 | </div> |
| 117 | </td> |
| 118 | </tr> |
| 119 | <tr class="api" > |
| 120 | <td class="jd-typecol"> |
| 121 | <nobr> |
| 122 | <em>object</em> |
| 123 | </nobr> |
| 124 | </td> |
| 125 | <td class="jd-linkcol" width="100%"> |
| 126 | <nobr> |
| 127 | <span class="sympad"> |
| 128 | <a href="#getProperty">getProperty</a> |
| 129 | </span> |
| 130 | (<em>string</em> key) |
| 131 | </nobr> |
| 132 | <div class="jd-descrdiv"> |
| 133 | Given the name of a system environment variable, returns its value for this device. |
| 134 | The available variable names are listed in the <a href="#getProperty"> |
| 135 | detailed description</a> of this method. |
| 136 | </div> |
| 137 | </td> |
| 138 | </tr> |
| 139 | <tr class="api" > |
| 140 | <td class="jd-typecol"> |
| 141 | <nobr> |
| 142 | <em>object</em> |
| 143 | </nobr> |
| 144 | </td> |
| 145 | <td class="jd-linkcol" width="100%"> |
| 146 | <nobr> |
| 147 | <span class="sympad"> |
| 148 | <a href="#getSystemProperty">getSystemProperty</a> |
| 149 | </span> |
| 150 | (<em>string</em> key) |
| 151 | </nobr> |
| 152 | <div class="jd-descrdiv"> |
| 153 | . The API equivalent of <code>adb shell getprop <key>. This is provided for use |
| 154 | by platform developers. |
| 155 | </div> |
| 156 | </td> |
| 157 | </tr> |
| 158 | <tr class="api" > |
| 159 | <td class="jd-typecol"> |
| 160 | <nobr> |
| 161 | void |
| 162 | </nobr> |
| 163 | </td> |
| 164 | <td class="jd-linkcol" width="100%"> |
| 165 | <nobr> |
| 166 | <span class="sympad"> |
| 167 | <a href="#installPackage">installPackage</a> |
| 168 | </span> |
| 169 | (<em>string</em> path) |
| 170 | </nobr> |
| 171 | <div class="jd-descrdiv"> |
| 172 | Installs the Android application or test package contained in packageFile onto this |
| 173 | device. If the application or test package is already installed, it is replaced. |
| 174 | </div> |
| 175 | </td> |
| 176 | </tr> |
| 177 | <tr class="api" > |
| 178 | <td class="jd-typecol"> |
| 179 | <nobr> |
| 180 | <em>dictionary</em> |
| 181 | </nobr> |
| 182 | </td> |
| 183 | <td class="jd-linkcol" width="100%"> |
| 184 | <nobr> |
| 185 | <span class="sympad"> |
| 186 | <a href="#instrument">instrument</a> |
| 187 | </span> |
| 188 | (<em>string</em> className, |
| 189 | <em>dictionary</em> args) |
| 190 | </nobr> |
| 191 | <div class="jd-descrdiv"> |
| 192 | Runs the specified component under Android instrumentation, and returns the results |
| 193 | in a dictionary whose exact format is dictated by the component being run. The |
| 194 | component must already be present on this device. |
| 195 | </div> |
| 196 | </td> |
| 197 | </tr> |
| 198 | <tr class="api"> |
| 199 | <td class="jd-typecol"> |
| 200 | <nobr> |
| 201 | void |
| 202 | </nobr> |
| 203 | </td> |
| 204 | <td class="jd-linkcol" width="100%"> |
| 205 | <nobr> |
| 206 | <span class="sympad"> |
| 207 | <a href="#press">press</a> |
| 208 | </span> |
| 209 | (<em>string</em> name, |
| 210 | <em>dictionary</em> type) |
| 211 | </nobr> |
| 212 | <div class="jd-descrdiv"> |
| 213 | Sends the key event specified by type to the key specified by |
| 214 | keycode. |
| 215 | </div> |
| 216 | </td> |
| 217 | </tr> |
| 218 | <tr class="api" > |
| 219 | <td class="jd-typecol"> |
| 220 | <nobr> |
| 221 | void |
| 222 | </nobr> |
| 223 | </td> |
| 224 | <td class="jd-linkcol" width="100%"> |
| 225 | <nobr> |
| 226 | <span class="sympad"> |
| 227 | <a href="#reboot">reboot</a> |
| 228 | </span> |
| 229 | (<em>string</em> into) |
| 230 | </nobr> |
| 231 | <div class="jd-descrdiv"> |
| 232 | Reboots this device into the bootloader specified by bootloadType. |
| 233 | </div> |
| 234 | </td> |
| 235 | </tr> |
| 236 | <tr class="api" > |
| 237 | <td class="jd-typecol"> |
| 238 | <nobr> |
| 239 | void |
| 240 | </nobr> |
| 241 | </td> |
| 242 | <td class="jd-linkcol" width="100%"> |
| 243 | <nobr> |
| 244 | <span class="sympad"> |
| 245 | <a href="#removePackage">removePackage</a> |
| 246 | </span> |
| 247 | (<em>string</em> package) |
| 248 | </nobr> |
| 249 | <div class="jd-descrdiv"> |
| 250 | Deletes the specified package from this device, including its data and cache. |
| 251 | </div> |
| 252 | </td> |
| 253 | </tr> |
| 254 | <tr class="api" > |
| 255 | <td class="jd-typecol"> |
| 256 | <nobr> |
| 257 | <em>object</em> |
| 258 | </nobr> |
| 259 | </td> |
| 260 | <td class="jd-linkcol" width="100%"> |
| 261 | <nobr> |
| 262 | <span class="sympad"> |
| 263 | <a href="#shell">shell</a> |
| 264 | </span> |
| 265 | (<em>string</em> cmd) |
| 266 | </nobr> |
| 267 | <div class="jd-descrdiv"> |
| 268 | Executes an <code>adb</code> shell command and returns the result, if any. |
| 269 | </div> |
| 270 | </td> |
| 271 | </tr> |
| 272 | <tr class="api" > |
| 273 | <td class="jd-typecol"> |
| 274 | <nobr> |
| 275 | void |
| 276 | </nobr> |
| 277 | </td> |
| 278 | <td class="jd-linkcol" width="100%"> |
| 279 | <nobr> |
| 280 | <span class="sympad"> |
| 281 | <a href="#startActivity">startActivity</a> |
| 282 | </span> |
| 283 | (<em>string</em> uri, |
| 284 | <em>string</em> action, |
| 285 | <em>string</em> data, |
| 286 | <em>string</em> mimetype, |
| 287 | <em>iterable</em> categories |
| 288 | <em>dictionary</em> extras, |
| 289 | <em>component</em> component, |
| 290 | <em>flags</em>) |
| 291 | </nobr> |
| 292 | <div class="jd-descrdiv"> |
| 293 | Starts an Activity on this device by sending an Intent constructed from the |
| 294 | supplied arguments. |
| 295 | </div> |
| 296 | </td> |
| 297 | </tr> |
| 298 | <tr class="api" > |
| 299 | <td class="jd-typecol"> |
| 300 | <nobr> |
| 301 | <code> |
| 302 | <a href="{@docRoot}tools/help/MonkeyImage.html"> |
| 303 | MonkeyImage |
| 304 | </a> |
| 305 | </code> |
| 306 | </nobr> |
| 307 | </td> |
| 308 | <td class="jd-linkcol" width="100%"> |
| 309 | <nobr> |
| 310 | <span class="sympad"> |
| 311 | <a href="#takeSnapshot">takeSnapshot</a>() |
| 312 | </span> |
| 313 | </nobr> |
| 314 | <div class="jd-descrdiv"> |
| 315 | Captures the entire screen buffer of this device, yielding a |
| 316 | <code> |
| 317 | <a href="{@docRoot}tools/help/MonkeyImage.html"> |
| 318 | MonkeyImage |
| 319 | </a> |
| 320 | </code> object containing a screen capture of the current display. |
| 321 | </div> |
| 322 | </td> |
| 323 | </tr> |
| 324 | <tr class="api" > |
| 325 | <td class="jd-typecol"> |
| 326 | <nobr> |
| 327 | void |
| 328 | </nobr> |
| 329 | </td> |
| 330 | <td class="jd-linkcol" width="100%"> |
| 331 | <nobr> |
| 332 | <span class="sympad"> |
| 333 | <a href="#touch">touch</a> |
| 334 | </span> |
| 335 | (<em>integer</em> x, |
| 336 | <em>integer</em> y, |
| 337 | <em>integer</em> type) |
| 338 | </nobr> |
| 339 | <div class="jd-descrdiv"> |
| 340 | Sends a touch event specified by type to the screen location specified |
| 341 | by x and y. |
| 342 | </div> |
| 343 | </td> |
| 344 | </tr> |
| 345 | <tr class="api" > |
| 346 | <td class="jd-typecol"> |
| 347 | <nobr> |
| 348 | void |
| 349 | </nobr> |
| 350 | </td> |
| 351 | <td class="jd-linkcol" width="100%"> |
| 352 | <nobr> |
| 353 | <span class="sympad"> |
| 354 | <a href="#touch">type</a> |
| 355 | </span> |
| 356 | (<em>string</em> message) |
| 357 | </nobr> |
| 358 | <div class="jd-descrdiv"> |
| 359 | Sends the characters contained in message to this device, as if they |
| 360 | had been typed on the device's keyboard. This is equivalent to calling |
| 361 | <code><a href="#press">press()</a></code> for each keycode in <code>message</code> |
| 362 | using the key event type <code><a href="#ACTION_DOWN_AND_UP"></a>DOWN_AND_UP</code>. |
| 363 | </div> |
| 364 | </td> |
| 365 | </tr> |
| 366 | <tr class="api" > |
| 367 | <td class="jd-typecol"> |
| 368 | <nobr> |
| 369 | void |
| 370 | </nobr> |
| 371 | </td> |
| 372 | <td class="jd-linkcol" width="100%"> |
| 373 | <nobr> |
| 374 | <span class="sympad"> |
| 375 | <a href="#touch">wake</a> |
| 376 | </span> |
| 377 | () |
| 378 | </nobr> |
| 379 | <div class="jd-descrdiv"> |
| 380 | Wakes the screen of this device. |
| 381 | </div> |
| 382 | </td> |
| 383 | </tr> |
| 384 | </table> |
| 385 | <!-- ========= ENUM CONSTANTS DETAIL ======== --> |
| 386 | <h2>Constants</h2> |
| 387 | <A NAME="ACTION_DOWN"></a> |
| 388 | <div class="jd-details api"> |
| 389 | <h4 class="jd-details-title"> |
| 390 | <span class="normal"> |
| 391 | <em>string</em> |
| 392 | </span> |
| 393 | DOWN |
| 394 | </h4> |
| 395 | <div class="jd-details-descr"> |
| 396 | <div class="jd-tagdata jd-tagdescr"> |
| 397 | <p> |
| 398 | <code><a href="#press">press()</a></code> or |
| 399 | <code><a href="#press">touch()</a></code> value. |
| 400 | Specifies that a DOWN event type should be sent to the device, corresponding to |
| 401 | pressing down on a key or touching the screen. |
| 402 | </p> |
| 403 | </div> |
| 404 | </div> |
| 405 | </div> |
| 406 | <A NAME="ACTION_UP"></A> |
| 407 | <div class="jd-details api"> |
| 408 | <h4 class="jd-details-title"> |
| 409 | <span class="normal"> |
| 410 | <em>string</em> |
| 411 | </span> |
| 412 | UP |
| 413 | </h4> |
| 414 | <div class="jd-details-descr"> |
| 415 | <div class="jd-tagdata jd-tagdescr"> |
| 416 | <p> |
| 417 | <code><a href="#press">press()</a></code> or |
| 418 | <code><a href="#press">touch()</a></code> value. |
| 419 | Specifies that an UP event type should be sent to the device, corresponding to |
| 420 | releasing a key or lifting up from the screen. |
| 421 | </p> |
| 422 | </div> |
| 423 | </div> |
| 424 | </div> |
| 425 | <A NAME="ACTION_DOWN_AND_UP"></A> |
| 426 | |
| 427 | <div class="jd-details api"> |
| 428 | <h4 class="jd-details-title"> |
| 429 | <span class="normal"> |
| 430 | <em>string</em> |
| 431 | </span> |
| 432 | DOWN_AND_UP |
| 433 | </h4> |
| 434 | <div class="jd-details-descr"> |
| 435 | <div class="jd-tagdata jd-tagdescr"> |
| 436 | <p> |
| 437 | <code><a href="#press">press()</a></code>, |
| 438 | <code><a href="#press">touch()</a></code> or |
| 439 | <code><a href="#type">type()</a></code> value. |
| 440 | Specifies that a DOWN event type followed by an UP event type should be sent to the |
| 441 | device, corresponding to typing a key or clicking the screen. |
| 442 | </p> |
| 443 | </div> |
| 444 | </div> |
| 445 | </div> |
| 446 | <!-- ========= METHOD DETAIL ======== --> |
| 447 | <!-- Public methods --> |
| 448 | <h2>Public Methods</h2> |
| 449 | <A NAME="broadcastIntent"></A> |
| 450 | <div class="jd-details api "> |
| 451 | <h4 class="jd-details-title"> |
| 452 | <span class="normal"> |
| 453 | void |
| 454 | </span> |
| 455 | <span class="sympad">broadcastIntent</span> |
| 456 | <span class="normal"> |
| 457 | ( |
| 458 | <em>string</em> uri, |
| 459 | <em>string</em> action, |
| 460 | <em>string</em> data, |
| 461 | <em>string</em> mimetype, |
| 462 | <em>iterable</em> categories |
| 463 | <em>dictionary</em> extras, |
| 464 | <em>component</em> component, |
| 465 | <em>iterable</em> flags) |
| 466 | </span> |
| 467 | </h4> |
| 468 | <div class="jd-details-descr"> |
| 469 | |
| 470 | <div class="jd-tagdata jd-tagdescr"> |
| 471 | <p> |
| 472 | Broadcasts an Intent to this device, as if the Intent were coming from an |
| 473 | application. See {@link android.content.Intent Intent} for more information about the |
| 474 | arguments. |
| 475 | </p> |
| 476 | </div> |
| 477 | <div class="jd-tagdata"> |
| 478 | <h5 class="jd-tagtitle">Arguments</h5> |
| 479 | <table class="jd-tagtable"> |
| 480 | <tr> |
| 481 | <th>uri</th> |
| 482 | <td> |
| 483 | The URI for the Intent. |
| 484 | (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}). |
| 485 | </td> |
| 486 | </tr> |
| 487 | <tr> |
| 488 | <th>action</th> |
| 489 | <td> |
| 490 | The action for this Intent |
| 491 | (see {@link android.content.Intent#setAction(java.lang.String) Intent.setAction()}). |
| 492 | </td> |
| 493 | </tr> |
| 494 | <tr> |
| 495 | <th>data</th> |
| 496 | <td> |
| 497 | The data URI for this Intent |
| 498 | (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}). |
| 499 | </td> |
| 500 | </tr> |
| 501 | <tr> |
| 502 | <th>mimetype</th> |
| 503 | <td> |
| 504 | The MIME type for the Intent |
| 505 | (see {@link android.content.Intent#setType(java.lang.String) Intent.setType()}). |
| 506 | </td> |
| 507 | </tr> |
| 508 | <tr> |
| 509 | <th>categories</th> |
| 510 | <td> |
| 511 | An iterable data structure containing strings that define categories for this |
| 512 | Intent |
| 513 | (see |
| 514 | {@link android.content.Intent#addCategory(java.lang.String) Intent.addCategory()}). |
| 515 | </td> |
| 516 | </tr> |
| 517 | <tr> |
| 518 | <th>extras</th> |
| 519 | <td> |
| 520 | A dictionary of extra data for this Intent |
| 521 | (see {@link android.content.Intent#putExtra(java.lang.String,java.lang.String) |
| 522 | Intent.putExtra()} |
| 523 | for an example). |
| 524 | <p> |
| 525 | The key for each dictionary item should be a <em>string</em>. The item's value |
| 526 | can be any simple or structured data type. |
| 527 | </p> |
| 528 | </td> |
| 529 | </tr> |
| 530 | <tr> |
| 531 | <th>component</th> |
| 532 | <td> |
| 533 | The component for this Intent (see {@link android.content.ComponentName}). |
| 534 | Using this argument will direct the Intent to a specific class within a specific |
| 535 | Android package. |
| 536 | </td> |
| 537 | </tr> |
| 538 | <tr> |
| 539 | <th>flags</th> |
| 540 | <td> |
| 541 | An iterable data structure containing flags that control how the Intent is handled |
| 542 | (see {@link android.content.Intent#setFlags(int) Intent.setFlags()}). |
| 543 | </td> |
| 544 | </tr> |
| 545 | </table> |
| 546 | </div> |
| 547 | </div> |
| 548 | </div> |
| 549 | <A NAME="drag"></A> |
| 550 | <div class="jd-details api "> |
| 551 | <h4 class="jd-details-title"> |
| 552 | <span class="normal"> |
| 553 | void |
| 554 | </span> |
| 555 | <span class="sympad">drag</span> |
| 556 | <span class="normal"> |
| 557 | ( |
| 558 | <em>tuple</em> start, |
| 559 | <em>tuple</em> end, |
| 560 | <em>float</em> duration, |
| 561 | <em>integer</em> steps) |
| 562 | </span> |
| 563 | </h4> |
| 564 | <div class="jd-details-descr"> |
| 565 | |
| 566 | <div class="jd-tagdata jd-tagdescr"> |
| 567 | <p> |
| 568 | Simulates a drag gesture (touch, hold, and move) on this device's screen. |
| 569 | </p> |
| 570 | </div> |
| 571 | <div class="jd-tagdata"> |
| 572 | <h5 class="jd-tagtitle">Arguments</h5> |
| 573 | <table class="jd-tagtable"> |
| 574 | <tr> |
| 575 | <th>start</th> |
| 576 | <td> |
| 577 | The starting point of the drag gesture, in the form of a <em>tuple</em> |
| 578 | (x,y) where x and y are <em>integers</em>. |
| 579 | </td> |
| 580 | </tr> |
| 581 | <tr> |
| 582 | <th>end</th> |
| 583 | <td> |
| 584 | The end point of the drag gesture, in the form of a <em>tuple</em> (x,y) |
| 585 | where x and y are <em>integers</em>. |
| 586 | </td> |
| 587 | </tr> |
| 588 | <tr> |
| 589 | <th>duration</th> |
| 590 | <td>The duration of the drag gesture in seconds. The default is 1.0 seconds.</td> |
| 591 | </tr> |
| 592 | <tr> |
| 593 | <th>steps</th> |
| 594 | <td>The number of steps to take when interpolating points. The default is 10.</td> |
| 595 | </tr> |
| 596 | </table> |
| 597 | </div> |
| 598 | </div> |
| 599 | </div> |
| 600 | <A NAME="getProperty"></A> |
| 601 | <div class="jd-details api "> |
| 602 | <h4 class="jd-details-title"> |
| 603 | <span class="normal"> |
| 604 | <em>object</em> |
| 605 | </span> |
| 606 | <span class="sympad">getProperty</span> |
| 607 | <span class="normal"> |
| 608 | (<em>string</em> key) |
| 609 | </span> |
| 610 | </h4> |
| 611 | <div class="jd-details-descr"> |
| 612 | |
| 613 | <div class="jd-tagdata jd-tagdescr"> |
| 614 | <p> |
| 615 | Given the name of a system environment variable, returns its value for this device. |
| 616 | </p> |
| 617 | </div> |
| 618 | <div class="jd-tagdata"> |
| 619 | <h5 class="jd-tagtitle">Arguments</h5> |
| 620 | <table class="jd-tagtable"> |
| 621 | <tr> |
| 622 | <th>key</th> |
| 623 | <td> |
| 624 | The name of the system environment variable. The available variable names are listed in |
| 625 | <a href="#table1">Table 1. Property variable names</a> at the end of this topic. |
| 626 | </td> |
| 627 | </tr> |
| 628 | </table> |
| 629 | </div> |
| 630 | <div class="jd-tagdata"> |
| 631 | <h5 class="jd-tagtitle">Returns</h5> |
| 632 | <ul class="nolist"> |
| 633 | <li> |
| 634 | The value of the variable. The data format varies according to the variable requested. |
| 635 | </li> |
| 636 | </ul> |
| 637 | </div> |
| 638 | </div> |
| 639 | </div> |
| 640 | <A NAME="getSystemProperty"></A> |
| 641 | <div class="jd-details api "> |
| 642 | <h4 class="jd-details-title"> |
| 643 | <span class="normal"> |
| 644 | <em>object</em> |
| 645 | </span> |
| 646 | <span class="sympad">getSystemProperty</span> |
| 647 | <span class="normal"> |
| 648 | (<em>string</em> key) |
| 649 | </span> |
| 650 | </h4> |
| 651 | <div class="jd-details-descr"> |
| 652 | |
| 653 | <div class="jd-tagdata jd-tagdescr"> |
| 654 | <p> |
| 655 | Synonym for <code><a href="#getProperty">getProperty()</a></code>. |
| 656 | </p> |
| 657 | </div> |
| 658 | <div class="jd-tagdata"> |
| 659 | <h5 class="jd-tagtitle">Arguments</h5> |
| 660 | <table class="jd-tagtable"> |
| 661 | <tr> |
| 662 | <th>key</th> |
| 663 | <td> |
| 664 | The name of the system environment variable. The available variable names are listed in |
| 665 | <a href="#table1">Table 1. Property Variable Names</a>. |
| 666 | </td> |
| 667 | </tr> |
| 668 | </table> |
| 669 | </div> |
| 670 | <div class="jd-tagdata"> |
| 671 | <h5 class="jd-tagtitle">Returns</h5> |
| 672 | <ul class="nolist"> |
| 673 | <li> |
| 674 | The value of the variable. The data format varies according to the variable requested. |
| 675 | </li> |
| 676 | </ul> |
| 677 | </div> |
| 678 | </div> |
| 679 | </div> |
| 680 | <A NAME="installPackage"></A> |
| 681 | <div class="jd-details api "> |
| 682 | <h4 class="jd-details-title"> |
| 683 | <span class="normal"> |
| 684 | void |
| 685 | </span> |
| 686 | <span class="sympad">installPackage</span> |
| 687 | <span class="normal"> |
| 688 | (<em>string</em> path) |
| 689 | </span> |
| 690 | </h4> |
| 691 | <div class="jd-details-descr"> |
| 692 | |
| 693 | <div class="jd-tagdata jd-tagdescr"> |
| 694 | <p> |
| 695 | Installs the Android application or test package contained in packageFile |
| 696 | onto this device. If the application or test package is already installed, it is |
| 697 | replaced. |
| 698 | </p> |
| 699 | </div> |
| 700 | <div class="jd-tagdata"> |
| 701 | <h5 class="jd-tagtitle">Arguments</h5> |
| 702 | <table class="jd-tagtable"> |
| 703 | <tr> |
| 704 | <th>path</th> |
| 705 | <td> |
| 706 | The fully-qualified path and filename of the <code>.apk</code> file to install. |
| 707 | </td> |
| 708 | </tr> |
| 709 | </table> |
| 710 | </div> |
| 711 | </div> |
| 712 | </div> |
| 713 | <A NAME="instrument"></A> |
| 714 | <div class="jd-details api "> |
| 715 | <h4 class="jd-details-title"> |
| 716 | <span class="normal"> |
| 717 | <em>dictionary</em> |
| 718 | </span> |
| 719 | <span class="sympad">instrument</span> |
| 720 | <span class="normal"> |
| 721 | ( |
| 722 | <em>string</em> className, |
| 723 | <em>dictionary</em> args) |
| 724 | </span> |
| 725 | </h4> |
| 726 | <div class="jd-details-descr"> |
| 727 | |
| 728 | <div class="jd-tagdata jd-tagdescr"> |
| 729 | <p> |
| 730 | Runs the specified component with Android instrumentation, and returns the results |
| 731 | in a dictionary whose exact format is dictated by the component being run. The |
| 732 | component must already be present on this device. |
| 733 | </p> |
| 734 | <p> |
| 735 | Use this method to start a test case that uses one of Android's test case classes. |
| 736 | See <a href="{@docRoot}tools/testing/testing_android.html">Testing |
| 737 | Fundamentals</a> to learn more about unit testing with the Android testing |
| 738 | framework. |
| 739 | </p> |
| 740 | </div> |
| 741 | <div class="jd-tagdata"> |
| 742 | <h5 class="jd-tagtitle">Arguments</h5> |
| 743 | <table class="jd-tagtable"> |
| 744 | <tr> |
| 745 | <th>className</th> |
| 746 | <td> |
| 747 | The name of an Android component that is already installed on this device, in the |
| 748 | standard form packagename/classname, where packagename is the |
| 749 | Android package name of a <code>.apk</code> file on this device, and |
| 750 | classname is the class name of an Android component (Activity, |
| 751 | ContentProvider, Service, or BroadcastReceiver) in that file. Both |
| 752 | packagename and classname must be fully qualified. See |
| 753 | {@link android.content.ComponentName} for more details. |
| 754 | </td> |
| 755 | </tr> |
| 756 | <tr> |
| 757 | <th>args</th> |
| 758 | <td> |
| 759 | A dictionary containing flags and their values. These are passed to the component as it |
| 760 | is started. If the flag does not take a value, set its dictionary value to an empty |
| 761 | string. |
| 762 | </td> |
| 763 | </tr> |
| 764 | </table> |
| 765 | <div class="jd-tagdata"> |
| 766 | <h5 class="jd-tagtitle">Returns</h5> |
| 767 | <ul class="nolist"> |
| 768 | <li> |
| 769 | <p> |
| 770 | A dictionary containing the component's output. The contents of the dictionary |
| 771 | are defined by the component itself. |
| 772 | </p> |
| 773 | <p> |
| 774 | If you use {@link android.test.InstrumentationTestRunner} as the class name in |
| 775 | the componentName argument, then the result dictionary contains |
| 776 | the single key "stream". The value of "stream" is a <em>string</em> containing |
| 777 | the test output, as if <code>InstrumentationTestRunner</code> was run from the |
| 778 | command line. The format of this output is described in |
| 779 | <a href="{@docRoot}tools/testing/testing_otheride.html"> |
| 780 | Testing in Other IDEs</a>. |
| 781 | </p> |
| 782 | </li> |
| 783 | </ul> |
| 784 | </div> |
| 785 | </div> |
| 786 | </div> |
| 787 | </div> |
| 788 | <A NAME="press"></A> |
| 789 | <div class="jd-details api "> |
| 790 | <h4 class="jd-details-title"> |
| 791 | <span class="normal"> |
| 792 | void |
| 793 | </span> |
| 794 | <span class="sympad">press</span> |
| 795 | <span class="normal"> |
| 796 | (<em>string</em> name, |
| 797 | <em>integer</em> type) |
| 798 | </span> |
| 799 | </h4> |
| 800 | <div class="jd-details-descr"> |
| 801 | <div class="jd-tagdata jd-tagdescr"> |
| 802 | <p> |
| 803 | Sends the key event specified by <code>type</code> to the key specified by |
| 804 | <code>keycode</code>. |
| 805 | </p> |
| 806 | </div> |
| 807 | <div class="jd-tagdata"> |
| 808 | <h5 class="jd-tagtitle">Arguments</h5> |
| 809 | <table class="jd-tagtable"> |
| 810 | <tr> |
| 811 | <th>name</th> |
| 812 | <td> |
| 813 | The name of the keycode to send. See {@link android.view.KeyEvent} for a list of |
| 814 | keycode names. Use the keycode name, not its integer value. |
| 815 | </td> |
| 816 | </tr> |
| 817 | <tr> |
| 818 | <th>type</th> |
| 819 | <td> |
| 820 | The type of key event to send. The allowed values are <code><a href="#ACTION_DOWN"> |
| 821 | DOWN</a></code>, <code><a href="#ACTION_UP">UP</a></code>, and |
| 822 | <code><a href="#ACTION_DOWN_AND_UP">DOWN_AND_UP</a></code>. |
| 823 | </td> |
| 824 | </tr> |
| 825 | </table> |
| 826 | </div> |
| 827 | </div> |
| 828 | </div> |
| 829 | <A NAME="reboot"></A> |
| 830 | <div class="jd-details api "> |
| 831 | <h4 class="jd-details-title"> |
| 832 | <span class="normal"> |
| 833 | void |
| 834 | </span> |
| 835 | <span class="sympad">reboot</span> |
| 836 | <span class="normal"> |
| 837 | (<em>string</em> bootloadType) |
| 838 | </span> |
| 839 | </h4> |
| 840 | <div class="jd-details-descr"> |
| 841 | |
| 842 | <div class="jd-tagdata jd-tagdescr"> |
| 843 | <p> |
| 844 | Reboots this device into the bootloader specified by <code>bootloadType</code>. |
| 845 | </p> |
| 846 | </div> |
| 847 | <div class="jd-tagdata"> |
| 848 | <h5 class="jd-tagtitle">Arguments</h5> |
| 849 | <table class="jd-tagtable"> |
| 850 | <tr> |
| 851 | <th>into</th> |
| 852 | <td> |
| 853 | The type of bootloader to reboot into. The allowed values are |
| 854 | "bootloader", "recovery", or "None". |
| 855 | </td> |
| 856 | </tr> |
| 857 | </table> |
| 858 | </div> |
| 859 | </div> |
| 860 | </div> |
| 861 | <A NAME="removePackage"></A> |
| 862 | <div class="jd-details api "> |
| 863 | <h4 class="jd-details-title"> |
| 864 | <span class="normal"> |
| 865 | void |
| 866 | </span> |
| 867 | <span class="sympad">removePackage</span> |
| 868 | <span class="normal"> |
| 869 | (<em>string</em> package) |
| 870 | </span> |
| 871 | </h4> |
| 872 | <div class="jd-details-descr"> |
| 873 | |
| 874 | <div class="jd-tagdata jd-tagdescr"> |
| 875 | <p> |
| 876 | Deletes the specified package from this device, including its data and cache. |
| 877 | </p> |
| 878 | </div> |
| 879 | <div class="jd-tagdata"> |
| 880 | <h5 class="jd-tagtitle">Arguments</h5> |
| 881 | <table class="jd-tagtable"> |
| 882 | <tr> |
| 883 | <th>package</th> |
| 884 | <td> |
| 885 | The Android package name of an <code>.apk</code> file on this device. |
| 886 | </td> |
| 887 | </table> |
| 888 | </div> |
| 889 | </div> |
| 890 | </div> |
| 891 | <A NAME="shell"></A> |
| 892 | <div class="jd-details api "> |
| 893 | <h4 class="jd-details-title"> |
| 894 | <span class="normal"> |
| 895 | <em>object</em> |
| 896 | </span> |
| 897 | <span class="sympad">shell</span> |
| 898 | <span class="normal"> |
| 899 | (<em>string</em> cmd) |
| 900 | </span> |
| 901 | </h4> |
| 902 | <div class="jd-details-descr"> |
| 903 | <div class="jd-tagdata jd-tagdescr"> |
| 904 | <p> |
| 905 | Executes an <code>adb</code> shell command and returns the result, if any. |
| 906 | </p> |
| 907 | </div> |
| 908 | <div class="jd-tagdata"> |
| 909 | <h5 class="jd-tagtitle">Arguments</h5> |
| 910 | <table class="jd-tagtable"> |
| 911 | <tr> |
| 912 | <th>cmd</th> |
| 913 | <td> |
| 914 | The command to execute in the <code>adb</code> shell. The form of these commands is |
| 915 | described in the topic <a href="{@docRoot}tools/help/adb.html">Android |
| 916 | Debug Bridge</a>. |
| 917 | </td> |
| 918 | </tr> |
| 919 | </table> |
| 920 | </div> |
| 921 | <div class="jd-tagdata"> |
| 922 | <h5 class="jd-tagtitle">Returns</h5> |
| 923 | <ul class="nolist"> |
| 924 | <li> |
| 925 | The results of the command, if any. The format of the results is determined by the |
| 926 | command. |
| 927 | </li> |
| 928 | </ul> |
| 929 | </div> |
| 930 | </div> |
| 931 | </div> |
| 932 | <A NAME="startActivity"></A> |
| 933 | <div class="jd-details api "> |
| 934 | <h4 class="jd-details-title"> |
| 935 | <span class="normal"> |
| 936 | void |
| 937 | </span> |
| 938 | <span class="sympad">startActivity</span> |
| 939 | <span class="normal"> |
| 940 | ( |
| 941 | <em>string</em> uri, |
| 942 | <em>string</em> action, |
| 943 | <em>string</em> data, |
| 944 | <em>string</em> mimetype, |
| 945 | <em>iterable</em> categories |
| 946 | <em>dictionary</em> extras, |
| 947 | <em>component</em> component, |
| 948 | <em>iterable</em> flags) |
| 949 | </span> |
| 950 | </h4> |
| 951 | <div class="jd-details-descr"> |
| 952 | <div class="jd-tagdata jd-tagdescr"> |
| 953 | <p> |
| 954 | Starts an Activity on this device by sending an Intent constructed from the |
| 955 | supplied arguments. |
| 956 | </p> |
| 957 | </div> |
| 958 | <div class="jd-tagdata"> |
| 959 | <h5 class="jd-tagtitle">Arguments</h5> |
| 960 | <table class="jd-tagtable"> |
| 961 | <tr> |
| 962 | <th>uri</th> |
| 963 | <td> |
| 964 | The URI for the Intent. |
| 965 | (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}). |
| 966 | </td> |
| 967 | </tr> |
| 968 | <tr> |
| 969 | <th>action</th> |
| 970 | <td> |
| 971 | The action for the Intent |
| 972 | (see {@link android.content.Intent#setAction(java.lang.String) Intent.setAction()}). |
| 973 | </td> |
| 974 | </tr> |
| 975 | <tr> |
| 976 | <th>data</th> |
| 977 | <td> |
| 978 | The data URI for the Intent |
| 979 | (see {@link android.content.Intent#setData(android.net.Uri) Intent.setData()}). |
| 980 | </td> |
| 981 | </tr> |
| 982 | <tr> |
| 983 | <th>mimetype</th> |
| 984 | <td> |
| 985 | The MIME type for the Intent |
| 986 | (see {@link android.content.Intent#setType(java.lang.String) Intent.setType()}). |
| 987 | </td> |
| 988 | </tr> |
| 989 | <tr> |
| 990 | <th>categories</th> |
| 991 | <td> |
| 992 | An iterable data structure containing strings that define categories for the |
| 993 | Intent |
| 994 | (see |
| 995 | {@link android.content.Intent#addCategory(java.lang.String) Intent.addCategory()}). |
| 996 | </td> |
| 997 | </tr> |
| 998 | <tr> |
| 999 | <th>extras</th> |
| 1000 | <td> |
| 1001 | A dictionary of extra data for the Intent |
| 1002 | (see |
| 1003 | {@link android.content.Intent#putExtra(java.lang.String,java.lang.String) |
| 1004 | Intent.putExtra()} |
| 1005 | for an example). |
| 1006 | <p> |
| 1007 | The key for each dictionary item should be a <em>string</em>. The item's value |
| 1008 | can be any simple or structured data type. |
| 1009 | </p> |
| 1010 | </td> |
| 1011 | </tr> |
| 1012 | <tr> |
| 1013 | <th>component</th> |
| 1014 | <td> |
| 1015 | The component for the Intent |
| 1016 | (see {@link android.content.ComponentName}). Using this argument will direct the |
| 1017 | Intent to a specific class within a specific Android package. |
| 1018 | </td> |
| 1019 | </tr> |
| 1020 | <tr> |
| 1021 | <th>flags</th> |
| 1022 | <td> |
| 1023 | An iterable data structure containing flags that control how the Intent is handled |
| 1024 | (see {@link android.content.Intent#setFlags(int) Intent.setFlags()}). |
| 1025 | </td> |
| 1026 | </tr> |
| 1027 | </table> |
| 1028 | </div> |
| 1029 | </div> |
| 1030 | </div> |
| 1031 | <A NAME="takeSnapshot"></A> |
| 1032 | <div class="jd-details api "> |
| 1033 | <h4 class="jd-details-title"> |
| 1034 | <span class="normal"> |
| 1035 | <code> |
| 1036 | <a href="{@docRoot}tools/help/MonkeyImage.html"> |
| 1037 | MonkeyImage |
| 1038 | </a> |
| 1039 | </code> |
| 1040 | </span> |
| 1041 | <span class="sympad">takeSnapshot</span> |
| 1042 | <span class="normal"> |
| 1043 | () |
| 1044 | </span> |
| 1045 | </h4> |
| 1046 | <div class="jd-details-descr"> |
| 1047 | <div class="jd-tagdata jd-tagdescr"> |
| 1048 | <p> |
| 1049 | Captures the entire screen buffer of this device, yielding a |
| 1050 | screen capture of the current display. |
| 1051 | </p> |
| 1052 | </div> |
| 1053 | <div class="jd-tagdata"> |
| 1054 | <h5 class="jd-tagtitle">Returns</h5> |
| 1055 | <ul class="nolist"> |
| 1056 | <li> |
| 1057 | A <a href="{@docRoot}tools/help/MonkeyImage.html"> |
| 1058 | MonkeyImage</a> object containing the image of the current display. |
| 1059 | </li> |
| 1060 | </ul> |
| 1061 | </div> |
| 1062 | </div> |
| 1063 | </div> |
| 1064 | <A NAME="touch"></A> |
| 1065 | <div class="jd-details api "> |
| 1066 | <h4 class="jd-details-title"> |
| 1067 | <span class="normal"> |
| 1068 | void |
| 1069 | </span> |
| 1070 | <span class="sympad">touch</span> |
| 1071 | <span class="normal"> |
| 1072 | ( |
| 1073 | <em>integer</em> x, |
| 1074 | <em>integer</em> y, |
| 1075 | <em>string</em> type) |
| 1076 | </span> |
| 1077 | </h4> |
| 1078 | <div class="jd-details-descr"> |
| 1079 | <div class="jd-tagdata jd-tagdescr"> |
| 1080 | <p> |
| 1081 | Sends a touch event specified by type to the screen location specified |
| 1082 | by x and y. |
| 1083 | </p> |
| 1084 | </div> |
| 1085 | <div class="jd-tagdata"> |
| 1086 | <h5 class="jd-tagtitle">Arguments</h5> |
| 1087 | <table class="jd-tagtable"> |
| 1088 | <tr> |
| 1089 | <th>x</th> |
| 1090 | <td> |
| 1091 | The horizontal position of the touch in actual device pixels, starting from the left of |
| 1092 | the screen in its current orientation. |
| 1093 | </td> |
| 1094 | </tr> |
| 1095 | <tr> |
| 1096 | <th>y</th> |
| 1097 | <td> |
| 1098 | The vertical position of the touch in actual device pixels, starting from the top of |
| 1099 | the screen in its current orientation. |
| 1100 | </td> |
| 1101 | </tr> |
| 1102 | <tr> |
| 1103 | <th>type</th> |
| 1104 | <td> |
| 1105 | The type of key event to send. The allowed values are <code><a href="#ACTION_DOWN"> |
| 1106 | DOWN</a></code>, <code><a href="#ACTION_UP">UP</a></code>, and |
| 1107 | <code><a href="#ACTION_DOWN_AND_UP">DOWN_AND_UP</a></code>. |
| 1108 | </td> |
| 1109 | </tr> |
| 1110 | </table> |
| 1111 | </div> |
| 1112 | </div> |
| 1113 | </div> |
| 1114 | <A NAME="type"></A> |
| 1115 | <div class="jd-details api "> |
| 1116 | <h4 class="jd-details-title"> |
| 1117 | <span class="normal"> |
| 1118 | void |
| 1119 | </span> |
| 1120 | <span class="sympad">type</span> |
| 1121 | <span class="normal"> |
| 1122 | (<em>string</em> message) |
| 1123 | </span> |
| 1124 | </h4> |
| 1125 | <div class="jd-details-descr"> |
| 1126 | <div class="jd-tagdata jd-tagdescr"> |
| 1127 | <p> |
| 1128 | Sends the characters contained in message to this device, as if they |
| 1129 | had been typed on the device's keyboard. This is equivalent to calling |
| 1130 | <code><a href="#press">press()</a></code> for each keycode in <code>message</code> |
| 1131 | using the key event type <code><a href="#ACTION_DOWN_AND_UP">DOWN_AND_UP</a></code>. |
| 1132 | </p> |
| 1133 | </div> |
| 1134 | <div class="jd-tagdata"> |
| 1135 | <h5 class="jd-tagtitle">Arguments</h5> |
| 1136 | <table class="jd-tagtable"> |
| 1137 | <tr> |
| 1138 | <th>message</th> |
| 1139 | <td> |
| 1140 | A string containing the characters to send. |
| 1141 | </td> |
| 1142 | </tr> |
| 1143 | </table> |
| 1144 | </div> |
| 1145 | </div> |
| 1146 | </div> |
| 1147 | <A NAME="wake"></A> |
| 1148 | <div class="jd-details api"> |
| 1149 | <h4 class="jd-details-title"> |
| 1150 | <span class="normal"> |
| 1151 | void |
| 1152 | </span> |
| 1153 | <span class="sympad">wake</span> |
| 1154 | <span class="normal"> |
| 1155 | () |
| 1156 | </span> |
| 1157 | </h4> |
| 1158 | <div class="jd-details-descr"> |
| 1159 | <div class="jd-tagdata jd-tagdescr"> |
| 1160 | <p> |
| 1161 | Wakes the screen of this device. |
| 1162 | </p> |
| 1163 | </div> |
| 1164 | </div> |
| 1165 | </div> |
| 1166 | <hr></hr> |
| 1167 | <h2>Appendix</h2> |
| 1168 | <p class="table-caption" id="table1"> |
| 1169 | <strong>Table 1.</strong>Property variable names used with |
| 1170 | <span class="sympad"><a href="#getProperty">getProperty()</a></span> and |
| 1171 | <span class="sympad"><a href="#getSystemProperty">getSystemProperty()</a></span>. |
| 1172 | </p> |
| 1173 | <table> |
| 1174 | <tr> |
| 1175 | <th> |
| 1176 | Property Group |
| 1177 | </th> |
| 1178 | <th> |
| 1179 | Property |
| 1180 | </th> |
| 1181 | <th> |
| 1182 | Description |
| 1183 | </th> |
| 1184 | <th> |
| 1185 | Notes |
| 1186 | </th> |
| 1187 | </tr> |
| 1188 | <tr> |
| 1189 | <td rowspan="17"><code>build</code></td> |
| 1190 | <td><code>board</code></td> |
| 1191 | <td>Code name for the device's system board</td> |
| 1192 | <td rowspan="17"> |
| 1193 | See {@link android.os.Build} |
| 1194 | </td> |
| 1195 | </tr> |
| 1196 | <tr> |
| 1197 | <td><code>brand</code></td> |
| 1198 | <td>The carrier or provider for which the OS is customized.</td> |
| 1199 | </tr> |
| 1200 | <tr> |
| 1201 | <td><code>device</code></td> |
| 1202 | <td>The device design name.</td> |
| 1203 | </tr> |
| 1204 | <tr> |
| 1205 | <td><code>fingerprint</code></td> |
| 1206 | <td>A unique identifier for the currently-running build.</td> |
| 1207 | </tr> |
| 1208 | <tr> |
| 1209 | <td><code>host</code></td> |
| 1210 | <td></td> |
| 1211 | </tr> |
| 1212 | <tr> |
| 1213 | <td><code>ID</code></td> |
| 1214 | <td>A changelist number or label.</td> |
| 1215 | </tr> |
| 1216 | <tr> |
| 1217 | <td><code>model</code></td> |
| 1218 | <td>The end-user-visible name for the device.</td> |
| 1219 | </tr> |
| 1220 | <tr> |
| 1221 | <td><code>product</code></td> |
| 1222 | <td>The overall product name.</td> |
| 1223 | </tr> |
| 1224 | <tr> |
| 1225 | <td><code>tags</code></td> |
| 1226 | <td>Comma-separated tags that describe the build, such as "unsigned" and "debug".</td> |
| 1227 | </tr> |
| 1228 | <tr> |
| 1229 | <td><code>type</code></td> |
| 1230 | <td>The build type, such as "user" or "eng".</td> |
| 1231 | </tr> |
| 1232 | <tr> |
| 1233 | <td><code>user</code></td> |
| 1234 | <td></td> |
| 1235 | </tr> |
| 1236 | <tr> |
| 1237 | <td><code>CPU_ABI</code></td> |
| 1238 | <td> |
| 1239 | The name of the native code instruction set, in the form CPU type plus |
| 1240 | ABI convention. |
| 1241 | </td> |
| 1242 | </tr> |
| 1243 | <tr> |
| 1244 | <td><code>manufacturer</code></td> |
| 1245 | <td>The product/hardware manufacturer.</td> |
| 1246 | </tr> |
| 1247 | <tr> |
| 1248 | <td><code>version.incremental</code></td> |
| 1249 | <td> |
| 1250 | The internal code used by the source control system to represent this version |
| 1251 | of the software. |
| 1252 | </td> |
| 1253 | </tr> |
| 1254 | <tr> |
| 1255 | <td><code>version.release</code></td> |
| 1256 | <td>The user-visible name of this version of the software.</td> |
| 1257 | </tr> |
| 1258 | <tr> |
| 1259 | <td><code>version.sdk</code></td> |
| 1260 | <td>The user-visible SDK version associated with this version of the OS.</td> |
| 1261 | </tr> |
| 1262 | <tr> |
| 1263 | <td><code>version.codename</code></td> |
| 1264 | <td> |
| 1265 | The current development codename, or "REL" if this version of the software has been |
| 1266 | released. |
| 1267 | </td> |
| 1268 | </tr> |
| 1269 | <tr> |
| 1270 | <td rowspan="3"><code>display</code></td> |
| 1271 | <td><code>width</code></td> |
| 1272 | <td>The device's display width in pixels.</td> |
| 1273 | <td rowspan="3"> |
| 1274 | See |
| 1275 | {@link android.util.DisplayMetrics} for details. |
| 1276 | </td> |
| 1277 | </tr> |
| 1278 | <tr> |
| 1279 | <td><code>height</code></td> |
| 1280 | <td>The device's display height in pixels.</td> |
| 1281 | </tr> |
| 1282 | <tr> |
| 1283 | <td><code>density</code></td> |
| 1284 | <td> |
| 1285 | The logical density of the display. This is a factor that scales |
| 1286 | DIP (Density-Independent Pixel) units to the device's resolution. DIP is adjusted so |
| 1287 | that 1 DIP is equivalent to one pixel on a 160 pixel-per-inch display. For example, |
| 1288 | on a 160-dpi screen, density = 1.0, while on a 120-dpi screen, density = .75. |
| 1289 | <p> |
| 1290 | The value does not exactly follow the real screen size, but is adjusted to |
| 1291 | conform to large changes in the display DPI. See |
| 1292 | {@link android.util.DisplayMetrics#density} for more details. |
| 1293 | </p> |
| 1294 | </td> |
| 1295 | </tr> |
| 1296 | <tr> |
| 1297 | <td rowspan="6"><code>am.current</code></td> |
| 1298 | <td><code>package</code></td> |
| 1299 | <td>The Android package name of the currently running package.</td> |
| 1300 | <td rowspan="6"> |
| 1301 | The <code>am.current</code> keys return information about the currently-running |
| 1302 | Activity. |
| 1303 | </td> |
| 1304 | </tr> |
| 1305 | <tr> |
| 1306 | <td><code>action</code></td> |
| 1307 | <td> |
| 1308 | The current activity's action. This has the same format as the <code>name</code> |
| 1309 | attribute of the <code>action</code> element in a package manifest. |
| 1310 | </td> |
| 1311 | </tr> |
| 1312 | <tr> |
| 1313 | <td><code>comp.class</code></td> |
| 1314 | <td> |
| 1315 | The class name of the component that started the current Activity. See |
| 1316 | <code><a href="#comppackage">comp.package</a></code> for more details.</td> |
| 1317 | </tr> |
| 1318 | <tr> |
| 1319 | <td><a name="comppackage"><code>comp.package</code></a></td> |
| 1320 | <td> |
| 1321 | The package name of the component that started the current Activity. A component |
| 1322 | is specified by a package name and the name of class that the package contains. |
| 1323 | </td> |
| 1324 | </tr> |
| 1325 | <tr> |
| 1326 | <td><code>data</code></td> |
| 1327 | <td>The data (if any) contained in the Intent that started the current Activity.</td> |
| 1328 | </tr> |
| 1329 | <tr> |
| 1330 | <td><code>categories</code></td> |
| 1331 | <td>The categories specified by the Intent that started the current Activity.</td> |
| 1332 | </tr> |
| 1333 | <tr> |
| 1334 | <td rowspan="3"><code>clock</code></td> |
| 1335 | <td><code>realtime</code></td> |
| 1336 | <td> |
| 1337 | The number of milliseconds since the device rebooted, including deep-sleep |
| 1338 | time. |
| 1339 | </td> |
| 1340 | <td rowspan="3"> |
| 1341 | See {@link android.os.SystemClock} for more information. |
| 1342 | </td> |
| 1343 | </tr> |
| 1344 | <tr> |
| 1345 | <td><code>uptime</code></td> |
| 1346 | <td> |
| 1347 | The number of milliseconds since the device rebooted, <em>not</em> including |
| 1348 | deep-sleep time |
| 1349 | </td> |
| 1350 | </tr> |
| 1351 | <tr> |
| 1352 | <td><code>millis</code></td> |
| 1353 | <td>current time since the UNIX epoch, in milliseconds.</td> |
| 1354 | </tr> |
| 1355 | </table> |