Jump to content

  • Log In with Google      Sign In   
  • Create Account


Get the device volume


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 sheep19   Members   -  Reputation: 388

Like
0Likes
Like

Posted 25 September 2012 - 01:57 PM

I will explain my situation briefly:

Let's say I'm on my android phone and I set the volume to 0 (silent).
Then I start my application. Inside my app, I start playing music (using MediaPlayer).
I don't want the music to start playing - but it does, even though the phone is silenced. I'm not saying that's wrong.

So what I want to do is to "get" the volume of the device (it would have to be 0 or 0.0 in this case) and set it using: audioManager.setStreamVolume().

How can I get that information?

Sponsor:

#2 frob   Moderators   -  Reputation: 18827

Like
0Likes
Like

Posted 25 September 2012 - 02:09 PM

I'd try adjustSuggestedStreamVolume instead.

That will raise and lower the volume by one increment, and it will operate correctly if the device has weird audio streams.
Check out my personal indie blog at bryanwagstaff.com.

#3 6677   Members   -  Reputation: 1058

Like
0Likes
Like

Posted 27 September 2012 - 11:51 AM

Just an FYI, android maintains 3 seperate volume levels. Ringer volume (which is what the silent mode refers to), Media volume (which I think is the only one apps can play with directly) and In call volume.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS