getSystemVolume() or the equivalent

I don't expect to be able to SET the user-controlled system volume, but being able to read it would be helpful.

Example: I'm adding alarm clock function to my Playtime clocks app. When someone sets an alarm, I'd like to be able to display a warning if the volume is set below 25%, say. (I can already detect attached headphones for the same reason.)

Could be useful for games too: if audio is absolutely vital, a game might choose to warn people if the sound is muted/low.

(My fallback solution: play a sound as the alarm is set—at least it's a chance for the user to notice on their own if they can't hear the expected feedback.)

4 Likes