I am experimenting with sound manager application to create different sound profiles for "RING, NOTIFICATION, MEDIA, SYSTEM".
As per setting the volume level, I am succeeded with it by using
AudioManager setStreamVolume(AudioManager.STREAM_RING, <value>);
The challenge comes with Vibration Settings.
Currently the api call:
AudioManager setVibrateSetting(vibrateType, vibrateSetting);
Is deprecated in API level 16 and no hope to use it..
The other alternatives is to use
AudioManager setRingerMode(AudioManager.RINGER_MODE_NORMAL);
But I am precisely looking to turn off and turn on vibration for
- RINGER
- NOTIFICATIONS
from my custom application. Or turn on for one of them at any time.
You can think I am doing something similar to the enabling and disabling vibration in sound settings from the OS settings option.
Any help?
For your concern firstly you need to define in Manifest file like this
And use like this in your class file. Wonder where exactly you need to put this.
For Example: