Assign custom command to phone's volume buttons

Hi,
first of all, thanks a lot for your great job.

At the moment I use Kodi 17,6 and mpchc as external player with an AVR without lan connection.
To control the AVR, I use Broadlink remote managed by an http rest bridge, so I can use http post command to increase or decrease the volume.
In yatse I created a couple of http post custom commands and they work as expected. They also work if I assign them to vol up/down soft buttons in yatse but the phone hw volume buttons don’t invoke the custom command. So, during a movie, with soft button I can control the avr and with hw button I control the mpchc sw volume.

My objective is to assign the custom commands to phone hw button.
How can I achieve it?

Thanks a lot

You need to write a simple plugin for that

That would allow proper integration in the system.

I’ve seen the code and you’re right, it seems quite easy.
I’ve need only a little help: I’ve a background in jee development but no experience in android dev.
So I’ve installed Android Studio, imported the project and setup the correct sdk (25).
But, at this point, I don’t know how to build the apk.

Can you give me little hint to make a step beyond?

Thank you

Since the app have no default activity you can just edit the configuration in run menu to start the configuration activity as easy workaround ot have AS install the app.

Once the phone is connected via ADB default action is just shift F10 to run the app.

This is a lot outside of support scope :frowning:

Hi Tolriq,
in the end, I didi it :slight_smile:
Now it’s exactly working as desired.

I give you only a feedback, in case you didn’t know. To be able to build the sample project I had to modify the build.gradle file (Project) adding this text following jcenter() statement:

maven {
url ‘https://maven.google.com
}

After that it worked without (not so many) problems :slight_smile:
thank you

Yes the template is a little outdated but as most plugins already exists there not much to gain to update it to latest stuff as it’s time consuming :frowning:

Anyway glad it works, do not hesitate to push to github if you can so that it can help other people.