I have read and tested posts that use manifest and class to detect a bluetooth device being connected and disconnected, which work fine. But I want to know whether a bluetooth headset (A2DP profile) is connected when my app starts, without having to wait for a connect/disconnect.
I realise I could simply have the app be triggered on connect/disconnect, log the state, and exit again. Then when I manually run the app, I could read the last logged state, but thats rather klutzy. The app needs to know as it plays with volume at startup and that depends on whether a headset is connected. Futher I have several apps do the same.
To cut a long story short, it would be nice if my apps could simply query whether a headset is connected.
I realise I could simply have the app be triggered on connect/disconnect, log the state, and exit again. Then when I manually run the app, I could read the last logged state, but thats rather klutzy. The app needs to know as it plays with volume at startup and that depends on whether a headset is connected. Futher I have several apps do the same.
To cut a long story short, it would be nice if my apps could simply query whether a headset is connected.