How can I automatically connect to the last connected audio source in Android?
We are building a video doorbell app, now instead of giving the user option to select audio output our UI/UX team asked us to hardcode selecting to the last selected audio source.
Ex: If a bluetooth is connected I have to make it as the audio source, if ear-phones connected i have to make that the last source if both bluetooth and ear-phones connected I need to find the last connected source and make that the audio output, If no sources connected should make speaker as default instead of earpiece.
Thanks.