Posts

Showing posts with the label Android - Audio Manager Tutorial

Android - Audio Manager Tutorial

Image
You can easily control your ringer volume and ringer profile i-e:(silent,vibrate,loud e.t.c) in android. Android provides AudioManager class that provides access to these controls. In order to use AndroidManager class, you have to first create an object of AudioManager class by calling the  getSystemService()  method. Its syntax is given below. private AudioManager myAudioManager ; myAudioManager = ( AudioManager ) getSystemService ( Context . AUDIO_SERVICE ); Once you instantiate the object of AudioManager class, you can use setRingerMode  method to set the audio or ringer profile of your device. Its syntax is given below. myAudioManager . setRingerMode ( AudioManager . RINGER_MODE_VIBRATE ); The method setRingerMode takes an integer number as a parameter. For each mode , an integer number is assigned that will differentiate between different modes. The possible modes are. Sr.No Mode & Description 1 RINGER_MODE_VIBRATE This Mode sets the device at...