I am a newbie to Android. I am currently working on a use case which requires that my app automatically detects the car mode whenever it gets turned on (by the user). Whenever the car mode is turned on, I need to start a certain activity.
I have a Samsung S4 which has "Hands-free mode", similarly other Android phones have "car mode" and "Driving mode". How do I detect them automatically?
(I'll just use "car mode" for this question)
The closest I got was here
But I don't want to detect the car mode repeatedly. That would cost more energy from battery. I just want to trigger something whenever car mode is turned on.
Thanks, in advance! :)