Bluetooth events

163 views
Skip to first unread message

Dmitry S

unread,
Apr 24, 2021, 3:55:12 AM4/24/21
to DroidScript
Hello!

I want to handle a button click event on a bluetooth headset. Unfortunately, the SetOnKey method does not see these events. Is there any other way to catch these events?

Alan Hendry

unread,
Apr 26, 2021, 9:57:51 AM4/26/21
to DroidScript
Hi,
You could test to see if Android sends a Broadcast for these events.

Dmitry S

unread,
May 13, 2021, 10:35:48 AM5/13/21
to DroidScript
Hello! Thanks for the information - it looks very encouraging. But unfortunately it doesn't work ....

понедельник, 26 апреля 2021 г. в 16:57:51 UTC+3, hendr...@gmail.com:

Alan Hendry

unread,
May 13, 2021, 12:26:14 PM5/13/21
to DroidScript
Hi,
I'm still learning/investigating intents and broadcasts.
If you aren't getting any bluetooth broadcasts then perhaps you need a permission
<uses-permission android:name="android.permission.BLUETOOTH" />
I know that you can add permissions in your code _AddPermissions("Camera")
but I believe they have to be in the DS Manifest, which would require the Technical Team 
Regards, ah

Steve Garman

unread,
May 13, 2021, 12:50:07 PM5/13/21
to DroidScript
To make sure you have full Bluetooth permissions in your apk you could add the following line of code
  _AddPermissions("Location, Bluetooth")

Dmitry S

unread,
May 19, 2021, 2:41:25 AM5/19/21
to DroidScript

Hello everybody! Thanks, the _AddPermissions line of code really helped to see some bluetooth events. But I still don't see the headset button press events. All I can see is the headset connect event. That being said, I don't see android.action.MEDIA_BUTTON events
четверг, 13 мая 2021 г. в 19:50:07 UTC+3, steve....@gmail.com:
Reply all
Reply to author
Forward
0 new messages