A comprehensive guide to working with Android Automotive templates, highlighting their features, limitations, and best practices.
Before diving into the project, it is strongly recommended to thoroughly review this documentation Gitbook
Welcome to the Android Automotive Templates project! This guide provides in-depth information on utilizing Android Automotive templates, addressing their strengths and limitations.
Follow these steps to set up the Android Virtual Device (AVD) for Polestar 2 System Image:
- Open Android Studio.
- Navigate to
Tools > SDK Manager
. - In the
SDK Platforms
tab, click on theSDK Updates Sites
tab. - Click the '+' icon to add a new repository.
- Give the repository a name, e.g., "Polestar 2 System Image."
- Add the following URL:
https://developer.polestar.com/sdk/polestar2-sys-img.xml
. - Click 'OK' to save the repository.
- In the
SDK Platforms
tab, enableShow Package Details
. - Inside the Android version you are working with (e.g., Android 10 or 9), find and enable " Polestar 2."
- Click 'Apply' to initiate the download and installation of the Polestar 2 System Image.
- Open the
Device Manager
by navigating toTools > AVD Manager
. - Click on
Create Virtual Device
and Select automotive. - Choose the hardware profile that matches your target Polestar 2 system image. If there is none, import a hardware profile.
- To import a hardware profile,click on
Import Hardware Profiles
, then enter the system image URL ( e.g.,C:\Users\your_user_name\AppData\Local\Android\Sdk\system-images\android-29\polestar_emulator\x86_64\devices.xml
) and press 'OK'. - Once the hardware profile is selected, press 'Next' and complete the AVD creation process.
Now you have set up the AVD with the Polestar 2 System Image. You can use this virtual device for testing and development in your Android Automotive project.
Before getting started with this project, ensure that you have the following prerequisites:
-
Android Development Knowledge: A basic understanding of Android app development concepts is essential.
-
Kotlin Functional Programming: Familiarity with Kotlin programming language, especially its functional programming features.
-
Thread Handling: Proficiency in managing threads and asynchronous programming in Android using features like coroutines.
-
Scope Functions: Understanding of Kotlin scope functions (let, apply) and their appropriate usage in Android development.
-
Basic Knowledge of Templates: A basic understanding of working with templates in Android development, including how to integrate and customize them for your project.
Clone the repository:
git clone https://github.com/akshaySavanoor/AndroidAutomotive
cd AndroidAutomotive
run
To configure your application, create a directory named app_secrets. Within this directory, add a file named ApiKey with the following content:
object ApiKey {
const val API_KEY = "31xxxxxxxxxxxxxxxxxxxxxxb0"
const val BASE_URL = "https://api.openweathermap.org/data/2.5/"
const val DUMMY_LOGIN_URL = "https://practicetestautomation.com/practice-test-login/"
}
Visit 'https://home.openweathermap.org/api_keys' to obtain a free weather API key.