Showing posts with label Ringer. Show all posts
Showing posts with label Ringer. Show all posts

Set Ringer to Vibrate

RINGER_MODE_VIBRATE was added in API Level 1
Ringer mode will be silent and will vibrate. (This will cause the phone ringer to always vibrate, but the notification vibrate to only vibrate if set.)

1. Initialize an AudioManager Variable named myAudioManager.

2. In the MainActivity.java file, add the following code the onCreate method. This will set the ringer to silent.

myAudioManager.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);

3. Compile and run!

Next Recommended Article: Set Ringer to Silent

Resources:
http://developer.android.com/reference/android/media/AudioManager.html#RINGER_MODE_VIBRATE

A fun Android Vibrating png
http://img.cryptlife.com/2012/08/android_custom_vibrations_create_cryptlife.png

Set Ringer Mode to Normal

RINGER_MODE_NORMAL was added in API Level 1
Ringer mode that may be audible and may vibrate. It will be audible if the volume before changing out of this mode was audible. It will vibrate if the vibrate setting is on.

1. Initialize an AudioManager Variable named myAudioManager.

2. In the MainActivity.java file, add the following code the onCreate method. This will set the ringer to normal, which may be either audible or vibrate.

myAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);

3. Compile and run!

Next Recommended Article: Set Ringer to Vibrate

Resources:
http://developer.android.com/reference/android/media/AudioManager.html#RINGER_MODE_NORMAL