'Check if phone is connected to Android Auto system

I am developing an app which should detect if phone is connected to a car. I suppose Android Auto would be the best option. The app is not meant to be compatible with the Android Auto, I just want to check if the phone is connected to the system, that's all.

All the help is truly appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source