Capture hardware volume button events on Android

31 views
Skip to first unread message

hanno

unread,
May 12, 2015, 9:41:32 AM5/12/15
to codenameone...@googlegroups.com, hanno...@gmx.de
IDE: Eclipse
Windows 8.1
Simulator
Device: Samsung Galaxy S3 with Android 4.1.2, Samsung Galaxy GIO with Android 2.3.6

Hello,
I would like to capture hardware volume button events on Android, i.e. use the volume +/- events for a special purpose. You already mentioned in a previous post that there is no reliable cross-platform way to do this.
However, in native Android code it is quite easy, see http://stackoverflow.com/questions/2874743/android-volume-buttons-used-in-my-application
Can I capture these events in a Codename1 application, at least for my Android devices (maybe using native code)?

Thanks,
Hanno

Shai Almog

unread,
May 12, 2015, 10:15:40 AM5/12/15
to codenameone...@googlegroups.com, hann...@googlemail.com, hanno...@gmx.de, hann...@googlemail.com
Hi,
to abstract the differences between platforms we already handle all keys (menu, back etc.) we don't expose the volume keys to the user but its probably something we could do.
You can file an RFE for that although I'm not sure when we will get around to it.
If you want to suggest a patch to AndroidImplementation.java and generate a pull request I'm sure we can review and add it.
Reply all
Reply to author
Forward
0 new messages