Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I detect whether the android phone in Silent mode programmatically

Tags:

android

How to identify whether the phone is in Silent mode or not?

I am using Android 1.5. I tried by using "android.provider.Settings.ACTION_SOUND_SETTINGS". It is not working.

like image 579
Raghu Avatar asked Jan 12 '10 11:01

Raghu


People also ask

How do I know if my Android phone is on silent?

Press the "Up" volume button on the Android phone until the Silent Mode icon on the screen changes. The Silent Mode icon looks like a speaker with a line through it or a speaker with circle and a line superimposed over it. When the Silent Mode is disabled, only a speaker icon appears.

How do I find my phone if it is on silent mode?

When your physical search for your lost Android has proven fruitless, just go to android.com/find. Sign in to your Google account, select Make it ring. Even if your phone is on silent, it'll ring. Alternatively, you can use the Find My Device app installed on another Android.

Can an app override silent mode Android?

Tap that to open Settings and then go to Notifications. Within this window, locate and tap the app you want to give override privilege. In the new window (Figure B), tap Override Do Not Disturb and that app will no longer be silenced by the DND system.


1 Answers

Use the getRingerMode() method in AudioManager.

AudioManager am = (AudioManager)getSystemService(Context.AUDIO_SERVICE);  switch (am.getRingerMode()) {     case AudioManager.RINGER_MODE_SILENT:         Log.i("MyApp","Silent mode");         break;     case AudioManager.RINGER_MODE_VIBRATE:         Log.i("MyApp","Vibrate mode");         break;     case AudioManager.RINGER_MODE_NORMAL:         Log.i("MyApp","Normal mode");         break; } 
like image 160
Dave Webb Avatar answered Sep 29 '22 06:09

Dave Webb