G GuyBooth Active Member Licensed User Longtime User Sep 20, 2018 #1 When I trigger the code ph.SetRingerMode(2) to turn the phone ringer on, the phone beeps. Is there some way to prevent this? I want to activate the phone ringer, but I don't want to tell the world I'm doing it.
When I trigger the code ph.SetRingerMode(2) to turn the phone ringer on, the phone beeps. Is there some way to prevent this? I want to activate the phone ringer, but I don't want to tell the world I'm doing it.
Semen Matusovskiy Well-Known Member Licensed User Sep 20, 2018 #2 I don't know, what you use, but "native" public void setRingerMode (int ringerMode) uses 2 - RINGER_MODE_NORMAL 0 - RINGER_MODE_SILENT 1 - RINGER_MODE_VIBRATE Try zero instead of 2. BTW, setRingerMode requires android.permission.ACCESS_NOTIFICATION_POLICY in manifest + (API23+) to ask user to grant access See https://www.b4x.com/android/forum/t...e-do-not-disturb-mode-programmatically.82794/ Last edited: Sep 20, 2018 Upvote 0
I don't know, what you use, but "native" public void setRingerMode (int ringerMode) uses 2 - RINGER_MODE_NORMAL 0 - RINGER_MODE_SILENT 1 - RINGER_MODE_VIBRATE Try zero instead of 2. BTW, setRingerMode requires android.permission.ACCESS_NOTIFICATION_POLICY in manifest + (API23+) to ask user to grant access See https://www.b4x.com/android/forum/t...e-do-not-disturb-mode-programmatically.82794/
G GuyBooth Active Member Licensed User Longtime User Sep 20, 2018 #3 Semen Matusovskiy said: I don't know, what you use, but "native" public void setRingerMode (int ringerMode) uses 2 - RINGER_MODE_NORMAL 0 - RINGER_MODE_SILENT 1 - RINGER_MODE_VIBRATE Try zero instead of 2. Click to expand... I am turning the ringer on, hence the use of 2, not 0. I use 0 when I am turning it off. It only beeps when I turn it on, but it is that beep that is causing my problem. I have all the permissions set properly, the code does work. Just not quietly. Upvote 0
Semen Matusovskiy said: I don't know, what you use, but "native" public void setRingerMode (int ringerMode) uses 2 - RINGER_MODE_NORMAL 0 - RINGER_MODE_SILENT 1 - RINGER_MODE_VIBRATE Try zero instead of 2. Click to expand... I am turning the ringer on, hence the use of 2, not 0. I use 0 when I am turning it off. It only beeps when I turn it on, but it is that beep that is causing my problem. I have all the permissions set properly, the code does work. Just not quietly.
Erel B4X founder Staff member Licensed User Longtime User Sep 21, 2018 #4 Try to mute or lower the volume of VOLUME_NOTIFICATION (?) channel. Phone.SetMute or Phone.SetVolume. Make sure to read the documentation of these methods. Upvote 0
Try to mute or lower the volume of VOLUME_NOTIFICATION (?) channel. Phone.SetMute or Phone.SetVolume. Make sure to read the documentation of these methods.
G GuyBooth Active Member Licensed User Longtime User Sep 21, 2018 #5 Erel said: Try to mute or lower the volume of VOLUME_NOTIFICATION (?) channel. Phone.SetMute or Phone.SetVolume. Make sure to read the documentation of these methods. Click to expand... None of these was successful. Tried with the various Volume settings channels (VOLUME_NOTIFICATION, VOLUME_ALARM, VOLUME_SYSTEM, VOLUME_RING). Seems others who have had a problem with the beep when the volume controls are adjusted, and some with rooted phones have solved it by disabling the sound file that plays. Not a solution for me, my phone is not rooted and I would not expect others to root theirs to use my app. Not sure where to go from here. Upvote 0
Erel said: Try to mute or lower the volume of VOLUME_NOTIFICATION (?) channel. Phone.SetMute or Phone.SetVolume. Make sure to read the documentation of these methods. Click to expand... None of these was successful. Tried with the various Volume settings channels (VOLUME_NOTIFICATION, VOLUME_ALARM, VOLUME_SYSTEM, VOLUME_RING). Seems others who have had a problem with the beep when the volume controls are adjusted, and some with rooted phones have solved it by disabling the sound file that plays. Not a solution for me, my phone is not rooted and I would not expect others to root theirs to use my app. Not sure where to go from here.