AudioManager
seems to do what you need for the speaker volume. You can use the getStreamVolume
method in conjuction with one of the STREAM_X
constants to get the volume you need and store it with SharedPreferences
.
To set it afterwards, use the setStreamVolume method with the correct constant.