Petter Holt Juliussen • Mail | Mastodon | GitHub | Letterboxd

for later reference.

Android Auto

2019-04-04

To enable an app for Auto, the app must target Android 5.0 (API level 21) or higher. Android Auto handles most of the work to adjust each application's user interface to the screen on which it is displayed. The app’s manifest must also declare the car capabilities that it uses, such as audio playback or messaging services.

Car UI Controller

com.google.android.apps.auto.sdk.CarUiController

CarUiController controller = getCarUiController();

Statusbar Controller

// Title
controller.getStatusBarController().setTitle("Title");
controller.getStatusBarController().hideTitle();
controller.getStatusBarController().isTitleVisible()
controller.getStatusBarController().showTitle();

// Day/Night
controller.getStatusBarController().setDayNightStyle(DayNightStyle.AUTO);

// App bar (deprecated?)
controller.getStatusBarController().hideAppHeader();
controller.getStatusBarController().setAppBarAlpha(0.0f);
controller.getStatusBarController().setAppBarBackgroundColor(Color.WHITE);
controller.getMenuController().hideMenuButton();

Drawer Controller

controller.getDrawerController().openDrawer();
controller.getDrawerController().closeDrawer();
controller.getDrawerController().isDrawerOpen();
controller.getDrawerController().isDrawerVisible();
controller.getDrawerController().setDrawerCallback(DrawerCallback drawerCallback);
controller.getDrawerController().setScrimColor(int i);

Search Controller

controller.getSearchController().showSearchBox();
controller.getSearchController().hideSearchBox();
controller.getSearchController().setSearchCallback(SearchCallback searchCallback);
controller.getSearchController().setSearchHint(CharSequence charSequence);

Notifications

NotificationCompat.CarExtender

Helper class contained in the v4 support library to add Android Auto extensions to notifications.

Resources

Google * Android Auto - Android Developers * Design Guidelines - Google Design

GitHub * dirkvranckaert/AndroidAutoHelloWorld - Hello World * martoreto/aauto-sdk-demo - Android Auto SDK Demo App * borconi/obd2aa - extension for Torque Pro to display OBD data on an Android Auto compatible screen * slashmax/AAMirror

StackOverflow * Develop an Android Auto custom app

Other * My Journey on developing a Custom Android Auto app - Medium (Oct 12, 2017)