I'm currently developing app for Android Auto (Android for cars). I need to know when user connected phone to car. Is there any action like Intent.ACTION_POWER_CONNECTED, which I can observe in my application code?
You can use the CarConnection
API from the Android for Cars App Library. Note that, unlike most other APIs in the library, you just need a Context
and not a CarContext
to call this API, so it can be used outside of a CarAppService
.