Beep sound notification on Socket connection establishment
How can I make the Device sound a beep when socket connection has b开发者_JAVA技巧een established. In other words, how to set a notification tone when an event occurs in Android sdk?
If you are the one opening the socket, use MediaPlayer
or SoundPool
or ToneGenerator
or AudioTrack
or something to play back a beep.
If you are trying to arrange for beeps when other applications open sockets, that is not possible without firmware modifications.
精彩评论