Skip to content

Android Auto Setup

Oguzhan Atalay edited this page Jan 24, 2026 · 1 revision

Android Auto Setup

🚧 Android Auto support is newer and not all features are available yet. See the feature comparison below.

Prerequisites

  • Android SDK 23+ (minSdkVersion)
  • Android Auto app installed on device/emulator

Step 1: Update AndroidManifest.xml

Add the Android Auto metadata to android/app/src/main/AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        android:label="your_app"
        ...>
        
        <!-- Android Auto metadata -->
        <meta-data
            android:name="com.google.android.gms.car.application"
            android:resource="@xml/automotive_app_desc" />
            
        <!-- Your other activities and services -->
        
    </application>
</manifest>

Step 2: Create automotive_app_desc.xml

Create android/app/src/main/res/xml/automotive_app_desc.xml:

<?xml version="1.0" encoding="utf-8"?>
<automotiveApp>
    <uses name="template" />
</automotiveApp>

Step 3: Usage in Dart

Android Auto uses a separate controller from CarPlay:

import 'package:flutter_carplay/flutter_carplay.dart';
import 'dart:io';

class CarPlayManager {
  FlutterCarplay? _carplay;
  FlutterAndroidAuto? _androidAuto;

  void init() {
    if (Platform.isIOS) {
      _carplay = FlutterCarplay();
      _setupCarPlay();
    } else if (Platform.isAndroid) {
      _androidAuto = FlutterAndroidAuto();
      _setupAndroidAuto();
    }
  }

  void _setupCarPlay() {
    FlutterCarplay.setRootTemplate(
      rootTemplate: _buildRootTemplate(),
      animated: true,
    );
  }

  void _setupAndroidAuto() {
    _androidAuto?.setRootTemplate(
      rootTemplate: _buildRootTemplate(),
    );
  }

  CPListTemplate _buildRootTemplate() {
    return CPListTemplate(
      sections: [
        CPListSection(
          header: 'My App',
          items: [
            CPListItem(
              text: 'Item 1',
              detailText: 'Description',
              onPress: (complete, item) {
                complete();
              },
            ),
          ],
        ),
      ],
      title: 'Home',
      systemIcon: 'house.fill', // iOS only, ignored on Android
    );
  }
}

Feature Comparison

Feature CarPlay (iOS) Android Auto
List Template βœ… βœ…
Tab Bar Template βœ… 🚧 Partial
Grid Template βœ… 🚧 Partial
Alert Template βœ… ❌
Action Sheet Template βœ… ❌
Information Template βœ… ❌
POI Template βœ… ❌
Now Playing βœ… ❌ (use audio_service)
Map Template 🚧 Planned 🚧 Planned
Search Template 🚧 Planned 🚧 Planned

Testing Android Auto

Using Desktop Head Unit (DHU)

  1. Install Android Auto on your device/emulator
  2. Download the Desktop Head Unit from Android Studio
  3. Enable developer mode in Android Auto app
  4. Run: ./desktop-head-unit

Using a Real Car

Connect your phone to a car with Android Auto support. Your app should appear in the launcher.

Now Playing on Android Auto

For audio apps, Android Auto's Now Playing is handled through the audio_service package, not flutter_carplay. This is because Android Auto has its own media framework.

See the audio_service package for media app integration.

Troubleshooting

See Troubleshooting for common Android Auto issues.

Clone this wiki locally