AndroidAutoConfig

Configuration object for Android Auto integration.

This object holds configuration values that allow the Android Auto module to be reused across different applications. It removes the need for hardcoded class names and package names.

Usage

Configure this object early in your application's lifecycle, typically in your Application.onCreate() or MainActivity.onCreate():

AndroidAutoConfig.mainActivityClassName = "com.example.myapp.MainActivity"

Configuration Values

  • mainActivityClassName: The fully qualified class name of the main activity that should be launched when Android Auto needs to start the phone app. This is required for cold-start scenarios where the phone app isn't running.

  • applicationPackageName: Optional. The application package name. If not set, the package name will be derived from the CarContext at runtime.

See also

Properties

Link copied to clipboard

The application package name.

Link copied to clipboard

The fully qualified class name of the main activity to launch.

Link copied to clipboard
const val MAX_DISPLAYED_ROUTES: Int = 2

Maximum number of routes to display on the Android Auto route preview screen.

Functions

Link copied to clipboard

Validates that required configuration values are set.

Link copied to clipboard
fun reset()

Resets all configuration to default values.