doc/articles/features/android-auto.md
Uno Platform supports Android Auto and Android Automotive OS, allowing your application to extend into the in-car experience using the AndroidX Car App Library.
UnoFeatures (recommended)For projects using the Uno.Sdk, add the AndroidAuto feature to your project's <UnoFeatures> property:
<UnoFeatures>$(UnoFeatures);AndroidAuto</UnoFeatures>
This automatically adds a reference to the Xamarin.AndroidX.Car.App.App package. New projects created from the Uno Platform templates with the Android Auto option enabled will also have the required manifest entries and the automotive_app_desc.xml resource stamped automatically.
When the AndroidAuto feature is enabled, the template stamps the following declarations into your AndroidManifest.xml:
<meta-data android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc" />
It also adds an automotive_app_desc.xml resource file under Resources/xml/:
<?xml version="1.0" encoding="utf-8"?>
<automotiveApp>
<uses name="media" />
</automotiveApp>
The <uses> element declares which categories of Auto experiences your app provides (media, template, etc.). For a navigation, point-of-interest, or messaging app, change media to template and add a CarAppService declaration in your manifest.
To host content in Android Auto / Automotive OS, you must provide a CarAppService derived class that exposes a Session and root Screen. Refer to the Android Auto developer guide and the AndroidX Car App Library documentation for the full API surface.
You can test Android Auto integration locally using the Desktop Head Unit (DHU) tool that ships with Android Studio. Pair a phone (real or emulator) running your application to DHU and confirm the app appears in the Auto launcher.
The opt-in described above produces a single APK that exposes both a phone experience and an Auto / Automotive experience. If you need to publish them separately (for example, an Automotive OS-only build for in-car infotainment), the recommended approach is to ship two separate Uno Platform apps:
AndroidAuto opt-in.AndroidAuto opt-in enabled.To set up the car-only app:
dotnet new unoapp -o MyApp.Car) targeting Android, and enable the AndroidAuto opt-in.<uses-feature android:name="android.hardware.type.automotive" android:required="true" /> to the manifest so the APK only installs on Automotive OS head units.com.companyname.myapp.car) so the car app and phone app can coexist on the Play Store as separate listings.