Not sure that it is possible. There was an example which I previously wrote for handling the "Call" bluetooth button. However I don't find it right now and it is not really related.
Service_Start will be called each time that a media button will be pressed.
The button value should be mapped to an extra with the key: android.intent.extra.KEY_EVENT
Thank for your information but I do not understand very well how do.(I am a B4A novice)
Please, can you give a little more information or a small example for this.
You should add a service and then add the code I posted to the manifest editor (don't forget to change serviceName to the name of the service you added).
When you press on the Bluetooth button, Service_Start will be called.
You should play with the Intent passed.
Erel, you said:
"Service_Start will be called each time that a media button will be pressed."
"The button value should be mapped to an extra with the key: android.intent.extra.KEY_EVENT"
Please, can you give me a example how mapped an extra key: android.intent.extra.KEY_EVENT?