I made a texting app for Android. When I tested it I found that if I try to go into silent mode (on a phone) the texting app will still go off, because it is set to a "media" and not a "ringtone" volume type.
Is there any way to change this so when I silence my phone, my app will also be silenced? I don't want the user to have to try and fix it.
Update: Sorry for any confusion. This has been a side project I did a while ago and I am just coming back to it now.
The project is a voice to text/ text to voice converter so all commands in the project can be done through voice. The app will "talk" to you through each step of the program. I want to have the ability so silence all "talking" that the app does to you the user if the phone is on silence. Here is how I handle voice feedback:
import android.speech.tts.TextToSpeech;
public class VoiceFeedback implements SMSFeedback{
private TextToSpeech tts;
private String text;
public VoiceFeedback(TextToSpeech tts, String text){
this.tts = tts;
this.text = text;
}
public void play(){
tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
}
}
I guess the real question I should be asking is:
Is there a way to tell if the phone is silenced so that I can edit the code to not include voice feedback when there is?
Thanks!