Android Auto provides a system that manage in-vehicle console which helps Android users to connect their devices such as phone
and tablet to in-dash console. The app communicates via specific APIs with the in-dash console, which provides a user interface for the connected app is designed for use in a car.
Android Auto apps do not directly control a car dashboard device that runs the system. When the user connects an Android mobile device into a dashboard system, Android Auto discovers your app through manifest entries that indicate what services your app can provide. The dashboard system displays a launcher icon for your app as a provider and the user can choose to use your app's services. If the user launches your app, the Auto device queries your app to see what content is available, displays your content items to the user, and sends requests to your app to control with actions.
Auto currently supports two types of apps:-
2)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.
3)Define the Auto XML configuration file - Specify the car capabilities that your app uses in an XML file that you place in your project’s resources directory (res/xml/).
Such as to extend an audio application for Auto, create a file called automotive_app_desc.xml and store it under your projects’s res/xml/ folder. The automotive_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.
and tablet to in-dash console. The app communicates via specific APIs with the in-dash console, which provides a user interface for the connected app is designed for use in a car.
Android Auto apps do not directly control a car dashboard device that runs the system. When the user connects an Android mobile device into a dashboard system, Android Auto discovers your app through manifest entries that indicate what services your app can provide. The dashboard system displays a launcher icon for your app as a provider and the user can choose to use your app's services. If the user launches your app, the Auto device queries your app to see what content is available, displays your content items to the user, and sends requests to your app to control with actions.
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.
Following steps are used to build up Android Auto Application:-
1)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.
1)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.
2)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.
3)Define the Auto XML configuration file - Specify the car capabilities that your app uses in an XML file that you place in your project’s resources directory (res/xml/).
Such as to extend an audio application for Auto, create a file called automotive_app_desc.xml and store it under your projects’s res/xml/ folder. The automotive_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.
4)Add a manifest entry - In your app’s manifest (AndroidManifest.xml), provide a reference to the Auto XML configuration file you created in the previous section. Add a "com.google.android.gms.car.application" metadata entry under the <application> element that references your Auto XML configuration file.
The following code snippet shows how to include this reference in your manifest.
<application>
...
<meta-data android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc"/>
</application>
<application>
...
<meta-data android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc"/>
</application>
5)Finally, appropriate development can be done for required application.
Refer below android developer site for more information,
No comments:
Post a Comment