The base class for implementing a car app that runs in the car.
Service DeclarationThe app must extend the
CarAppServiceto be bound by the car host. The service must also respond to
Intentactions coming from the host, by adding an
intent-filterto the service in the
AndroidManifest.xmlthat handles the
SERVICE_INTERFACEaction. The app must also declare what category of application it is (e.g.
CATEGORY_NAVIGATION_APP). For example:
<service android:name=".YourAppService" android:exported="true"> <intent-filter> <action android:name="androidx.car.app.CarAppService" /> <category android:name="androidx.car.app.category.NAVIGATION"/> </intent-filter> </service>
For a list of all the supported categories see Supported App Categories.
Accessing LocationWhen the app is running in the car display, the system will not consider it as being in the foreground, and hence it will be considered in the background for the purpose of retrieving location as described here.
To reliably get location for your car app, we recommended that you use a foreground
service. If you have a service other than your
CarAppService that accesses
location, run the service and your `CarAppService` in the same process. Also note that
accessing location may become unreliable when the phone is in the battery saver mode.
Used to declare that this app is a charging app in the manifest.
Used to declare that this app is a navigation app in the manifest.
Used to declare that this app is a parking app in the manifest.
The full qualified name of the