# Package com.codename1.car

package com.codename1.car

Portable in-car UI for Apple CarPlay and Google Android Auto. Apps describe their car experience once with a small catalogue of driver-safe templates (`CarListTemplate`, `CarGridTemplate`, `CarPaneTemplate`, `CarMessageTemplate`, `CarNavigationTemplate`, `CarNowPlayingTemplate`) and Codename One renders them as native `CPTemplate`s on CarPlay and `androidx.car.app` templates on Android Auto.

Register a `CarApplication` with `Car#setApplication(CarApplication)` from your app's `init()`. The car platforms are template-based, so you cannot show a regular Codename One `Form` on the head unit -- use the template catalogue. On the simulator and on ports without in-car projection the API is an inert no-op and `Car#isCarConnected()` returns false, so application code needs no platform conditionals.

Merely referencing this package makes the build wire the native plumbing (the CarPlay scene and entitlement on iOS, the `androidx.car.app` dependency and `CarAppService` on Android); apps that never use it pay nothing. See the "In-Car Experiences" chapter of the developer guide.

- Related Packages
  Package
  Description
  com.codename1.car.spi
  Internal service-provider interface for the `com.codename1.car` in-car API.
- Class
  Description
  Car
  The static entry point for Apple CarPlay and Google Android Auto support.
  CarAction
  A tappable action -- a button shown in a `CarActionStrip`, a header action, or an action attached to a `CarPaneTemplate` / `CarMessageTemplate`.
  CarActionListener
  Callback invoked when the user activates an in-car element -- a `CarRow`, `CarGridItem` or `CarAction`.
  CarActionStrip
  An ordered set of `CarAction`s shown together in a head-unit action bar -- a template header strip or the navigation map controls.
  CarApplication
  The entry point an app implements to provide its in-car (Apple CarPlay / Google Android Auto) experience.
  CarColor
  A small, head-unit-safe colour palette for `CarAction` backgrounds and accents.
  CarConnectionListener
  Notified when a head unit (Apple CarPlay / Google Android Auto) connects or disconnects.
  CarContext
  The live handle to a connected head unit.
  CarGridItem
  A single cell in a `CarGridTemplate`: a large image with a short title and optional secondary text.
  CarGridTemplate
  A grid of image-forward `CarGridItem`s -- browse categories, station presets, playlist artwork.
  CarListTemplate
  A scrolling list of selectable rows, optionally grouped into `CarSection`s, with an optional header `CarActionStrip`.
  CarMessageTemplate
  A short message with an icon and action buttons -- an error/empty state, a permission prompt, or (for communication apps) an incoming-message card with read-aloud and voice-reply actions.
  CarNavigationTemplate
  A turn-by-turn navigation surface: a drawable map (via a `CarSurfaceCallback`), an optional next-manoeuvre / arrival info strip, and map-control action strips.
  CarNowPlayingTemplate
  The system now-playing surface for audio apps.
  CarPaneTemplate
  A detail pane: a handful of informational `CarRow`s (label / value lines) plus up to two action buttons.
  CarRow
  A single selectable row in a `CarListTemplate`.
  CarScreen
  One screen of the in-car experience -- the unit of the head-unit back stack.
  CarSection
  A titled group of `CarRow`s within a `CarListTemplate`.
  CarSurfaceCallback
  The drawing surface callback for a `CarNavigationTemplate`.
  CarTemplate
  The base type for the fixed catalog of in-car templates.