ocalle Active Member Licensed User Longtime User Mar 9, 2018 #1 Hello, have someone got a complete example to check if headphone switch button is pressed? I very confused with the manifest, tested an erel example but then not work anymore. Thank you and sorry by be repetitive Osvaldo
Hello, have someone got a complete example to check if headphone switch button is pressed? I very confused with the manifest, tested an erel example but then not work anymore. Thank you and sorry by be repetitive Osvaldo
Erel B4X founder Staff member Licensed User Longtime User Mar 9, 2018 #2 Have you tried this: https://www.b4x.com/android/forum/threads/mediasessions.62525/#post-394898 ? Upvote 0
ocalle Active Member Licensed User Longtime User Mar 9, 2018 #3 Yes Many ThankS! works fine! but with the activity right button on the phone, i need sense the jack button on headphone connector, similar to microphone function on earphones Upvote 0
Yes Many ThankS! works fine! but with the activity right button on the phone, i need sense the jack button on headphone connector, similar to microphone function on earphones
ocalle Active Member Licensed User Longtime User Mar 9, 2018 #4 Its intended to use with an old woman that cannot dial the phone, need call her son by a button Upvote 0
ocalle Active Member Licensed User Longtime User Mar 9, 2018 #5 hello i tested this example on forums and works fine! https://www.b4x.com/android/forum/threads/android-intent-action-media_button.60560/ Upvote 0
hello i tested this example on forums and works fine! https://www.b4x.com/android/forum/threads/android-intent-action-media_button.60560/
ocalle Active Member Licensed User Longtime User Mar 11, 2018 #6 Sometimes works some times no, how can i do this in b4a? Thank You! @override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_HEADSETHOOK){ //handle click return true; } return super.onKeyDown(keyCode, event); } Last edited: Mar 11, 2018 Upvote 0
Sometimes works some times no, how can i do this in b4a? Thank You! @override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_HEADSETHOOK){ //handle click return true; } return super.onKeyDown(keyCode, event); }
Erel B4X founder Staff member Licensed User Longtime User Mar 11, 2018 #7 Handle Activity_KeyPress. Upvote 0
ocalle Active Member Licensed User Longtime User Mar 18, 2018 #8 Thanks Erel, not work to me with keypress, i think is that more a mic state than a Keypress, the routine of change internal mic to external, when u click the headphone make some resistance that is detected by Os and change the mic to external. Upvote 0
Thanks Erel, not work to me with keypress, i think is that more a mic state than a Keypress, the routine of change internal mic to external, when u click the headphone make some resistance that is detected by Os and change the mic to external.