Android Auto-Building Apps for Auto,Getting Started with Auto
>Building Apps for Auto
These systems provide a simplified interface for apps that can be used in a car, allowing users to take your app with them on the way to the grocery store or on a long road trip.
Apps that work with Android Auto consoles run on a connected device, such as a phone or tablet. The
app communicates via specific APIs with the in-dash console, which provides a user interface for the connected app that is designed for use in a car.
> Getting Started with Auto
> Android Auto extends the Android platform into the car. When users connect their handheld devices
running Android 5.0 or higher to a compatible vehicle, the Auto user interface provides a car-optimized Android experience on the vehicle's screen. Users interact with compatible apps and services through voice actions and the vehicle's input controls (like
a touchscreen or dashboard buttons).
> Auto currently supports two types of apps:
- Audio apps that allow users to browse and play music and spoken audio content in the car.
- Messaging apps that receive incoming notifications, read messages aloud via text-to-speech, and send replies via voice input in the car.
- Create or update your app project - Android 5.0 (API level 21)
provides new APIs for implementing audio playback and messaging that is compatible with Auto. To access the new APIs, create a project or modify an existing project to target Android 5.0 (API level 21) or higher. This means you must set the manifest
targetSdkVersion
to 21 or higher. - Install the support library - If you are building messaging apps
for Auto, you need the
NotificationCompat.CarExtender
class contained in the v4 support library. This class allows you to create notifications that are compatible with Auto devices.
> heautomotive_app_desc.xml
file
contains the following metadata:
<automotiveApp> <uses name="media" /> </automotiveApp>
>The <uses>
element declares the Auto capability your app intends to use. Multiple <uses>
tags can be added if your application uses multiple car capabilities. The name
attribute indicates the
specific capability your app uses. The values supported are:
media
- The app uses the Android framework APIs to play music in a vehicle. Set this value if you are enabling an audio app for Auto.notification
- The app displays message notifications in the car’s Overview screen, allows users select a message to be read aloud, and lets them respond through voice input. Set this value if you are enabling a messaging app for Auto.
> Run the DHU by connecting your mobile device to a development machine and setting up a connection to the head unit server over Android Debug Bridge (ADB). Follow these steps to set up tunneling and start the DHU:
- On the mobile device, enable Android Auto developer mode by starting the Android Auto companion app, and then tapping the Android Auto toolbar title 10 times. This step is only required the first time you run the companion app.
- If the server is not already running, select Start head unit server from the Android Auto menu.
On the device, a foreground service appears in the notification area.
- In the Android Auto app, make sure the Only connect to known cars option is disabled.
- Connect the mobile device to the development machine via USB.
- Make sure the mobile device has its screen unlocked, otherwise it cannot launch the DHU.
- On the development machine, run the following
adb
command to forward socket connections from the development machine's port 5277 to the same port number on the Android device. This configuration allows the DHU to connect to the head unit server running on your phone over a TCP socket.$ adb forward tcp:5277 tcp:5277
- Start the DHU by running the command
desktop-head-unit.exe
(on Windows) or./desktop-head-unit
(on Mac or Linux) from the<sdk>/extras/google/auto/
directory.$ cd <sdk>/extras/google/auto $ ./desktop-head-unit
By default, the head unit server connects over port 5277. To override the host or port (for example, to forward over SSH), use the
desktop-head-unit --adb <[localhost:]port>
flag, as in the following example:$ ./desktop-head-unit --adb 5999
相關文章
- android auto-Providing Audio Playback for AutoAndroid
- Beaglebone - Getting Started
- getting started with transformjsORMJS
- Windows HLK Getting StartedWindows
- android auto-Providing Messaging for Auto(UnreadConversation)Android
- 在 Android 上使用協程(二):Getting startedAndroid
- 谷歌釋出Android Auto API谷歌AndroidAPI
- Hive Getting Started補充Hive
- Android TV-Building TV Apps,Get Started with TV AppsAndroidUIAPP
- auto型別型別
- inherit與auto
- Auto CAD
- Firebase Tutorial: Getting Started 教程翻譯
- 關於 MYSQL auto_increment_offset和auto_increment_incrementMySqlREM
- mysql的auto_increment_offset和auto_increment_increment配置MySqlREM
- auto_ptr_ref和auto_ptr的關係 (轉)
- z-index:autoIndex
- macOS Development - Auto LayoutMacdev
- MySQL AUTO_INCREMENTMySqlREM
- Auto關鍵字
- 優雅地亂玩Redux: Getting StartedRedux
- redis:auto-completeRedis
- C++ auto變數變數
- 11g auto maintenanceAINaN
- margin:0 auto;不居中
- MKNetworkKit Auto Caching
- Linux auto-mountLinux
- C++ 14 auto 教程C++
- MySQL的AUTO_INCREMENTMySqlREM
- Joomla & Toad auto traceOOM
- 一起看 I/O | Android Auto 更新一覽Android
- [譯] CSS Grid 之列寬自適應:`auto-fill` vs `auto-fit`CSS
- 【DocFX文件翻譯】DocFX 入門 (Getting Started with DocFX)
- AUTO START ORACLE ON LINUX(zt)OracleLinux
- auto_ptr原始碼分析原始碼
- margin系列之keyword auto
- auto_ptr 智慧指標指標
- AUTO_INCREMENT ON the MyISAM STORAGE ENGINEREM