scsjc Well-Known Member Licensed User Longtime User Oct 24, 2018 #1 Hi, i'm try to use a BroadCastReceive Library, with this sample: https://www.b4x.com/android/forum/t...tect-headset-is-plugged-in.20035/#post-152772 but not work, i don't know if is a problem from a android8 permisions... Last edited: Oct 24, 2018
Hi, i'm try to use a BroadCastReceive Library, with this sample: https://www.b4x.com/android/forum/t...tect-headset-is-plugged-in.20035/#post-152772 but not work, i don't know if is a problem from a android8 permisions...
scsjc Well-Known Member Licensed User Longtime User Oct 24, 2018 #2 i try filter intent in a Android8 and work: B4X: AddReceiverText(a2dp, <intent-filter> <action android:name="android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED" /> </intent-filter> ) when arrive the ... "android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED" ... I guess it's STATUS=00 --> DISCONNECT STATUS=02 --> CONNECT but I do not know if it's the best way or there is some better method Upvote 0
i try filter intent in a Android8 and work: B4X: AddReceiverText(a2dp, <intent-filter> <action android:name="android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED" /> </intent-filter> ) when arrive the ... "android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED" ... I guess it's STATUS=00 --> DISCONNECT STATUS=02 --> CONNECT but I do not know if it's the best way or there is some better method
Erel B4X founder Staff member Licensed User Longtime User Oct 24, 2018 #3 A static intent filter is the best way (when possible). The intent structure is documented here: https://developer.android.com/refer...hAdapter.html#ACTION_CONNECTION_STATE_CHANGED State constants: https://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#STATE_CONNECTED Upvote 0
A static intent filter is the best way (when possible). The intent structure is documented here: https://developer.android.com/refer...hAdapter.html#ACTION_CONNECTION_STATE_CHANGED State constants: https://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#STATE_CONNECTED