diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/html/guide/topics/resources/providing-resources.jd | 2 | ||||
-rw-r--r-- | docs/html/images/training/auto-desktop-head-unit-context-menu-enabled.png | bin | 0 -> 90455 bytes | |||
-rw-r--r-- | docs/html/images/training/auto-desktop-head-unit-launch.png | bin | 0 -> 30383 bytes | |||
-rw-r--r-- | docs/html/images/training/auto-desktop-head-unit-server-running.png | bin | 0 -> 75541 bytes | |||
-rw-r--r-- | docs/html/images/training/auto-desktop-head-unit-wkst-launch.png | bin | 0 -> 99713 bytes | |||
-rw-r--r-- | docs/html/preview/features/runtime-permissions.jd | 7 | ||||
-rw-r--r-- | docs/html/sdk/index.jd | 34 | ||||
-rw-r--r-- | docs/html/tools/help/desktop-head-unit.jd | 439 | ||||
-rw-r--r-- | docs/html/tools/revisions/studio.jd | 27 | ||||
-rw-r--r-- | docs/html/tools/sdk/eclipse-adt.jd | 35 | ||||
-rw-r--r-- | docs/html/tools/tools_toc.cs | 1 | ||||
-rw-r--r-- | docs/html/training/auto/start/index.jd | 155 |
12 files changed, 632 insertions, 68 deletions
diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd index 63eee96..6f9545d 100644 --- a/docs/html/guide/topics/resources/providing-resources.jd +++ b/docs/html/guide/topics/resources/providing-resources.jd @@ -954,7 +954,7 @@ same way. For example, a color:</p> <?xml version="1.0" encoding="utf-8"?> <resources> <color name="yellow">#f00</color> - <color name="highlight">@color/red</color> + <color name="highlight">@color/yellow</color> </resources> </pre> diff --git a/docs/html/images/training/auto-desktop-head-unit-context-menu-enabled.png b/docs/html/images/training/auto-desktop-head-unit-context-menu-enabled.png Binary files differnew file mode 100644 index 0000000..99e60e9 --- /dev/null +++ b/docs/html/images/training/auto-desktop-head-unit-context-menu-enabled.png diff --git a/docs/html/images/training/auto-desktop-head-unit-launch.png b/docs/html/images/training/auto-desktop-head-unit-launch.png Binary files differnew file mode 100644 index 0000000..012857a --- /dev/null +++ b/docs/html/images/training/auto-desktop-head-unit-launch.png diff --git a/docs/html/images/training/auto-desktop-head-unit-server-running.png b/docs/html/images/training/auto-desktop-head-unit-server-running.png Binary files differnew file mode 100644 index 0000000..5aa3b83 --- /dev/null +++ b/docs/html/images/training/auto-desktop-head-unit-server-running.png diff --git a/docs/html/images/training/auto-desktop-head-unit-wkst-launch.png b/docs/html/images/training/auto-desktop-head-unit-wkst-launch.png Binary files differnew file mode 100644 index 0000000..4d48ac4 --- /dev/null +++ b/docs/html/images/training/auto-desktop-head-unit-wkst-launch.png diff --git a/docs/html/preview/features/runtime-permissions.jd b/docs/html/preview/features/runtime-permissions.jd index 8ab7619..62e49b9 100644 --- a/docs/html/preview/features/runtime-permissions.jd +++ b/docs/html/preview/features/runtime-permissions.jd @@ -916,8 +916,11 @@ $ adb pm revoke <package_name> <permission_name> </dt> <dd> - Returns <code>true</code> if the app has the specified permission, whether - or not the device is using the M Preview. + Returns {@link android.content.pm.PackageManager#PERMISSION_GRANTED + PERMISSION_GRANTED} if the app has the specified permission, whether + or not the device is using the M Preview. If the app does not have the + specified permission, returns {@link + android.content.pm.PackageManager#PERMISSION_DENIED PERMISSION_DENIED}. </dd> <dt> diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd index dbc0f35..39822e5 100644 --- a/docs/html/sdk/index.jd +++ b/docs/html/sdk/index.jd @@ -5,28 +5,28 @@ page.image=images/cards/android-studio_2x.png header.hide=1 page.metaDescription=Download the official Android IDE and developer tools to build apps for Android phones, tablets, wearables, TVs, and more. -studio.version=1.3.1.0 +studio.version=1.3.2.0 -studio.linux_bundle_download=android-studio-ide-141.2135290-linux.zip -studio.linux_bundle_bytes=351992670 -studio.linux_bundle_checksum=51e5f5de2b82883d87f85ee38cf7b7b8b2e7debf +studio.linux_bundle_download=android-studio-ide-141.2178183-linux.zip +studio.linux_bundle_bytes=352010593 +studio.linux_bundle_checksum=cf780413f8c8223eb348bd27c19a9c04b75eaeb2 -studio.mac_bundle_download=android-studio-ide-141.2135290-mac.dmg -studio.mac_bundle_bytes=368321249 -studio.mac_bundle_checksum=9fc12b5657ff52c761b7e7c115feade2a9728386 +studio.mac_bundle_download=android-studio-ide-141.2178183-mac.dmg +studio.mac_bundle_bytes=368335367 +studio.mac_bundle_checksum=75b67eb15a34a152a40e7189484ab0ebc375b877 -studio.win_bundle_download=android-studio-ide-141.2135290-windows.zip -studio.win_bundle_bytes=344406793 -studio.win_bundle_checksum=3b4c4924cb9495e56db61ca0e8c8d2bf588c4b97 +studio.win_bundle_download=android-studio-ide-141.2178183-windows.zip +studio.win_bundle_bytes=344424713 +studio.win_bundle_checksum=3134f226b5f3c3f74d4fc2d9cff03a4458f01d69 -studio.win_bundle_exe_download=android-studio-bundle-141.2135290-windows.exe -studio.win_bundle_exe_bytes=1008506096 -studio.win_bundle_exe_checksum=8cff590f2e08e339f8c2491b287a840ae87c7383 +studio.win_bundle_exe_download=android-studio-bundle-141.2178183-windows.exe +studio.win_bundle_exe_bytes=1136982712 +studio.win_bundle_exe_checksum=c7d39c529dd434489da9d086ff689d34dc791526 -studio.win_notools_exe_download=android-studio-ide-141.2135290-windows.exe -studio.win_notools_exe_bytes=321791312 -studio.win_notools_exe_checksum=d70fb49d03db9dded19c891a92452601e39272f4 +studio.win_notools_exe_download=android-studio-ide-141.2178183-windows.exe +studio.win_notools_exe_bytes=321810248 +studio.win_notools_exe_checksum=b5d1aaa000729c03a3cf980add79d1b93121c56d @@ -289,7 +289,7 @@ width: 400px;text-align: center;">The official Android IDE</p> </ul> <a class="online landing-button green download-bundle-button" -href="#Other" >Download Android Studio</a> +href="#Other" >Download Android Studio<br/><span class='small'></span></a> <!-- this appears when viewing the offline docs --> <p class="offline"> diff --git a/docs/html/tools/help/desktop-head-unit.jd b/docs/html/tools/help/desktop-head-unit.jd new file mode 100644 index 0000000..981979c --- /dev/null +++ b/docs/html/tools/help/desktop-head-unit.jd @@ -0,0 +1,439 @@ +page.title=Desktop Head Unit +page.tags="auto", "car", "testing","dhu" +@jd:body + + +<div id="qv-wrapper"> +<div id="qv"> + + <h2>In this document</h2> + <ol> + <li><a href="#launching-dhu">Launching the DHU</a></li> + <li><a href="#dhu-commands">Issuing DHU Commands</a></li> + </ol> + + <h2>See also</h2> + <ol> + <li><a href="{@docRoot}training/auto/start/index.html#test-it-dhu">Run and Test Auto Apps</a></li> + </ol> + +</div> +</div> + + +<p>The Desktop Head Unit (DHU) enables your development machine to emulate an Android Auto +head unit, so you can easily run and test Android Auto apps. The DHU runs on +Windows, Mac, and Linux hosts and replaces previous Android Auto simulators, +such as the Android Media Browser and Messaging +simulators.</p> + +<p class="note"><strong>Note:</strong> For other information about testing Auto apps, see the +training lesson +<a href="{@docRoot}training/auto/start/index.html#test-it-dhu">Run and Test Auto Apps</a>. </p> + + +<h2 id="launching-dhu">Launching the DHU</h2> + +<p> + To launch the DHU, run the <code>desktop-head-unit.exe</code> (on Windows) + or <code>desktop-head-unit</code> (on Mac or Linux) command, as described in + <a href="{@docRoot}training/auto/start/index.html#connecting-dhu">Connecting + the DHU to your mobile device</a>. +</p> + +<p> + By default, the DHU emulates the most common form of Android Auto-compatible + head unit, which uses a touch screen user interface. You can simulate user + touches by clicking the DHU with a mouse. To emulate head units which use + a rotary controller for input, you can use the <code>-i controller</code> flag, + as in this example: +</p> + +<pre class="no-pretty-print">$ ./desktop-head-unit -i controller</pre> + +<p> + When the DHU is in rotary-controller mode you can simulate controller + operations by using keyboard shortcuts, as described in <a href= + "#cmd-bindings">DHU commands and key bindings</a>. If the DHU is in rotary + controller mode, it ignores mouse clicks; you must operate Android Auto with + the simulated rotary controller operations. +</p> + +<h2 id="dhu-commands">Issuing DHU Commands</h2> + +<p> + DHU commands allow you to test your app with Android Auto features, such as + playing voice input or switching between night and day display mode. You can issue commands to + the DHU by running commands from the terminal window where you launched DHU. + You can also issue commands by selecting the DHU window and + using keyboard shortcuts. The DHU commands + and key bindings for all controls are listed in <a href="#cmd-bindings">DHU + commands and key bindings</a>. +</p> + + +<h3 id="day-night">Switching between day and night mode</h3> + +<p> + Android Auto supports different color schemes for day and night. You should test your app in both + day and night mode. You can switch between night and day mode in either of the + following ways: +</p> + +<ul> + <li>Run the command <code>daynight</code> in the terminal where you launched the DHU. + </li> + + <li>Select the DHU window and press the <strong>N</strong> key. + </li> +</ul> + +<h3>Microphone testing</h3> + +<p>The DHU supports using a microphone for voice input. You can also instruct the DHU to treat +a pre-recorded voice track as input, as if the DHU had heard the track through the microphone.</p> + +<p>To use a pre-recorded sound file as input, enter this command: </p> +<pre class="no-pretty-print"> +$ mic play <sound_file_path>/<sound_file>.wav +</pre> + +<p>For your convenience, we have provided the following sound files for common +voice commands. These sound files are installed in the +<code><sdk>/extras/google/auto/voice/</code> directory.</p> + +<dl> + <dt> + <code>exitnav.wav</code> + </dt> + + <dd> + "Exit navigation." + </dd> + + <dt> + <code>navgoogle.wav</code> + </dt> + + <dd> + "Navigate to 1600 Amphitheatre Parkway, Mountain View." + </dd> + + <dt> + <code>navsoh.wav</code> + </dt> + + <dd> + "Navigate to Sydney Opera House." + </dd> + + <dt> + <code>nextturn.wav</code> + </dt> + + <dd> + "When is my next turn?" + </dd> + + <dt> + <code>showalternateroute.wav</code> + </dt> + + <dd> + "Show alternate routes."" + </dd> + + <dt> + <code>howlong.wav</code> + </dt> + + <dd> + "How long until I get there?" + </dd> + + <dt> + <code>navhome.wav</code> + </dt> + + <dd> + "Navigate to home." + </dd> + + <dt> + <code>navwork.wav</code> + </dt> + + <dd> + "Navigate to work."" + </dd> + + <dt> + <code>pause.wav</code> + </dt> + + <dd> + "Pause music." + </dd> + + <dt> + <code>showtraffic.wav</code> + </dt> + + <dd> + "Show traffic." + </dd> +</dl> +<h3 id="cmd-bindings">DHU commands and key bindings</h3> + +<p>The DHU supports the following commands.</p> + +<p class="table-caption" id="table-commands"><strong>Table 1.</strong> Commands and key bindings</p> +<table> +<tr> + <th>Category</th> + <th>Command</th> + <th>Subcommand</th> + <th>Argument(s)</th> + <th>Keyboard Shortcut(s)</th> + <th>Description</th> +</tr> + +<!--system--> + +<tr> +<td rowspan="4">System</td> +<td>help</td> +<td></td> +<td>[command]</td> +<td></td> +<td>Shows the full command set. Specifying a command name (for example, <code>help day</code>) + causes the system to show help for that command.</td> +</tr> + +<tr> + +<td>quit</td> +<td></td> +<td></td> +<td>Alt+q</td> +<td>Quits the head unit.</td> +</tr> + +<tr> + +<td>sleep</td> +<td></td> +<td>[seconds]</td> +<td></td> +<td>Sleeps for one second. Specifying an argument (for example, <code>sleep 30</code>) causes the +system to sleep the specified number of seconds. This command +is useful if you are writing scripts for the DHU. (You can run a script by using I/O redirection +from the command line: <code>./desktop-head-unit < script.txt</code> loads commands from the +file <code>script.txt</code>.)</td> +</tr> + +<tr> + +<td>screenshot</td> +<td></td> +<td>filename.png</td> +<td></td> +<td>Saves a screenshot to <code>filename.png</code>.</td> +</tr> + + +<!--microphone--> + +<tr> +<td rowspan="3">Microphone</td> +<td rowspan="3">mic</td> +<td>begin</td> +<td></td> +<td>m </td> +<td>Activates the microphone (equivalent to clicking the steering wheel's microphone button) and +waits for input from the computer microphone.</td> +</tr> + +<tr> + + +<td>play</td> +<td>filename.wav</td> +<td></td> +<td>Causes the DHU to treat <code>filename.wav</code> as voice input, as if it had heard that sound + through the microphone. You do not hear the sound file being played, but you do hear + the response from Android Auto.</td> +</tr> + +<tr> + + +<td>repeat</td> +<td></td> +<td></td> +<td>Repeats the last <code>mic play</code> command, as if you had called <code>mic play</code> + again with the same sound file parameter.</td> +</tr> + +<!--Input--> + +<tr> +<td rowspan="7">Input</td> +<td rowspan="6">dpad</td> +<td>up <br> down <br> left <br> right</td> +<td></td> +<td>Arrow keys</td> +<td>Simulates moving the rotary controller.</td> +</tr> + +<tr> + + +<td>soft left <br> soft right</td> +<td></td> +<td>Shift+Arrow keys</td> +<td>Simulates pressing the side buttons available on some rotary controllers.</td> +</tr> + +<tr> + + +<td>click</td> +<td></td> +<td>Return</td> +<td>Simulates pressing the rotary controller.</td> +</tr> + +<tr> + + +<td>back</td> +<td></td> +<td>Backspace</td> +<td>Simulates pressing the <strong>back</strong> button available below some rotary + controllers.</td> +</tr> + +<tr> + + +<td>rotate left <br> rotate right</td> +<td></td> +<td>1 <br> 2</td> +<td>Simulates rotating the rotary controller left (counter-clockwise) or right (clockwise).</td> +</tr> + +<tr> + + +<td>flick left <br> flick right</td> +<td></td> +<td>Shift+1 <br> Shift+2</td> +<td>Simulates a fast spin of the rotary controller to the left (counter-clockwise) or right + (clockwise).</td> +</tr> + +<tr> + +<td>tap</td> +<td></td> +<td>x y</td> +<td></td> +<td>Simulates a touch event at the specified coordinates. For example, <code>tap 50 100</code></td> +</tr> + + +<!--Day/Night--> + +<tr> +<td rowspan="3">Day/Night</td> +<td>day</td> +<td></td> +<td></td> +<td>Shift+n</td> +<td>Activates day mode (high brightness, full color).</td> +</tr> + +<tr> + +<td>night</td> +<td></td> +<td> </td> +<td>Ctrl+n </td> +<td>Activates night mode (low brightness, high contrast).</td> +</tr> + +<tr> + +<td>daynight</td> +<td></td> +<td></td> +<td>n </td> +<td>Toggles current day/night mode.</td> +</tr> + +</table> + + + + +<h2 id="auto-simulators">Media Browser and Messaging Simulators</h2> + +<p class="caution"><strong>Important:</strong> Use of the Android Media Browser and Messaging +Simulators for testing Android Auto apps is deprecated. Instead, we recommend using the +Desktop Head Unit, which enables your development machine to act as if it were an Android Auto head +unit.</p> + +<p>To get the simulators, open the +<a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a> and download +them from <strong>Extras > Android Auto API Simulators</strong>.</p> + +<p>Before you begin testing, compile your app in your development environment. +Install your app and the Android simulator for the features you want to test +(that is, audio or messaging) on a physical or virtual device running Android +5.0 (API level 21) or higher. To check the version of Android on the device, go +to <strong>Settings > About phone</strong> (or <strong>About tablet</strong>) +<strong>> Android Version</strong>.</p> + +<h3 id="testing-audio-apps">Testing audio apps</h3> +<p>To run and test audio apps:</p> + +<ol> +<li>Install the Android Media Browser simulator +({@code <sdk>/extras/google/simulators/media-browser-simulator.apk}) on +the test device. You can do this using +the <a href="{@docRoot}tools/help/adb.html#move">adb</a> command line tool.</li> +<li>Enable <a href="{@docRoot}tools/device.html#developer-device-options"> +developer options</a> on the test device.</li> +<li>Install your app on the test device.</li> +<li>Launch the Android Media Browser simulator to see how your audio app +appears in Auto. If your app does not appear, stop the simulator from +<strong>Settings > Apps</strong> and restart it.</li> +</ol> + + +<h3 id="testing-messaging-apps">Testing messaging apps</h3> +<p>To run and test messaging apps:</p> + +<ol> +<li>Install the Android Messaging simulator + ({@code <sdk>/extras/google/simulators/messaging-simulator.apk}) +on the test device. You can do this using the +<a href="{@docRoot}tools/help/adb.html#move">adb</a> command line tool.</li> +<li>Enable the simulator to read notifications posted on the system: +<ol type="a"> + <li>Enable <a href="{@docRoot}tools/device.html#developer-device-options"> +developer options</a> on the test device.</li> + <li>Click <strong>Settings > Sounds & Notifications > Notification + Access</strong> and check the box labeled + <strong>Messaging Simulator</strong>.</li> +</ol> +<li>Install your app on the test device.</li> +<li>Launch the Android Messaging Simulator to see how your messaging app appears +in Auto. If your app does not appear, stop the simulator from +<strong>Settings > Apps</strong> and restart it.</li> +</ol> + + + + diff --git a/docs/html/tools/revisions/studio.jd b/docs/html/tools/revisions/studio.jd index c922b28..298b173 100644 --- a/docs/html/tools/revisions/studio.jd +++ b/docs/html/tools/revisions/studio.jd @@ -43,6 +43,29 @@ Android Studio, as denoted by revision number. </p> <div class="toggle-content opened"> <p><a href="#" onclick="return toggleContent(this)"> <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" + alt=""/>Android Studio v1.3.2</a> <em>(August 2015)</em> + </p> + <div class="toggle-content-toggleme"> + <p>Fixes and enhancements:</p> + <ul> + <li>Added support for Android 6.0 (API level 23), including new icons and AVD Manager + support for creating devices with new screen densities.</li> + <li>Fixed an exception that was occuring during update checks. + <a href="http://b.android.com/183068">Issue: 183068</a></li> + <li>Fixed problem where unresolved view coordinates could cause the layout editor to crash. + <a href="http://b.android.com/178690">Issue: 178690</a></li> + <li>Fixed issue with invalid resource type warnings. + <a href="http://b.android.com/182433">Issue: 182433</a></li> + <li>Fixed lint check that was incorrectly flagging resources as private. + <a href="http://b.android.com/183120">Issue: 183120</a></li> + </ul> + </div> +</div> + + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""/>Android Studio v1.3.1</a> <em>(August 2015)</em> </p> <div class="toggle-content-toggleme"> @@ -60,8 +83,6 @@ Android Studio, as denoted by revision number. </p> </div> - - <div class="toggle-content closed"> <p><a href="#" onclick="return toggleContent(this)"> <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" @@ -100,7 +121,7 @@ Android Studio, as denoted by revision number. </p> <li>Added <a href="{@docRoot}tools/data-binding/guide.html">data binding</a> support to create declarative layouts that bind your application logic to layout elements. </li> <li>Added support for a separate - <a href="{@docRoot}tools/studio/studio-features.html#test-module">test APK module</a> + <a href="{@docRoot}tools/studio/studio-features.html#test-module">test APK module</a> to build test APKs in Android Studio. </li> <li>Updated the <a href="{@docRoot}tools/help/avd-manager.html">AVD Manager</a> with HAXM optimizations and improved notifications. </li> diff --git a/docs/html/tools/sdk/eclipse-adt.jd b/docs/html/tools/sdk/eclipse-adt.jd index 08634da..3c12a64 100644 --- a/docs/html/tools/sdk/eclipse-adt.jd +++ b/docs/html/tools/sdk/eclipse-adt.jd @@ -53,6 +53,39 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues <div class="toggle-content opened"> <p><a href="#" onclick="return toggleContent(this)"> <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" + alt=""/>ADT 23.0.7</a> <em>(August 2015)</em> + </p> + + <div class="toggle-content-toggleme"> +<dl> + <dt>Dependencies:</dt> + + <dd> + <ul> + <li>Java 7 or higher is required if you are targeting Android 5.0 and higher.</li> + <li>Java 1.6 or higher is required if you are targeting other releases.</li> + <li>Eclipse Indigo (Version 3.7.2) or higher is required.</li> + <li>This version of ADT is designed for use with + <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r24.1.2</a>. + If you haven't already installed SDK Tools r24.1.2 into your SDK, use the + Android SDK Manager to do so.</li> + </ul> + </dd> + + <dt>General Notes:</dt> + <dd> + <ul> + <li>Fixed issues with the rendering library for the visual layout editor.</li> + </ul> + </dd> +</dl> +</div> +</div> + + +<div class="toggle-content closed"> + <p><a href="#" onclick="return toggleContent(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""/>ADT 23.0.6</a> <em>(March 2015)</em> </p> @@ -75,7 +108,7 @@ href="http://tools.android.com/knownissues">http://tools.android.com/knownissues <dt>General Notes:</dt> <dd> <ul> - <li>Fixed issues with the rendering library.</li> + <li>Fixed issues with the rendering library for the visual layout editor.</li> </ul> </dd> </dl> diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs index db19d4f..72f9f21 100644 --- a/docs/html/tools/tools_toc.cs +++ b/docs/html/tools/tools_toc.cs @@ -160,6 +160,7 @@ class="en">Tools Help</span></a></div> <li><a href="<?cs var:toroot ?>tools/help/avd-manager.html">AVD Manager</a></li> <li><a href="<?cs var:toroot ?>tools/help/bmgr.html">bmgr</a> <li><a href="<?cs var:toroot ?>tools/help/monitor.html">Device Monitor</a></li> + <li><a href="<?cs var:toroot ?>tools/help/desktop-head-unit.html">Desktop Head Unit</a></li> <li><a href="<?cs var:toroot ?>tools/help/dmtracedump.html">dmtracedump</a></li> <li><a href="<?cs var:toroot ?>tools/help/draw9patch.html">Draw 9-Patch</a></li> <li><a href="<?cs var:toroot ?>tools/help/emulator.html">Emulator</a></li> diff --git a/docs/html/training/auto/start/index.jd b/docs/html/training/auto/start/index.jd index 22e7521..f6cdbd1 100644 --- a/docs/html/training/auto/start/index.jd +++ b/docs/html/training/auto/start/index.jd @@ -16,7 +16,7 @@ page.image=auto/images/assets/icons/auto_app_in_simulator.png <ol> <li><a href="#dev-project">Set Up an Auto Project</a></li> <li><a href="#build-it">Build Auto Apps</a></li> - <li><a href="#test-it">Run and Test Auto Apps</a></li> + <li><a href="#test-it-dhu">Run and Test Auto Apps </a></li> </ol> <h2>You should also read</h2> @@ -149,57 +149,124 @@ requirements, you can reduce the effort for building and testing your app. For more information, see <a href="{@docRoot}distribute/essentials/quality/auto.html">Auto App Quality</a>.</p> -<h2 id="test-it">Run and Test Auto Apps</h2> -<p>As you prepare to publish your app, make sure that your app looks correct -when projected on the Auto user interface. Use the Android Media Browser -simulator and Android Messaging simulators to view and test your audio or -messaging apps in a screen that looks similar to what is projected on Auto.</p> -<p>To get the simulators, open the -<a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a> and download -them from <strong>Extras > Android Auto API Simulators</strong>.</p> +<h2 id="test-it-dhu">Run and Test Auto Apps </h2> -<p>Before you begin testing, compile your app in your development environment. -Install your app and the Android simulator for the features you want to test -(that is, audio or messaging) on a physical or virtual device running Android -5.0 (API level 21) or higher. To check the version of Android on the device, go -to <strong>Settings > About > Android Version</strong>.</p> +<p> + As you develop, you can run and test your app on your development machine + using the <em>Desktop Head Unit</em> (DHU). The DHU replaces the existing + simulators and enables your development machine to simulate a vehicle + dashboard system running Android Auto. +</p> -<h3 id="testing-audio-apps">Testing audio apps</h3> -<p>To run and test audio apps:</p> +<h3 id="installing-dhu">Installing the DHU</h3> <ol> -<li>Install the Android Media Browser simulator -({@code <sdk>/extras/google/simulators/media-browser-simulator.apk}) on -the test device. You can do this using -the <a href="{@docRoot}tools/help/adb.html#move">adb</a> command line tool.</li> -<li>Enable <a href="{@docRoot}tools/device.html#device-developer-options"> -developer options</a> on the test device.</li> -<li>Install your app on the test device.</li> -<li>Launch the Android Media Browser simulator to see how your audio app -appears in Auto. If your app does not appear, stop the simulator from -<strong>Settings > Apps</strong> then restart it.</li> + <li>Enable developer mode on your mobile device, as described in + <a href="{@docRoot}tools/device.html#developer-device-options">Enabling On-device + Developer Options</a>. </li> + <li>Compile your app in your development environment and install your app on + a physical mobile device running Android 5.0 (API level 21) or higher. To check the + version of Android on a Nexus device, go to + <strong>Settings > About phone</strong> (or <strong>About tablet</strong>) <strong>> + Android version</strong>.</li> + + <li>Install the + <a class="external-link" + href="https://play.google.com/store/apps/details?id=com.google.android.projection.gearhead&hl=en" + >Android Auto app</a> on the mobile device.</li> + <li>Open the <a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a> and + download the DHU package <strong>Android Auto Desktop Head Unit</strong> from the + <em>SDK Tools</em> tab. The DHU installs in the <code><sdk>/extras/google/auto/</code> + directory.</li> + <li>If you are running the DHU on Linux, you must also install + the portaudio, libpng, sdl2, and sdl2_ttf libraries. + The procedure to do this varies depending on your Linux distribution. For example, on + Debian-derived Linux distributions, you can install the libraries with this command: + +<pre class="no-pretty-print"> +$ sudo apt-get install libsdl2-2.0-0 libsdl2-ttf-2.0-0 libportaudio2 libpng12-0 +</pre> + + </li> </ol> -<h3 id="testing-messaging-apps">Testing messaging apps</h3> -<p>To run and test messaging apps:</p> +<div class="figure" style="width:330px"> + <img src="{@docRoot}images/training/auto-desktop-head-unit-server-running.png" + alt="" > + <p class="img-caption"> + <strong>Figure 2.</strong> Notification that the head unit server is running. + </p> +</div> +<img src="{@docRoot}images/training/auto-desktop-head-unit-context-menu-enabled.png" + alt="" > +<p class="img-caption"> + <strong>Figure 1.</strong> Context menu with developer options. +</p> + +<h3 id="connecting-dhu">Connecting the DHU to your mobile device</h3> + +<p>Run the DHU by connecting your mobile device to a development machine and setting up a connection to + the head unit server over <a href="{@docRoot}tools/help/adb.html">Android Debug Bridge + (ADB)</a>. Follow these steps to set up tunneling and start the DHU:</p> <ol> -<li>Install the Android Messaging simulator - ({@code <sdk>/extras/google/simulators/messaging-simulator.apk}) -on the test device. You can do this using the -<a href="{@docRoot}tools/help/adb.html#move">adb</a> command line tool.</li> -<li>Enable the simulator to read notifications posted on the system: -<ol type="a"> - <li>Enable <a href="{@docRoot}tools/device.html#device-developer-options"> -developer options</a> on the test device.</li> - <li>Click <strong>Settings > Sounds & Notifications > Notification - Access</strong> and check the box labeled - <strong>Messaging Simulator</strong>.</li> -</ol> -<li>Install your app on the test device.</li> -<li>Launch the Android Messaging Simulator to see how your messaging app appears -in Auto. If your app does not appear, stop the simulator from -<strong>Settings > Apps</strong> then restart it.</li> + <li>On the mobile device, enable Android Auto developer mode by starting the Android Auto + companion app, and then tapping the header image 10 times. + This step is only required the first time you run the companion app. + </li> + <li>If the server is not already running, select <strong>Start head unit server</strong> + from the Android Auto menu. + <p>On the device, a foreground service appears in the notification area. </p> + </li> + + <li>Connect the mobile device to the development machine via USB. Your device must be unlocked to + launch the DHU. + </li> + <li>On the development machine, run the following {@code adb} command to + forward socket connections from the + development machine's port 5277 to the same port number on the Android device. + This configuration allows the DHU to connect to the head unit server running on your phone over + a TCP socket. + <pre class="no-pretty-print">$ adb forward tcp:5277 tcp:5277</pre> + </li> + + <li>Start the DHU by running the command <code>desktop-head-unit.exe</code> (on Windows) + or <code>./desktop-head-unit</code> (on Mac or Linux) from the + <code><sdk>/extras/google/auto/</code> directory. + +<pre class="no-pretty-print">$ cd <sdk>/extras/google/auto +$ ./desktop-head-unit</pre> + + <p> + By default, the head unit server connects over port 5277. To override the host or port + (for example, to forward over SSH), use the <code>--adb</code> flag. + </p> + + </li> </ol> + +<div class="figure" style="width:432px"> + + <img src="{@docRoot}images/training/auto-desktop-head-unit-wkst-launch.png" + alt="" > + <p class="img-caption"> + <strong>Figure 4.</strong> DHU launches on the development machine. + </p> +</div> + + <img src="{@docRoot}images/training/auto-desktop-head-unit-launch.png" + alt="" > + <p class="img-caption"> + <strong>Figure 3.</strong> Android Auto launches on the mobile device. + </p> + +<p> + After you set up and start the DHU, you can run DHU commands from the command line to run and + test your app from the terminal. You can also run these commands by using keyboard shortcuts. For + more information about DHU configuration and commands, see <a href= + "{@docRoot}tools/help/desktop-head-unit.html">Desktop Head Unit</a>. +</p> + + |