Testing Android Auto using the Desktop-Header unit

The desktop-header unit (DHU) is a tool provided by Google to simulate Android Auto on your computer. It allows your phone to connect to your computer via USB and then allows DHU to directly interface with the Android Auto installed on your phone.

Here are the steps to test Android Auto using DHU:

  1. On your Android phone, download and install Android Auto from the Google Play Store:
Android Auto on Google Play Store
  1. Open Android Auto.
  2. Click on the hamburger menu and go to About.
  3. Click on About Android Auto until you get a message saying that the developer mode is enabled.

The following image shows About Android Auto:

About Android Auto
  1. Once developer mode is enabled, Android Auto is activated. Go to the top-right corner, click on the three vertical dots, and choose Start head-unit server.

The following image shows starting the header-unit server on Android Auto:

Started header-unit server
  1. Click on the three vertical dots in the top-right corner and choose Developer settings.
  2. Set Application Mode to Developer, enable Unknown sources, and exit out by hitting the back button on your phone.

The following image shows the Android Auto developer settings:

Android Auto developer settings
  1. Open Visual Studio 2017.
  2. Go to File | Open | Project/Solution, go to your MyPodCast directory, and choose the MyPodCast.sln file.
  3. Connect your Android phone to your computer using USB.
  4. Go to Tools | Options and choose Xamarin | Android Settings. Take note of the Android SDK Location:
Android SDK Location
  1. Go to Tools | Android | Android Adb Command Prompt.
  2. On the command prompt, go to [location from step 12]\extras\google\auto directory by typing cd [location from step 13]\extras\google\auto directory
  3. On the command prompt, type adb forward tcp:5277 tcp:5277.
  1. On the command prompt, type desktop-head-unit.exe.
  2. On your phone, you will be getting Android Auto setup prompts about What will Android Auto do? Click Continue:
Android Auto setup prompt
  1. On your phone, Android Auto setup will prompt you to use Google Assistant. Click CONTINUE:
Android Auto and Google Assistant
  1. On your computer, you will see the DHU. Click SKIP:
Desktop header unit setup
  1. In Visual Studio, click F5 to run the MyPodCast project. It will deploy MyPodCast to your phone but it will run on Android Auto.
  2. Once the MyPodCast project is deployed, go to the DHU. Click on the headphone icon until the list of music services is displayed:
DHU music service list
  1. You will see the list of music services for Android Auto, such as Google Play Music, Spotify, and the Henry Podcast Service that you created. Click on Henry Podcast Service.
  2. Click on the Podcast by Henry menu in the top right | All Podcasts | January | Morir con Honor.

The following image shows the DHU playing podcast-streaming from the Microsoft Azure blob storage:

DHU playing podcast

In the next section, you will be deploying your podcast and playing it in your car.