Hello i cant find an answer to my question. I create application to control an Android TV, and also i create a Button
s for control a volume UP, DOWN, but how to do this?
Its not problem for me to send a byte to TV, but i dont know how to control the volume, specific with Up and Down.
Can u help me guys?
How about this
//Create an AudioManager
AudioManager audio = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
//Increase the volume
audio.adjustStreamVolume(AudioManager.STREAM_MUSIC,AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI);
//Decrease the volume
audio.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER, AudioManager.FLAG_SHOW_UI);