Method for Android programming to obtain and set system ringtone and volume

This paper describes the method of Android programming to obtain and set the system ring tone and volume. Share with you for your reference, as follows:

Get the ringing tone and volume of Android system mobile phone through the program. Similarly, the method of setting the ring tone and volume is also very simple!

The method of setting the volume is also very simple. AudioManager provides the following methods:

public voidsetStreamVolume(intstreamType,intindex,intflags)

Streamtype has built-in constants, which can be seen in the document.

Java code:

In addition: during the game, only multimedia volume can be adjusted, not call volume. setVolumeControlStream(AudioManager.STREAM_MUSIC); Do not move for a long time, do not allow black screen, view.setkeepscreen on (true); It is estimated that the manifest file needs registration permission

For more Android related content, readers who are interested can view the special topics of this site: summary of Android multimedia operation skills (audio, video, recording, etc.), introduction and advanced tutorial of Android development, summary of Android view skills, summary of activity operation skills of Android programming, summary of Android operation JSON format data skills Summary of Android file operation skills, summary of Android resource operation skills and summary of Android control usage

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>