I'm trying to find a way to disable and enable keyboard sound and vibration when tapping keys. I've searched on Stack Overflow and other Android Forums but i didn't found any result.
I've tried AudioManager
to enable vibrate mode, but i want to activate the vibrate mode and sound on keyboard.
audioManager.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);
audioManager.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,
AudioManager.VIBRATE_SETTING_ON);
Is there any way how to change android.provider.Settings
for keyboard sound and vibration ?
Have a look at How to disable default sound effects for all my application or activity for disabling tap-sounds.
To disable Haptic feedback and touch sounds programmatically have a look at http://developer.android.com/reference/android/view/View.html#setHapticFeedbackEnabled(boolean) http://developer.android.com/reference/android/view/View.html#setSoundEffectsEnabled(boolean)
Easier done is by defining the following in your styles.xml
and in your manifest.xml
Yes, You can do this if you have root access. Its a lengthy process but you can do this :
Step : 1 Create xml file named
com.android.inputmethod.latin_preferences.xml
and save in assets.com.android.inputmethod.latin_preferences.xml
Step 2 : Copy this file into your application folder (anywhere where you can access) using
asset manager
for that you need<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
this function will copy file from assets
Step 3 : overwrite the system preference file system path (destPath) is
/data/data/com.android.inputmethod.latin/shared_prefs
Step 4 : Reboot device
That's all done. These step will off key press sound and key press vibration
As per your comments:
&
AFAIK, you can not accomplish this as each input method keeps its sound/vibration preference values internally. See for example Android (AOSP) IMe (as of this writing lines 30~39):
As you can see it stores the vibrate/sound values in its shared preference. That applies to most of IMe in the market. Hence, you can not control vibrate/sound effect for all IMe's from single point.