This directory contains sample apps that use Android for Cars App Library. Please find the library documentation at https://developer.android.com/training/cars/navigation.
In order to build app APKs,
Open the project in Android Studio: File -> Open -> Select this directory and click OK.
Select a sample app directory (e.g. helloworld
) in the Project Structure
UI on the top left.
Go to Build -> Make Module ‘androidx.car.app.app-samples.<sample_app>’. The apks will be generated in <sample_app>/build/outputs/apk
.
In order to install and run the apps,
Open the AndroidX project in Android Studio.
Go to Run -> Edit Configurations, select your app (e.g. car.app.app-samples.helloworld
), and in the General tab, under Launch Options, select Launch: Nothing, then click OK to close the dialog.
Select Run -> Run ‘your app’, to run the app, which will just install it in the selected device.
./gradlew :showcase:assemble
The APK should be generated under your app’s build directory, e.g. your_app/build/outputs/apk/debug.
If you see this error during the build:
```shell > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your projects local properties file at <repo_path>/car/car_app_library/local.properties ```
Create local.properties
file under car_app_library
directory, and copy the following line:
``` sdk.dir = <your_home_directory>/Android/Sdk ```
adb install -t <path_to_your_apk>
Follow the instructions in Test Android apps for cars to run the sample apps in the DHU.
In short, do the following:
Note: In Android Q, there is no Android Auto app in the launcher. The way to get to the settings in that case is through Settings -> Apps & Notifications -> See all apps -> Android Auto -> Advanced -> Additional settings in the app.