How to make the volume buttons control system volume rather than just some volume?

Sep 27, 2017
10
0
0
Visit site
I have found plenty of ways to set it up to control the media volume by default, but I also want to be able to control alarm volume and ringtone/call volume with the volume buttons.

I also found an app called buttons remapper that would work, except the free version only allows two actions to be triggered, while I would need 8 (media, alarm, call, and ringtone volume + and -), and it doesn't have options for call or alarm volume.

If it matters I have an honor 7 lite with android 7.0
 
Sep 27, 2017
10
0
0
Visit site
Or could I have some help writing some code to do this for me, if it doesn't exist? The actual code seems like it should be simple, but I'm having a few problems, especially with however the android api works and is documented.

right now, my xml looks like this: https://pastebin.com/Hz1n2KEw

and my code looks like this: https://pastebin.com/hH509BH8

It does what I want, sort of. for some reason it adjusts all the channels at different speeds, and I can't find anything about how to make it change the volume channel at a slower speed.

I also want to disable the normal action so that call/media volume doesn't change at different speeds depending on when I am doing different things.

Finally, I have no idea how to make it run in the background. I read something about services, but I did not see any complete examples, and I don't know enough about androids api yet to run what I saw. Does anyone know a good tutorial on how those work?



Thanks for any help in solving this problem.
 
Sep 27, 2017
10
0
0
Visit site
Nevermind, I figured out how to make a service, but apparently they can't react to button presses for some reason. (Also figured out how to make the volume change a little smother.)

Except the apps that run in the background that can but don't have the functionality for what I want, no idea how they work.
 
Sep 27, 2017
10
0
0
Visit site
Nevermind, I figured out how to make a service, but apparently they can't react to button presses for some reason. (Also figured out how to make the volume change a little smother.)

Except the apps that run in the background that can but don't have the functionality for what I want, no idea how they work.