I have developed an app which uses my own custom keyboard (well, a view that looks like a keyboard and behaves like a keyboard anyway). One thing I’ve yet to figure it out is how to make it play the default soft keyboard 'click' sound when the buttons are pressed.
Is there any easy way to do this?
I would like to use the keyboard click sound that comes with the phone rather than providing my own. As different phones might have different keyboard click sounds, I would like to keep my application consistent. Ultimately, I want to reflect the same settings the user has chosen in their global keyboard settings (play/not play sounds, vibrate/not vibrate, etc).
I have found a solution to this. All I needed to do was implement a
OnTouchListeneron the button and use theAudioManager.playSoundEffect()public method. Code is shown below: