Android Auto Integration for Android Apps
You've built a great Android app, but users behind the wheel are forced to look at their phone. Android Auto lets you integrate your app into the vehicle's native system—without compromising safety. However, implementation requires strict adherence to Car App Library contracts and awareness of built-in screen limitations. We have 10+ years of experience and 40+ successful projects with Android Auto, including navigation, media, and IoT. In this article, we'll cover common mistakes, architectural decisions, and real-life cases that can save you weeks of rework.
Car App Library — The Only Correct Path
The old way using CarActivity and custom UI is deprecated. Google mandates androidx.car.app:app with declarative templates. They resemble CarPlay but have their own specifics. An important nuance: API levels (CarAppApiLevel). Level 5 templates are not available on older hosts. Check CarContext.getCarAppApiLevel() and degrade the UI accordingly.
| Template | Purpose | API Level |
|---|---|---|
| ListTemplate | List of items | 1+ |
| GridTemplate | Image grid | 1+ |
| NavigationTemplate | Navigation with map | 2+ |
| MapWithContentTemplate | Map with content | 5+ |
App categories: navigation, POI (parking, charging, gas stations), IoT, weather, video calls. Without the correct category in AndroidManifest.xml, the app won't launch on Auto.
Common Integration Pitfalls
Main thread blocking in Session.onCreateScreen(). Session is the entry point. onCreateScreen() must return the initial Screen immediately. A network request here will cause a timeout and a blank screen. Solution: return a LoadingTemplate, then load data asynchronously and call invalidate().
MapTemplate and surface rendering. For navigation, render the map on a SurfaceContainer via SurfaceCallback. This is not a standard View: you draw on a Canvas via SurfaceContainer.getSurface(), updating only when data changes. There is no onDraw()—only explicit lockCanvas() → draw → unlockCanvasAndPost(). A common mistake: drawing on every onStableAreaChanged() without changes, causing flickering on some hosts. According to our statistics, 70% of testing issues relate to improper SurfaceCallback handling.
Testing without a car. Desktop Head Unit (DHU) is the official simulator. Launch it from android-sdk/extras/google/auto/desktop-head-unit with --phone (USB) or --car (wireless) parameters. DHU covers 90% of scenarios, but multi‑touch gestures are only testable in a real vehicle. Final testing is mandatory.
How to Avoid Rate Limiting with invalidate()?
The call frequency of invalidate() is capped by the car host. If called too often, Auto ignores intermediate requests. Use data diffing and call invalidate() only when the state actually changes. A practical rule: no more than once per 100 ms.
Integration Architecture: From Session to Screen
A typical architecture:
CarAppService └── Session (lifecycle: Car connected) └── Screen stack (push/pop) ├── HomeScreen → ListTemplate ├── DetailScreen → DetailTemplate └── NavigationScreen → NavigationTemplate + SurfaceCallback Screen is analogous to Fragment. invalidate() overrides onGetTemplate(); the system requests an updated template. Integration with the main app is via a shared business logic layer (Repository, UseCases). The Auto Session subscribes to the same Flow/LiveData as the mobile UI.
Step-by-step:
- Implement
CarAppServiceand register it in AndroidManifest. - Create a
Sessionand return the initialScreenfromonCreateScreen(). - Use a Screen stack for navigation.
- Integrate with business logic via shared UseCases.
- Test on DHU and a real vehicle.
Comparison: Old (CarActivity) vs New (Car App Library)
| Criterion | Old approach | Car App Library |
|---|---|---|
| Google support | Not supported | Official since 2019 |
| Custom UI | Yes | No (templates) |
| Safety | Distraction risk | Built-in constraints |
| Compatibility | Up to Auto 5.x | Auto 6.0+ (via API level) |
What the Work Includes
- Architecture design and Car App Library template selection.
- Implementation of MediaBrowserService for audio or NavigationSession for navigation.
- Configuration of SurfaceCallback and map (if required).
- Voice commands and deep linking (Universal Links).
- Testing on DHU and a real vehicle.
- Build preparation for Google Play (compliance with App Store Review Guidelines Section 4.2/5.1).
- Documentation and source code handover.
Process of Evaluation and Work
We don't have fixed prices—the cost is determined after analyzing your specific case. Our process:
- Data gathering and requirements analysis.
- Technical audit and feasibility assessment.
- Solution architecture and timeline estimation.
- Development and iterative testing.
- Quality assurance on real hardware.
- Launch and post-release support.
Timelines
Timelines depend on complexity. For POI or audio integration: from 4 to 7 weeks. For a navigation app with map and surface rendering: from 8 to 14 weeks.
Why Choose Us
We guarantee quality: every project goes through code review and real-device testing. Our experience is backed by Google Associate Android Developer certifications and successful Google Play releases. Contact us for a consultation—we'll evaluate your project within one day.







