You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Eduardo Schettino <sc...@gmail.com> on 2014/07/05 14:45:32 UTC

volume button support on Android

Hi,

I would like to use the event "volumeupbutton" on android.
But the docs says that as of cordova 3.5 the only platform support is
BlackBerry [1].

I found an issue on the tracker regarding this but it is marked as "fixed"
since cordova 1.9.0. [2]

And I could indeed find some code to handle the volume button on the source
code. [3]

Does anyone knows whats the status of this? What is missing to get this
completely implemented for the android platform.

Regards,
  Eduardo


[1]
http://docs.phonegap.com/en/3.5.0/cordova_events_events.md.html#volumeupbutton_supported_platforms

[2] https://issues.apache.org/jira/browse/CB-870

[3]
https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=blob;f=framework/src/org/apache/cordova/CordovaWebView.java;h=ad5c0f0e04481a077ffb895d7f9b8870c2c0a136;hb=HEAD#l697

Re: volume button support on Android

Posted by Eduardo Schettino <sc...@gmail.com>.
Hi Andrew,

Looking at issue on jira the link to the pull-request is broken.
But in the "sub-task" [1] there is a link to a pull-request [2].
The patch is actually for js code...
and it seems pull-request was not merged in the current cordova-js.

The patch is a bit outdated... but I managed to get it working just by
doing the
same way as used in `backbutton` handling. I will submit a pull-request
soon.

[1] https://issues.apache.org/jira/browse/CB-871
[2]
https://github.com/revolunet/incubator-cordova-js/compare/master...volumebtns


Regards,
  Eduardo


On Mon, Jul 7, 2014 at 9:53 AM, Eduardo Schettino <sc...@gmail.com>
wrote:

>
>
>
> On Sun, Jul 6, 2014 at 8:14 PM, Andrew Grieve <ag...@chromium.org>
> wrote:
>
>> I believe it works on Android. Have you tried it?
>> >
>>
>
> Hi Anrew,
>
> Sure. I forgot to mention. I tried on android 4.1.1 and it didnt work.
>
> Later I found this plugin:
> http://plugins.cordova.io/#/package/com.manueldeveloper.volume-buttons .
> With the plugin my handler is executed but a dialog with "Ringtone volume"
> is still displayed on screen...
>
> Regards,
>   Eduardo
>

Re: volume button support on Android

Posted by Eduardo Schettino <sc...@gmail.com>.
On Sun, Jul 6, 2014 at 8:14 PM, Andrew Grieve <ag...@chromium.org> wrote:

> I believe it works on Android. Have you tried it?
> >
>

Hi Anrew,

Sure. I forgot to mention. I tried on android 4.1.1 and it didnt work.

Later I found this plugin:
http://plugins.cordova.io/#/package/com.manueldeveloper.volume-buttons .
With the plugin my handler is executed but a dialog with "Ringtone volume"
is still displayed on screen...

Regards,
  Eduardo

Re: volume button support on Android

Posted by Andrew Grieve <ag...@chromium.org>.
I believe it works on Android. Have you tried it?


On Sat, Jul 5, 2014 at 8:45 AM, Eduardo Schettino <sc...@gmail.com>
wrote:

> Hi,
>
> I would like to use the event "volumeupbutton" on android.
> But the docs says that as of cordova 3.5 the only platform support is
> BlackBerry [1].
>
> I found an issue on the tracker regarding this but it is marked as "fixed"
> since cordova 1.9.0. [2]
>
> And I could indeed find some code to handle the volume button on the source
> code. [3]
>
> Does anyone knows whats the status of this? What is missing to get this
> completely implemented for the android platform.
>
> Regards,
>   Eduardo
>
>
> [1]
>
> http://docs.phonegap.com/en/3.5.0/cordova_events_events.md.html#volumeupbutton_supported_platforms
>
> [2] https://issues.apache.org/jira/browse/CB-870
>
> [3]
>
> https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=blob;f=framework/src/org/apache/cordova/CordovaWebView.java;h=ad5c0f0e04481a077ffb895d7f9b8870c2c0a136;hb=HEAD#l697
>